Skip to main content

Branch Testing

Every push to a pull request branch triggers a test workflow.

Automatic PR Labeling

PRs are automatically labeled according to the folders that were changed:
  • backend - Backend code changes
  • frontend - Frontend code changes
  • integration-testing-api - API integration test changes
These labels determine which tests are run.

Test Suite

For each PR, the following actions are run:
  1. Lint - Code style and quality checks
  2. Unit Test - Component-level tests
  3. Integration Test - Cross-component tests

Deployments

Sandbox Deployment (Automatic)

Upon selecting merge for a PR, it will be added to a merge queue. The merge queue automatically merges the PR into the main branch. Once merged, the following actions are triggered based on PR labels:
LabelAction
frontendDeploy app-capital-service to sandbox
frontendDeploy storybook to sandbox
backendDeploy api-capital-service to sandbox

Staging/Production Deployment (Manual)

For deploys to staging and production:
  1. User cuts a release branch
  2. User goes to GitHub Actions UI
  3. Click Deploy Application Staging/Production (application-deployment.yml)
  4. Select the branch to deploy and the environment
Production deployments require approval from a user at each step.

Hotfix Deployment

Use the hotfix workflow when you need to deploy an urgent fix to staging or production without going through the normal release cycle.

When to use a hotfix

  • Critical bug fix needed in production
  • Urgent feature fix requested by stakeholders

Hotfix process

  1. Create a PR with your fix and merge it to master
  2. Go to GitHub Actions > Hotfix workflow
  3. Click Run workflow
  4. Select the target release branch (e.g., v2025.51.2)
  5. Enter the squashed commit SHA to cherry-pick
  6. Run the workflow
  7. Once the workflow completes, approve and merge the hotfix PR it creates
  8. Deploy the updated release branch to staging/production using the normal deployment workflow
To find the current release version, navigate to the staging or production environment and visit /api/version in your browser.

Workflow Files

Key workflow files are located in .github/workflows/:
FilePurpose
ci.ymlPR testing workflow
application-deployment.ymlStaging/production deployments

Best Practices

Before Creating a PR

  1. Run lint locally: just lint
  2. Run unit tests: just test
  3. Ensure your branch is up to date with main

Handling CI Failures

  1. Check the GitHub Actions tab for error details
  2. Fix any lint or test failures locally
  3. Push the fixes to your branch
  4. CI will automatically re-run

Deployment Checklist

For staging/production deployments:
  • All tests passing on the release branch
  • Release notes prepared
  • Stakeholders notified
  • Rollback plan documented (if applicable)