Skip to content

[DevOps] configure CI pipeline before PRΒ #57

@rkorszun

Description

@rkorszun

🎯 Objective

Create a CI pipeline that ensures seamless integration and testing of the following services:

  • Survey Service (Java, Spring Boot)
  • Processing Service (Python, FastAPI)
  • Frontend (React/TypeScript)

βœ… Tasks

1. Setup CI Workflow

  • Use GitHub Actions or another CI tool to define workflows for each service.
  • Ensure workflows are triggered on:
    • Pull requests (for linting and testing)
    • Merges to the main branch (to build and validate)

2. Linting

  • Survey Service: Use tools like checkstyle or spotbugs for static analysis.
  • Processing Service: Use ruff for fast Python linting and formatting checks.
    • Recommended commands:
      • ruff check .
      • ruff format .
  • Frontend: Use eslint with TypeScript configuration.
  • CI should fail on any linting errors.

3. Build and Test Each Service

  • Survey Service:
    • Build with Maven.
    • Run unit tests using mvn test.
    • Apply Flyway migrations in test context.
  • Processing Service:
    • Run tests using pytest.
    • Validate DB migrations and API endpoints.
  • Frontend:
    • Run unit tests with vitest.
    • Build using npm run build.

4. Integration Testing

  • Use Docker Compose to spin up all services together.
  • Run integration tests to validate:
    • Survey Service ↔ Processing Service
    • Frontend ↔ Survey Service
  • Use mock data to simulate real-world scenarios.

5. API Contract Validation

  • Use Swagger/OpenAPI definitions to validate API contracts between services.
  • Ensure no breaking changes are introduced.

6. Documentation

  • Update README files for each service to include:
    • Build and CI instructions
    • API documentation links (e.g., Swagger UI)
  • Document pipeline structure and usage.

πŸ§ͺ Acceptance Criteria

  • All services are linted, built, and tested automatically via the pipeline.
  • Integration tests confirm inter-service communication.
  • API contracts are verified against OpenAPI specifications.
  • CI pipeline fails on any linting, testing, or contract validation errors.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions