feat(ci): add Test PyPI release workflow for splunk-ao-a2a#57
feat(ci): add Test PyPI release workflow for splunk-ao-a2a#57adityamehra wants to merge 3 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Reject bump keywords (patch, major, etc.) and malformed inputs with a clear error before any file is modified, matching the pattern added to the splunk-ao and splunk-ao-adk release workflows Co-authored-by: Cursor <cursoragent@cursor.com>
|
Applied the same changesets from PR #48 to this workflow: Version input validation — Added a |
- Fix regex to correctly accept rc, .dev, and .post PEP 440 forms - Add permissions: contents: read to the test and build jobs Co-authored-by: Cursor <cursoragent@cursor.com>
fercor-cisco
left a comment
There was a problem hiding this comment.
🤖 This review was generated by the Astra agent (claude-opus-4-8). It may contain mistakes.
Verdict: request_changes — The unscoped pull_request trigger publishes a Test PyPI dev release on every PR across the whole monorepo, and the OIDC publish job will fail on all fork PRs.
Follow-ups
Suggested follow-up work that could be tracked as Shortcut stories:
.github/workflows/release-splunk-ao-a2a-test.yaml:13-43: Thetestjob duplicates the type-check + pytest steps already run byci-tests-splunk-ao-a2a.yamlon the samepull_requestevent (single Python 3.11 vs. the CI matrix). Consider gating the release workflow's test job to run only onworkflow_dispatch, or reuse the CI workflow viaworkflow_call, to avoid running the same tests twice on every PR.
| name: Release splunk-ao-a2a to Test PyPI | ||
|
|
||
| on: | ||
| pull_request: # Publishes a .dev pre-release on every PR push |
There was a problem hiding this comment.
🟠 major (design): The pull_request trigger has no paths filter, so this workflow runs — and publishes a new 0.1.0.dev<run_number> to Test PyPI — on every PR to the repo, including PRs that touch only splunk-ao-adk/, the repo root, docs, or other CI files. That both burns Test PyPI version numbers on unrelated changes and duplicates the test run already performed by ci-tests-splunk-ao-a2a.yaml. The sibling CI workflow scopes itself with paths: ['splunk-ao-a2a/**', ...]; this one should do the same so a dev release is only cut when the package actually changes.
| pull_request: # Publishes a .dev pre-release on every PR push | |
| pull_request: # Publishes a .dev pre-release on every PR push | |
| paths: | |
| - 'splunk-ao-a2a/**' | |
| - '.github/workflows/release-splunk-ao-a2a-test.yaml' |
🤖 Generated by Astra
| publish: | ||
| name: Publish to Test PyPI | ||
| needs: build # Only publish if build succeeds (which requires tests passing) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write # Required for OIDC trusted publishing | ||
| environment: | ||
| name: testpypi | ||
| url: https://test.pypi.org/project/splunk-ao-a2a/ |
There was a problem hiding this comment.
🟠 major (design): Because this runs on pull_request (not pull_request_target), PRs opened from forks run with a read-only GITHUB_TOKEN and are not granted id-token: write — GitHub downgrades OIDC permissions for fork PRs. The publish job will therefore fail for every external-contributor PR (the repo already has 2 forks), producing a persistent red check on those PRs. Consider gating the publish job so it is skipped for fork PRs, e.g. if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository, so fork PRs still run test/build but don't attempt (and fail) the publish. This also avoids attempting a trusted-publish on untrusted code.
🤖 Generated by Astra
| on: | ||
| pull_request: # Publishes a .dev pre-release on every PR push | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to publish (e.g., 0.1.0, 1.2.3rc1, 1.2.3.post1). Must be an explicit version. Leave empty to use the version in pyproject.toml as-is.' | ||
| required: false | ||
| type: string | ||
|
|
There was a problem hiding this comment.
🟡 minor (design): Unlike every sibling workflow (ci-tests.yaml, ci-tests-splunk-ao-a2a.yaml), this one has no concurrency group. Pushing several commits to a PR in quick succession will launch overlapping runs that each publish a distinct .dev<run_number> to Test PyPI. Add a concurrency group with cancel-in-progress: true to match the existing pattern and avoid redundant publishes.
| on: | |
| pull_request: # Publishes a .dev pre-release on every PR push | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (e.g., 0.1.0, 1.2.3rc1, 1.2.3.post1). Must be an explicit version. Leave empty to use the version in pyproject.toml as-is.' | |
| required: false | |
| type: string | |
| on: | |
| pull_request: # Publishes a .dev pre-release on every PR push | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to publish (e.g., 0.1.0, 1.2.3rc1, 1.2.3.post1). Must be an explicit version. Leave empty to use the version in pyproject.toml as-is.' | |
| required: false | |
| type: string | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true |
🤖 Generated by Astra
Summary
Adds
.github/workflows/release-splunk-ao-a2a-test.yaml— a pipeline that builds and publishes thesplunk-ao-a2apackage to Test PyPI.How it works
0.1.0.dev<run_number>to Test PyPI (clean version stays reserved)workflow_dispatchwith version: runs tests → publishes the exact version suppliedworkflow_dispatchwithout version: runs tests → publishes whatever is inpyproject.tomlJob chain
test→build→publish(each step gates the next)Notes
ci-tests-splunk-ao-a2a.yamlpattern)release-splunk-ao-a2a-test.yaml, environment:testpypi)python -m build(hatchling backend)Made with Cursor