automation - Andre-asn/Quack-Campus-Event-Coordinator GitHub Wiki

Automation

Automation will be used to make builds, testing, database changes, and deployment consistent and repeatable. The initial automation plan may evolve as the project is implemented.

Source Control and Pull Requests

The project source code is stored in GitHub. Development will be completed through feature branches and pull requests.

Every pull request will automatically run:

  • Backend compilation
  • Backend unit tests
  • Backend integration tests
  • Frontend build
  • Frontend linting
  • Frontend tests, when implemented
  • Basic static-analysis and formatting checks

A pull request should not be merged when a required automated check fails.

Continuous Integration

GitHub Actions will be used as the continuous-integration platform because the source repository is already hosted on GitHub.

The initial CI workflow will:

  1. Check out the source code.
  2. Install the required Java and Node.js versions.
  3. Install frontend and backend dependencies.
  4. Build the React client.
  5. Build the Spring Boot API.
  6. Run unit tests.
  7. Start a temporary PostGIS database using Testcontainers.
  8. Run backend integration tests.
  9. Report the result on the pull request.

Automated Testing

JUnit 5 and Spring Boot Test will be used for backend unit and integration tests. Testcontainers will start a real PostgreSQL/PostGIS database for tests involving spatial queries, database constraints, event visibility, and attendance.

Frontend tests will validate important user interactions such as:

  • Loading the event map
  • Creating an event
  • Opening event details
  • Joining and leaving an event
  • Handling validation and API errors

The complete post, discover, and join workflow may later be automated as an end-to-end test.

Database-Migration Automation

Flyway will manage versioned database migrations stored in the repository. Migrations will execute automatically when the Spring Boot application starts.

Database tables and columns will not be created or modified manually in the deployed environment.

Deployment Automation

The project will have two environments:

  • Local development
  • One deployed staging/demo environment

Merging approved changes into the main branch will trigger deployment of the frontend and backend. The React client and Spring Boot API will be deployed separately.

After deployment, an automated smoke test should verify that:

  • The frontend is reachable.
  • The API health endpoint responds.
  • The database connection is available.
  • A basic event query succeeds.

Secrets and Configuration

OAuth credentials, database credentials, Mapbox tokens, and deployment credentials will not be committed to the repository.

Secrets will be stored using GitHub Actions secrets and the selected hosting platform's environment-variable configuration.

Demo-Data Automation

A repeatable seed-data script or Spring profile will create realistic users, events, and attendance data for the final demonstration. Seeded users will be marked with is_seed and will not be permitted to authenticate.

Code-Generation Automation

AI-assisted tools may be used to generate boilerplate code, draft tests, documentation, and initial configuration files. Generated code will not be accepted automatically.

All generated code must:

  • Be reviewed by a team member
  • Follow the selected architecture
  • Be committed through a normal pull request
  • Pass the same automated build and test checks as manually written code
  • Avoid including secrets, private information, or unverified dependencies

Preliminary GitHub Actions Workflow

flowchart TD
    A[Developer opens pull request] --> B[Build frontend and backend]
    B --> C[Run unit tests]
    C --> D[Start PostGIS Testcontainer]
    D --> E[Run integration tests]
    E --> F[Team reviews pull request]
    F --> G[Merge into main]
    G --> H[Deploy frontend and API]
    H --> I[Run smoke test]