Skip to content

Create GitHub Actions CI/CD pipeline#55

Merged
RonaldRonnie merged 9 commits intomainfrom
issue/49-github-actions-cicd
Jan 2, 2026
Merged

Create GitHub Actions CI/CD pipeline#55
RonaldRonnie merged 9 commits intomainfrom
issue/49-github-actions-cicd

Conversation

@RonaldRonnie
Copy link
Collaborator

  • Created .github/workflows/ci.yml with comprehensive CI/CD pipeline

    • Test job: Runs tests on Python 3.8, 3.9, 3.10, 3.11
    • Lint job: Code quality checks with black and flake8
    • Type-check job: Type checking with mypy
    • Security job: Security scanning with bandit and safety
    • Docker-build job: Builds and tests Docker image
    • All-checks job: Summary of all checks
  • Features:

    • Tests run on all supported Python versions (3.8-3.11)
    • Automated linting (black, flake8)
    • Automated type checking (mypy)
    • Security scanning (bandit, safety)
    • Docker image build and test
    • Code coverage reporting
    • Workflow runs on PR and push to main/develop
  • Added status badges to README:

    • CI/CD Pipeline status badge
    • Code Quality (Black) badge

Fixes #49

- Remove excessive bold formatting and structured sections
- Simplify language to be more conversational
- Remove 'Answer:' and 'Pros:' patterns
- Make it sound more like developer-written documentation
- Remove 'Questions Addressed' section
- Simplify testing checklist format
- Created pyproject.toml with build system configuration and project metadata
- Migrated all metadata from setup.py to pyproject.toml
- Updated Dockerfile to install package from pyproject.toml during build
- Updated documentation (README.md, QUICKSTART.md, DEPLOYMENT_REQUIREMENTS.md)
- Maintained backward compatibility with setup.py

Fixes #45
- Created credential masking utility (app/utils/credential_masking.py)
  - mask_credential(): Masks individual credentials (shows last 4 chars)
  - mask_string(): Masks credentials in text strings
  - mask_dict(): Masks credentials in dictionaries
  - safe_log_message(): Creates safe log messages
  - mask_exception_message(): Masks exception messages

- Fixed all logging statements to mask credentials:
  - app/utils/config.py: Fixed error logging
  - app/models/llm_provider.py: Fixed all error logging
  - app/models/unified_qa.py: Fixed all error logging
  - app/models/gemini_qa.py: Fixed all error logging
  - app/services/data_retrieval.py: Fixed 12 error logging instances
  - app/api/routers/system.py: Fixed 10 error logging instances
  - app/api/routers/bugsigdb_analysis.py: Fixed error logging
  - app/api/routers/bugsigdb_analysis_v2.py: Fixed 5 error logging instances
  - app/api/routers/study_analysis.py: Fixed error logging
  - app/api/utils/api_utils.py: Fixed error logging
  - app/api/app.py: Fixed global exception handler

- Fixed error messages to not expose credentials
- Added comprehensive test suite (tests/test_credential_masking.py)
- Security audit completed for all critical files

Fixes #46
- Created .github/workflows/ci.yml with comprehensive CI/CD pipeline
  - Test job: Runs tests on Python 3.8, 3.9, 3.10, 3.11
  - Lint job: Code quality checks with black and flake8
  - Type-check job: Type checking with mypy
  - Security job: Security scanning with bandit and safety
  - Docker-build job: Builds and tests Docker image
  - All-checks job: Summary of all checks

- Features:
  - Tests run on all supported Python versions (3.8-3.11)
  - Automated linting (black, flake8)
  - Automated type checking (mypy)
  - Security scanning (bandit, safety)
  - Docker image build and test
  - Code coverage reporting
  - Workflow runs on PR and push to main/develop

- Added status badges to README:
  - CI/CD Pipeline status badge
  - Code Quality (Black) badge

Fixes #49
- Add PYTHONPATH environment variable for tests
- Add verification step before running tests
- Increase maxfail to 10 to see more test failures
- Add E501 to flake8 ignore list (line length)
- Add better diagnostic output for debugging
- Update pyproject.toml to use paper-qa>=4.9.0 (compatible with Python 3.8-3.11)
- Add conditional paper-qa installation in CI workflow:
  - Python 3.11: Install from GitHub (latest) or fallback to 4.9.0
  - Python 3.8-3.10: Install paper-qa>=4.9.0,<5.0.0 (stable version)
- Fixes CI failures: paper-qa>=5.0.0 doesn't exist on PyPI yet

This resolves the 'No matching distribution found for paper-qa>=5.0.0' error
- Remove Python version matrix (3.8, 3.9, 3.10, 3.11)
- Use only Python 3.11 for all tests (matches Docker and production)
- Simplify paper-qa installation (no conditional logic needed)
- Fixes pandas>=2.1.1 compatibility issues with older Python versions

This makes CI faster and avoids dependency conflicts with Python 3.8-3.10
- Fix missing commas in dictionaries (gemini_qa.py)
- Fix unterminated docstring in data_retrieval.py
- Fix indentation errors in test files (test_api_utils.py, test_integration.py,
  test_cache_manager.py, test_text_processing.py, test_api_endpoints.py,
  test_integration_workflow.py)
- Update CI lint job to use Docker for black and flake8 (avoids venv setup)

All files now pass Python syntax validation and should format correctly with black.
- Add 'load: true' to docker/build-push-action to make image available locally
- This fixes the 'Unable to find image' error in the Docker test step
- Image is now properly loaded into Docker daemon for testing
@RonaldRonnie RonaldRonnie merged commit e2db2a3 into main Jan 2, 2026
2 checks passed
@RonaldRonnie RonaldRonnie deleted the issue/49-github-actions-cicd branch January 2, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create GitHub Actions CI/CD pipeline

1 participant