-
Notifications
You must be signed in to change notification settings - Fork 164
feat: add V1 production e2e tests and release gate #142
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
19c7d36
feat: add V1 production e2e tests and release gate
tian-lan-landing 9226fe5
test: temporary push trigger to exercise e2e on branch (revert before…
tian-lan-landing ae96fa2
test: upload markdown as a named file for extract_jobs e2e
tian-lan-landing ab0dbce
chore: remove temporary branch push trigger from e2e workflow
tian-lan-landing b52dd02
fix(e2e): harden production env to main + non-vacuous job-list checks
tian-lan-landing 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # V1 end-to-end tests against the LIVE PRODUCTION API (api.va.landing.ai). | ||
| # | ||
| # Unlike the staging contract gate in pr-gates.yml, this is NOT wired to pull requests. | ||
| # It runs in exactly two places: | ||
| # 1. manually — Actions -> "E2E Production (V1)" -> Run workflow; | ||
| # 2. as the pre-tag gate in release.yml, which calls this workflow via `workflow_call` | ||
| # and refuses to stamp/commit/tag if it goes red. | ||
| # | ||
| # COST: every run exercises the full V1 surface (parse, extract, build-schema, classify, | ||
| # section, split, and both job types) against production, so it spends real inference | ||
| # credits and leaves real job records in the production org — roughly 8 inference calls | ||
| # on a 2-page PDF. That is the deliberate price of gating releases on the real API; do | ||
| # not add this to a per-PR trigger. | ||
| name: E2E Production (V1) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| workflow_call: | ||
|
|
||
| # Serialize runs so a manual dispatch cannot interleave with the gate of an in-flight | ||
| # release (both hit the same production org). A second run queues rather than racing. | ||
| concurrency: | ||
| group: e2e-production | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| e2e-production: | ||
| name: e2e (production V1) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| # Defense in depth: only main should reach the production key. release.yml runs on main | ||
| # and a manual dispatch is expected on main; anything else skips here. NOTE this is not | ||
| # the real control — a workflow_dispatch runs the SELECTED ref's copy of this file, which | ||
| # could drop the `if`, so the environment branch rule below is what actually protects the | ||
| # secret. A non-main dispatch now skips silently rather than failing; that's expected. | ||
| if: github.ref == 'refs/heads/main' | ||
| # Scopes the production key to a GitHub Environment instead of exposing it to every | ||
| # workflow in the repo. REQUIRED SETUP: in repo Settings -> Environments, create | ||
| # `production-e2e`, add LANDINGAI_ADE_PRODUCTION_APIKEY as an environment secret, and | ||
| # under "Deployment branches and tags" restrict it to `main` only. That branch rule is | ||
| # the control that actually protects the key: GitHub enforces it against the run's real | ||
| # ref, so a workflow_dispatch on another branch cannot hand its (possibly modified) | ||
| # checkout the production credential. The release gate still works — release.yml runs on | ||
| # main and calls this workflow, which inherits the caller's main ref. Keep the secret | ||
| # environment-only: do NOT also store it as a repo-level secret (every branch can read | ||
| # that, defeating the branch rule). Do NOT add required reviewers unless you want every | ||
| # release to pause for a manual approval — release.yml blocks on this job. | ||
| environment: production-e2e | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| # The tests self-skip when the key is absent (so a local `pytest -m production` | ||
| # is harmless). In CI that would turn a missing or rotated secret into a green | ||
| # run with zero tests executed — and, via release.yml, a release gated on | ||
| # nothing. Fail loudly here instead. | ||
| - name: Require the production API key | ||
| env: | ||
| LANDINGAI_ADE_PRODUCTION_APIKEY: ${{ secrets.LANDINGAI_ADE_PRODUCTION_APIKEY }} | ||
| run: | | ||
| if [ -z "$LANDINGAI_ADE_PRODUCTION_APIKEY" ]; then | ||
| echo "::error::LANDINGAI_ADE_PRODUCTION_APIKEY is not set. Add it as a secret on the" \ | ||
| "\`production-e2e\` environment (or at the repo level). Refusing to report a green" \ | ||
| "production e2e run with no tests executed." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Install Rye | ||
| run: | | ||
| curl -sSf https://rye.astral.sh/get | bash | ||
| echo "$HOME/.rye/shims" >> "$GITHUB_PATH" | ||
| env: | ||
| RYE_VERSION: '0.44.0' | ||
| RYE_INSTALL_OPTION: '--yes' | ||
|
|
||
| - name: Install dependencies | ||
| run: rye sync --all-features | ||
|
|
||
| - name: V1 e2e vs production | ||
| env: | ||
| LANDINGAI_ADE_PRODUCTION_APIKEY: ${{ secrets.LANDINGAI_ADE_PRODUCTION_APIKEY }} | ||
| # `-m production` overrides the `-m 'not contract and not production'` default in | ||
| # pyproject.toml. -n 0 forces serial execution: these hit the live API, and the | ||
| # repo's default `-n auto` (xdist) would run them in parallel, inviting flakiness | ||
| # and rate-limits — and would re-parse the sample document once per worker. | ||
| run: rye run pytest tests/contract -m production -n 0 -v | ||
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.
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.
Uh oh!
There was an error while loading. Please reload this page.