Repository navigation
ci: post-deploy smoke, nightly e2e, deploy paths-ignore and manual deploy #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Kzoeps
wants to merge
8
commits into
main
Choose a base branch
from
ci/post-deploy-checks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,534
−3
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
75f6bea
tooling: add read-only live API smoke runner
Kzoeps 70797c7
tooling: add paced live API e2e checks
Kzoeps 87cb214
ci: run smoke after deploy, every 30 min and nightly e2e
Kzoeps fa6674c
ci: skip deploy for docs-only and tooling pushes
Kzoeps 669dbaf
ci: add manual deploy and smoke without a second environment gate
Kzoeps aa42310
ci: skip smoke on rollback commits that predate it
Kzoeps 6cdce52
happyview-modules: document deploy paths-ignore, manual deploy and smoke
Kzoeps 8f90e9f
tooling: address SonarCloud findings in smoke runner
Kzoeps File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Nightly e2e | ||
|
|
||
| # Deep read-only checks (pagination walks, 100-subject batches, cross-endpoint count invariants). | ||
| # Too slow for the deploy path, so they run off-peak, one environment at a time, and every | ||
| # environment reports even when an earlier one fails. | ||
| on: | ||
| schedule: | ||
| - cron: "17 3 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: E2E (${{ matrix.environment }}) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| concurrency: | ||
| group: e2e-${{ matrix.environment }} | ||
| cancel-in-progress: false | ||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 1 | ||
| # URLs are mapped here because these environments only deploy from their own branches, | ||
| # so a job running from main cannot use `environment:` to read their variables. | ||
| matrix: | ||
| include: | ||
| - environment: Test | ||
| url: https://test.api.hypercerts.dev | ||
| - environment: Staging | ||
| url: https://api.staging.hypercerts.dev | ||
| - environment: Production | ||
| url: https://api.hypercerts.dev | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up pnpm | ||
| uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: pnpm | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: Run e2e checks | ||
| env: | ||
| API_BASE_URL: ${{ matrix.url }} | ||
| run: pnpm e2e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| name: Smoke | ||
|
|
||
| # Catches drift between deploys: runs the same read-only smoke test as deploy.yml against the | ||
| # live API. Scheduled runs target Production; use "Run workflow" for Test or Staging. | ||
| on: | ||
| schedule: | ||
| - cron: "*/30 * * * *" | ||
| workflow_dispatch: | ||
| inputs: | ||
| environment: | ||
| description: Environment to check | ||
| type: choice | ||
| options: [Test, Staging, Production] | ||
| default: Production | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| smoke: | ||
| name: Smoke test (${{ inputs.environment || 'Production' }}) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| # Own group per environment, deliberately not the deploy group: a smoke run never queues | ||
| # behind or cancels a deploy. A run that is still going when the next one starts is left alone. | ||
| concurrency: | ||
| group: smoke-${{ inputs.environment || 'Production' }} | ||
| cancel-in-progress: false | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up pnpm | ||
| uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | ||
| with: | ||
| node-version-file: .nvmrc | ||
| cache: pnpm | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| # No `environment:` here: Test/Staging/Production deployment branch policies only allow | ||
| # main/staging/production, and this workflow runs from main. So the URLs are mapped here | ||
| # instead of read from the environment's HAPPYVIEW_BASE_URL variable. | ||
| - name: Resolve API URL | ||
| id: target | ||
| env: | ||
| ENVIRONMENT: ${{ inputs.environment || 'Production' }} | ||
| run: | | ||
| case "$ENVIRONMENT" in | ||
| Test) url=https://test.api.hypercerts.dev ;; | ||
| Staging) url=https://api.staging.hypercerts.dev ;; | ||
| Production) url=https://api.hypercerts.dev ;; | ||
| *) echo "::error::Unknown environment '$ENVIRONMENT'; add its URL to smoke.yml." >&2; exit 1 ;; | ||
| esac | ||
| echo "url=$url" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Smoke test the live API | ||
| env: | ||
| API_BASE_URL: ${{ steps.target.outputs.url }} | ||
| run: pnpm smoke |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep installation and smoke checks within one concurrency boundary.
If two runs target the same environment, run B can start deployment after run A's
deployjob finishes, while A's smoke job installs dependencies. A then checks B's API, or an API changing during installation, with A's cases. The job-scoped lock does not cover smoke. Run smoke inside the deploy job, or serialize the complete install-and-smoke sequence. (raw.githubusercontent.com)