Skip to content

feat: live production integration suite gates the release (macOS + Windows) - #176

Merged
yuanwen-tian merged 5 commits into
mainfrom
claude/github-ci-test-integration-c06bf1
Aug 6, 2026
Merged

feat: live production integration suite gates the release (macOS + Windows)#176
yuanwen-tian merged 5 commits into
mainfrom
claude/github-ci-test-integration-c06bf1

Conversation

@yuanwen-tian

@yuanwen-tian yuanwen-tian commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes #175.

What

A live integration suite that drives the real CLI against production, run on macOS and Windows, that the release pipeline must pass before anything is tagged or published — and that can also be triggered manually.

tests/integration/test_production.py

Unlike the offline suite (in-process runner, faked transport), these 8 tests run the CLI as real subprocesses out of a temp ADE_HOME, with every ambient ADE_* variable stripped:

  • authlogin --api-key - via piped stdin (the headless path that broke on Windows in v1.0.2), verified-before-stored (ADR-0007); auth status; an invalid key must come back as the canonical 401 error with nothing stored; logout clears the credential.
  • parse — completes against production; markdown artifact contains the fixture's invoice number; a re-run dedups to the same job item and the same run_id (nothing resubmitted).
  • local verbsfind locates the invoice line with a sane normalized box; crop --all writes real PNGs.
  • extract — pulls invoice_number verbatim, referencing the parse job item.

Assertions are exact, not model-lenient: the checked-in fixture is a hand-assembled 714-byte one-page PDF with fixed text, verified renderable by pypdfium2 (the same renderer crop uses).

The suite skips itself entirely unless ADE_INTEGRATION_API_KEY is set, so plain pytest stays hermetic and free.

.github/workflows/integration.yml

Matrix over macos-latest + windows-latest. CI at a glance, after this PR:

Trigger Workflow What runs Bills?
PR opened/updated ci.yml (unchanged) lint, typecheck, 698 offline tests no
Push to main (e.g. PR merged) integration.yml live production suite, macOS + Windows ~2.2 credits
Release (tag push or dispatch) release.ymlintegration.yml same suite as the release gate, then unit tests → build → publish ~2.2 credits
Manual (Actions → Integration → "Run workflow") integration.yml on-demand live check (e.g. verify the key) ~2.2 credits

Deliberately never on pull_request: every run bills real parse + extract credits (one of each per OS), and fork PRs must not reach the secret. No double-run within a release: a dispatch release isn't a push to main, and a tag push isn't a branch push, so only the workflow_call gate fires.

A preflight step fails the job loudly if the ADE_INTEGRATION_API_KEY secret is empty or unset (a missing secret would otherwise skip every test and report a false green). Authenticates with the ADE_INTEGRATION_API_KEY repo secret — the same name as the env var the tests gate on.

release.yml

check now needs: integration. The gate sits ahead of check deliberately: under manual dispatch check pushes the release tag, so a failed integration run must leave no tag behind (otherwise a re-dispatch would hit "tag already exists").

Guard rails

Three new string-level contract tests in tests/test_release_pipeline.py keep this from drifting: the release workflow gates on integration ahead of check; the integration workflow covers both OSes, runs on pushes to main, stays dispatchable, and never triggers on pull_request; every file in tests/integration/ hangs off the env-var skip gate. Contributor docs added to CONTRIBUTING.md.

Verification

  • Offline: 698 passed, 8 skipped (exactly the integration tests); ruff and ty clean.
  • Live: 8/8 passed against production from macOS (~33s). Windows gets exercised in CI — the suite deliberately covers the piped-stdin login path that regressed there before.
  • Live verification also surfaced a real contract drift (help says credits is "0 on a cached hit"; the payload actually echoes the original run's bill) — left out of scope here, tracked separately.

Note for reviewers

The ADE_INTEGRATION_API_KEY repo secret must be created (Settings → Secrets and variables → Actions, or gh secret set ADE_INTEGRATION_API_KEY) with a valid production ADE key before the first run. Prefer a dedicated low-quota integration account's key.

🤖 Generated with Claude Code

…ndows)

