-
Notifications
You must be signed in to change notification settings - Fork 0
Testing and Continuous Integration
This section outlines the process and rules for submitting and merging Pull Requests (PRs). All code changes must go through this process to ensure quality and stability.
The specifics of this process are specified and enforced using GitHub's Ruleset feature.
The following rules apply to PRs targeting both the develop and main branches:
-
PRs are Mandatory: All commits must be made on a feature branch and submitted via a pull request. Direct pushes to
developandmainare blocked. - Resolve All Conversations: Before a PR can be merged, all comments and requested changes must be addressed and resolved.
-
No Force Pushing: Force pushes are disabled on
developandmainto protect the commit history. - Status Checks: In the future, all required status checks (like automated tests and builds) must pass before a PR can be merged.
The develop branch is our primary integration branch for new features and bugfixes.
- Required Approvals: 1 approving review from another team member is required.
The main branch contains stable, production-ready code. PRs to main typically come from the develop branch.
- Required Approvals: 2 approving reviews from other team members are required.
Our project will follow the semantic versioning number format.
To track iterations and releases, we use Git tags as follows:
- Tags on develop: We apply tags to the develop branch for each iteration (e.g., v0.1.0, v1.3.0) to mark significant milestones or completion of development cycles. Iterations will bump the minor version number by 1.
- Tags on main: We apply tags to the main branch for official releases (e.g., v1.0.0, v2.1.0) to denote stable versions ready for production. Releases will bump the major version number by 1.
This project uses GitHub Actions to automate our Continuous Integration pipeline. The goal of our CI setup is to ensure code quality, prevent regressions, and verify build integrity automatically whenever code is contributed.
Our CI strategy is designed for a monorepo structure. We utilize a "Smart Change Detection" system to only run workflows relevant to the modified files.
Key Features:
- Set up a CI/CD pipeline (GitHub Actions): Automated workflows trigger on specific events.
- Automated Verification: Runs tests and linters automatically on each push or PR.
- Quality Gates: The pipeline is configured to fail builds on test/lint failures, preventing broken code from merging.
-
Change Detection: Saves resources by only testing the
backend,frontend, orn8nservices if files in those directories have changed.
The pipelines are triggered on:
-
pull_request: Targeted atmainordevelopbranches. -
push: Tomainordevelopbranches. -
workflow_dispatch: Manual triggers via the GitHub UI.
Before code even reaches GitHub, we use Husky to enforce quality standards locally. A pre-commit hook runs lint-staged to ensure that:
- Frontend: runs linting, formatting checks, and related tests.
- Backend: runs linting, formatting checks, and related tests.
If these checks fail locally, the commit is aborted.
The CI pipelines generally follow a two-stage process:
-
Detect Changes: Checks which directories (
backend/,frontend/,n8n/) have been modified. - Execute Jobs: Runs the specific CI jobs for the modified components.
Workflow Dependency Visualization:
This job checks out the code and identifies modified files. If no changes are detected in a specific module, the subsequent heavy jobs for that module are skipped to save build time.
Detect Changes Job (Backend):
Configuration File: [.github/workflows/backend_ci.yaml](https://github.com/NathanGrenier/AERO/blob/main/.github/workflows/backend_ci.yaml)
The Backend CI runs on our self-hosted runners (arc-runner-set) using Node.js 22.
- Checkout: Retrives the codebase.
-
Setup Node: Configures Node 22 and caches
npmdependencies. -
Install Dependencies: Runs
npm cifor a clean install. -
Format Check: Verifies code formatting using Prettier (
npm run format:check). -
Lint: Static analysis using ESLint (
npm run lint). -
Unit Test: Runs Vitest with coverage (
npm run coverage). -
Build: Verifies the project compiles using TypeScript (
npm run build). - Codecov: Uploads coverage reports to Codecov for analysis.
Backend CI:
Configuration File: [.github/workflows/frontend_ci.yaml](https://github.com/NathanGrenier/AERO/blob/main/.github/workflows/frontend_ci.yaml)
The Frontend CI handles React Native/Expo verification and build previews for Web and Android.
- Setup: Node 22 environment.
- Format & Lint: Checks formatting (Prettier) and runs Expo Lint.
-
Unit Tests: Runs Jest tests (
npm run coverage). - Coverage: Uploads reports to Codecov.
- Expo Doctor: Validates the Expo environment.
-
Build: Exports the web version of the app (
npm run build:web-dev).
- Setup: Installs Java 17, Android SDK, and EAS CLI.
- Caching: Caches Gradle dependencies to speed up future builds.
-
Build: Generates an Android preview build via EAS (
npm run build:android-prev).
Frontend CI:
Configuration File: [.github/workflows/n8n_ci.yaml](https://github.com/NathanGrenier/AERO/blob/main/.github/workflows/n8n_ci.yaml)
Currently, the n8n pipeline serves as a placeholder for future automation regarding our workflow automation service.
-
Current Status: Checks for file changes in the
n8n/directory. - Future Roadmap: Will include dependency installation and workflow testing.
n8n CI: