Skip to content

ci: run Python SDK and sample regression tests - #325

Draft
arjun2075 wants to merge 2 commits into
google-agentic-commerce:mainfrom
arjun2075:ci/python-tests
Draft

ci: run Python SDK and sample regression tests#325
arjun2075 wants to merge 2 commits into
google-agentic-commerce:mainfrom
arjun2075:ci/python-tests

Conversation

@arjun2075

Copy link
Copy Markdown

Description

The Python SDK tests (code/sdk/python/ap2/tests/) and the sample regression tests
(code/samples/python/tests/) are not currently executed by any GitHub Actions
workflow, so regressions in either suite are only caught when a contributor runs
pytest locally.

This PR adds a single Python 3.12 CI job that syncs the AP2 uv workspace once and
then runs both suites.

What this changes

  • adds .github/workflows/python-tests.yml — one job, on pushes to main and pull
    requests targeting main
  • syncs once with uv sync --all-packages, then runs both suites with
    uv run --no-sync so they reuse that environment instead of re-resolving per step

What this deliberately does not change

  • no SDK, sample, or protocol behavior
  • no dependency-locking policy change. AP2 currently has no committed uv.lock
    (removed in fix: remove uvlock #246), so the workflow resolves the workspace at run time, matching the
    repository's current setup. This PR does not reintroduce a lockfile.
  • no paths: filter initially, so the check behaves predictably on every PR rather
    than depending on workflow-level path skipping. Straightforward to narrow if
    maintainers prefer lower CI usage.
  • no Python version matrix. The project supports 3.11+; 3.12 keeps this first version
    small, and a minimum-supported-version matrix is a reasonable follow-up.

Workflow hardening

Third-party actions are pinned to immutable commit SHAs, persist-credentials: false
is set on checkout, workflow permissions are contents: read, and the job is bounded
with timeout-minutes: 15. These are defensive choices rather than an existing
repository-wide requirement.

Current status — draft

This is opened as a draft because the checks are expected to be red on the current
main baseline:

Local run on Python 3.12 against this branch: SDK suite 186 passed / 2 failed (the two
above), sample suite 0 collected. This PR intentionally does not modify kb_sd_jwt,
the failing tests, or #310 — it only adds the workflow. Once #310 and #313 land, this
branch will be rebased so the check can be evaluated against a green baseline.

The sample-test coverage motivation came out of the discussion on #310, which notes
that no CI job currently runs the sample pytest suite. This PR does not fix #310.

@google-cla

google-cla Bot commented Aug 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@giorgioroth

Copy link
Copy Markdown

Nice work, @arjun2075, clean scope, clean sequencing, and good call documenting the expected red baseline instead of mixing fixes into the CI PR.
I especially like that the workflow is being added as an observation mechanism, not allowed to redefine behavior just because it exposes existing failures. That keeps infrastructure, contract, and repair as three separate concerns. 👏

@arjun2075

Copy link
Copy Markdown
Author

Thanks — really appreciate the review.

That separation was intentional: I wanted the CI change to make the existing contract visible without bundling in behavioral fixes just to get a green baseline.

Once #310 and #313 land, I’ll rebase onto main, rerun both Python suites, and update the draft with the resulting green baseline before marking it ready for review.

SashaMIT added a commit to SashaMIT/AP2 that referenced this pull request Aug 10, 2026
verify() only called verify_expected_claims under if typ in TYP_TERMINAL,
so on an intermediate hop (typ kb+sd-jwt+kb) a caller that passes
expected_aud or expected_nonce got no check at all. That is why
test_verify_rejects_aud_mismatch and test_verify_rejects_nonce_mismatch
fail on main.

Move the check out of the terminal guard so it runs on every hop. Matches
the verify() docstring (expected match is a general check) and create()
(which already requires aud and nonce on every hop).

Mandatory presence of expected_aud/expected_nonce when a terminal hop
carries those claims is intentionally deferred to a follow-up so this
change can land as a clean green baseline for google-agentic-commerce#325.

Signed-off-by: SashaMIT <sash.t.mitchell@gmail.com>
@arjun2075
arjun2075 marked this pull request as ready for review August 11, 2026 00:49
@arjun2075
arjun2075 requested a review from a team as a code owner August 11, 2026 00:49
SashaMIT added a commit to SashaMIT/AP2 that referenced this pull request Aug 11, 2026
The repo-wide BIOME_LINT job fails on pre-existing code/web-client/**
errors unrelated to this PR (same red on google-agentic-commerce#313/google-agentic-commerce#325). Add a root
biome.json that scopes Biome off the web-client, per chopmob-cloud's
note; took Lint Code Base green on google-agentic-commerce#279.

Co-authored-by: Cursor <cursoragent@cursor.com>
SashaMIT added a commit to SashaMIT/AP2 that referenced this pull request Aug 11, 2026
The repo-wide BIOME_LINT job fails on pre-existing code/web-client/** errors unrelated to this PR (same red on google-agentic-commerce#313/google-agentic-commerce#325). Add a root biome.json that scopes Biome off the web-client, per chopmob-cloud' note; took Lint Code Base green on google-agentic-commerce#279.
@arjun2075
arjun2075 marked this pull request as draft August 14, 2026 02:06
@arjun2075

Copy link
Copy Markdown
Author

Status note: #325 is unchanged and still intentionally CI-only. The current red Python baseline is expected pending #313 , and the sample suite becomes available via #310 . Once those land I'll rebase onto main, rerun the combined job, and update this PR with the green baseline. No action needed from the follow-up PRs referencing #325 — they'll be picked up automatically once this CI job lands.

@giorgioroth

Copy link
Copy Markdown

One thing the baseline note doesn't cover: Lint Code Base is the #306 condition, not a consequence of #313 or #310. It fails on main too. #310 disables VALIDATE_BIOME_LINT in the workflow; #313 and #326 carry a root biome.json scoping Biome off code/web-client and docs/assets/**/*.svg. Whichever lands first will clear it for you on rebase - worth knowing which, so the second run isn't confusing either.

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.

2 participants