Closes #175. tests/integration/ drives the CLI as real subprocesses
against production — piped-stdin API-key login, invalid-key rejection,
parse, cached re-run dedup, find, crop, extract, logout — over a
checked-in 714-byte fixture PDF with fixed text, so assertions are
exact. The suite skips itself unless ADE_INTEGRATION_API_KEY is set,
keeping plain pytest hermetic and free.

integration.yml runs it on macos-latest and windows-latest, manually
(workflow_dispatch) or as the release gate (workflow_call, secret
VISION_AGENT_API_KEY); never on push/PR — every run bills real parse +
extract credits. release.yml's check job now needs it, placed ahead of
check on purpose: under manual dispatch check pushes the release tag,
and a failed gate must leave no tag behind.

Contract-tested in tests/test_release_pipeline.py; contributor docs in
CONTRIBUTING.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a production integration gate for releases, covering real CLI workflows on macOS and Windows.

Changes:

  • Adds eight live production integration tests and a deterministic PDF fixture.
  • Adds reusable/manual integration workflow and release dependency.
  • Documents usage and adds workflow contract tests.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/integration.yml Runs the live suite across macOS and Windows.
.github/workflows/release.yml Gates release checks on integration.
tests/integration/test_production.py Tests production auth, parse, find, crop, and extract.
tests/integration/fixtures/invoice.pdf Provides deterministic integration input.
tests/test_release_pipeline.py Adds release and integration workflow guards.
CONTRIBUTING.md Documents integration testing and release gating.

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

Comment thread .github/workflows/integration.yml
yuanwen-tian and others added 2 commits August 6, 2026 12:05
…KEY secret

One name end to end: the repo secret, the workflow_call contract, and
the env var the tests gate on are all ADE_INTEGRATION_API_KEY (was
going to reuse the VISION_AGENT_API_KEY secret of unknown freshness; a
dedicated secret is clearer to audit and rotate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…empty

Copilot review catch: workflow_call enforces the secret via required:
true, but a direct workflow_dispatch does not — a missing secret
expands to "", every test skips itself, and the manual run reports
green without touching production. A preflight step now fails the job
on an empty ADE_INTEGRATION_API_KEY, contract-tested in
tests/test_release_pipeline.py.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
yuanwen-tian and others added 2 commits August 6, 2026 12:33
A merged PR that breaks production integration now surfaces
immediately instead of at the next release. pull_request stays
excluded — every run bills real parse + extract credits, and fork PRs
must never reach the secret; PR CI (ci.yml) keeps running the offline
suite only. The contract test now pins push to [main] and rejects any
pull_request trigger key (prose mentions allowed, pull_request_target
included).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two clean check rows ("Integration / macOS", "Integration / Windows")
instead of "integration (macos, macos-latest)"; fail-fast was already
off, so the two platforms were independent results all along.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yuanwen-tian
yuanwen-tian merged commit 0a05efa into main Aug 6, 2026
1 check passed
@yuanwen-tian
yuanwen-tian deleted the claude/github-ci-test-integration-c06bf1 branch August 6, 2026 04:45
yuanwen-tian added a commit that referenced this pull request Aug 6, 2026
Bumps `pyproject.toml` and `uv.lock` to 1.0.4 (minimal two-line diff;
the lockfile edit is validated by `uv sync --locked`, full suite green,
`ade version` reports 1.0.4).

## ⚠️ Merge order

**Merge #177 first, then this PR** — v1.0.4 is intended to include:

- #177 — fix: auto-download URL-sourced documents on view/crop with
notice and progress
- #176 — feat: live production integration suite gates the release
(already on main)

Once both are in, cut the release via **Actions → Release → "Run
workflow"** on `main`. The pipeline will run the live integration suite
(macOS + Windows, against production) before tagging `v1.0.4` — first
exercised green on run
[31072130505](https://github.com/landing-ai/ade-cli/actions/runs/31072130505).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

intergration test

3 participants