Skip to content

CI/CD: Improve Backend CI Workflow and Add Missing Checks #66

Description

@purvanshjoshi

Description

The backend CI workflow has several issues that need to be addressed:

  1. Missing Security Checks:

    • No dependency vulnerability scanning
    • No secret detection in code
    • No license compliance checking
  2. Incomplete Testing:

    • No unit tests in CI pipeline
    • No integration tests
    • No code coverage reporting
  3. Performance Issues:

    • No parallel job execution
    • No caching optimization
    • No artifact caching

Proposed Fix

  1. Add security scanning:
    `yaml
  • name: Run security checks
    run: |
    pip install safety bandit
    safety check -r requirements.txt
    bandit -r . -f json -o bandit-report.json
    `
  1. Add testing step:
    `yaml
  • name: Run tests
    run: |
    pip install pytest pytest-cov
    pytest --cov=. --cov-report=xml --cov-report=html
    `
  1. Add code coverage reporting:
    `yaml
  • name: Upload coverage to Codecov
    uses: codecov/codecov-action@v3
    with:
    file: ./coverage.xml
    flags: unittests
    name: codecov-umbrella
    `
  1. Optimize workflow:
    `yaml
    jobs:
    lint-and-check:
    runs-on: ubuntu-latest
    strategy:
    matrix:
    python-version: ['3.10', '3.11']
    steps:
    • uses: actions/checkout@v4
    • name: Set up Python
      uses: actions/setup-python@v5
      with:
      python-version: '3.10'
      cache: 'pip'
      `

Acceptance Criteria

  1. Security scanning is added to CI pipeline
  2. Unit tests are integrated into CI
  3. Code coverage is tracked and reported
  4. Workflow is optimized for performance
  5. No emojis in any codebase changes or commits

Impact

MEDIUM - These issues affect:

  • Code quality assurance
  • Security vulnerability detection
  • Development workflow efficiency
  • Production deployment confidence

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions