Skip to content

Conversation

@tomvothecoder
Copy link
Collaborator

@tomvothecoder tomvothecoder commented Jan 3, 2026

Description

Closes #32

This pull request adds a GitHub Actions CI workflow for backend testing and code quality checks, along with configuration updates to support environment-based settings and comprehensive test coverage improvements.

Key Changes:

  • Introduces a complete CI/CD workflow with PostgreSQL service, uv dependency management, pre-commit hooks, and pytest
  • Updates config.py to conditionally load .env files based on CI environment detection
  • Adds/updates tests for 100% backend coverage, including new tests for main app, OAuth flow, and configuration handling
  • Adds mypy type checking to pre-commit hooks

Requirements

Build Workflow:

  • Postgres setup
  • Environment variable setup
  • uv environment setup with caching
  • Pre-commit hooks with caching
  • Pytest

Codebase updates

  • Update config.py to support os.env variables and use .env file as a backup
  • Fix unit tests
  • Add unit tests for 100% coverage of backend

Checklist

  • Code follows project style guidelines
  • Self-reviewed code
  • No new warnings
  • Tests added or updated (if needed)
  • All tests pass (locally and CI/CD)
  • Documentation/comments updated (if needed)
  • Breaking change noted (if applicable)

Deployment Notes (if any)

@tomvothecoder tomvothecoder changed the title Devops/32 gh actions Add GH Actions build workflow Jan 3, 2026
@tomvothecoder tomvothecoder changed the title Add GH Actions build workflow Add GH Actions build workflow for backend Jan 3, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a GitHub Actions CI workflow for backend testing and code quality checks, along with configuration updates to support environment-based settings and comprehensive test coverage improvements.

Key Changes:

  • Introduces a complete CI/CD workflow with PostgreSQL service, uv dependency management, pre-commit hooks, and pytest
  • Updates config.py to conditionally load .env files based on CI environment detection
  • Adds/updates tests for 100% backend coverage, including new tests for main app, OAuth flow, and configuration handling
  • Adds mypy type checking to pre-commit hooks

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.github/workflows/build.yml New CI workflow with PostgreSQL, Python 3.13, uv, pre-commit, and pytest steps
backend/app/core/config.py Enhanced get_env_file() to detect CI environment and skip .env file requirements
backend/tests/test_main.py New test file for main app health endpoint and metadata
backend/tests/features/user/test_oauth.py New comprehensive tests for OAuth cookie transport functionality
backend/tests/features/user/test_api.py Updated API paths to include /api prefix for auth and user routes
backend/tests/features/simulation/test_schemas.py Updated status values from "new" to "created" and removed AnyUrl usage
backend/tests/features/simulation/test_api.py Updated API paths to include /api prefix for simulation routes
backend/tests/features/machine/test_api.py Updated API paths to include /api prefix for machine routes
backend/tests/core/test_config.py Added CI environment test and type ignore comments for union-attr
backend/app/scripts/seed.py Removed redundant type annotation
.pre-commit-config.yaml Added mypy type checking hook

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tomvothecoder tomvothecoder merged commit ccc3e2c into E3SM-Project:main Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DevOps] Add GitHub Actions build for backend

1 participant