Repository navigation
Conversation
glebedel
left a comment
There was a problem hiding this comment.
Reviewed at 47ab071. No blocking issues in the workflow. The one thing that must happen before merge is the PyPI side: a stackone-ai owner has to add the trusted publisher in the table above. The GitHub side cannot confirm it, and a release merged without it fails at the upload step.
Checked
| Check | Result |
|---|---|
actionlint on release.yaml |
clean |
| Action pins | upload-artifact v7.0.2 and download-artifact v8.0.2 SHAs match their tags |
| release-please outputs | single root package ., so the unprefixed sha and version outputs the build job reads exist |
pypi environment |
deployment allowed from main only, no tag rules |
| PR build run | wheel and sdist both built, installed in isolation and reported 3.0.0 |
| Drift | 6 commits behind main, none touch .github/ or CLAUDE.md |
| Security pass (Codex, security only) | no findings. Only publish gets id-token: write, its implicit success() keeps it behind build, PR runs (fork or same repo) cannot reach the main-only environment, the source check uses the full refs/remotes/origin/main ref, caches are off and release metadata reaches the shell through env |
| CI after marking ready | all checks pass, Aikido included; publish and release-please skipped as expected |
Non-blocking suggestions
.github/RELEASING.mdmixes the evergreen release process with one-time migration steps ("Do not merge this migration until...", "Keep the existing token until the first successful publish"). After merge those lines go stale. They could live in this PR body only, or move to a short "Migrating from the API token" section that is deleted after the first trusted publish.uv publishuploads without PEP 740 attestations.pypa/gh-action-pypi-publishgenerates them by default under trusted publishing. Optional, and fine as a follow-up.- The
pypienvironment has no required reviewer, so merging a release PR publishes straight away. That matchesmaintoday, so this PR does not weaken anything. If you want a human gate on PyPI uploads, it is one setting on the environment.
After the first trusted publish succeeds, remove the PYPI_API_TOKEN secret and revoke the token, as the PR body says.
Requested by guillaume@stackone.com in Slack (repo audit thread).
🤖 Generated with Claude Code
release.yaml conflicted where main bumped action pins (#253). Kept this branch's build and publish jobs and moved every setup-uv to v10.3.3 and pnpm/action-setup to v6.1.1, including the steps this branch adds, so the file matches main's pins. No workflow logic changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Migrates release publishing from a stored PyPI token to OIDC Trusted Publishing, adds a build/verify gate and docs; requires human review of the credential-handling change and external PyPI publisher setup.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Requires human review: Migrates PyPI publishing from a stored token to OIDC Trusted Publishing with a build/verify gate and docs, and also fixes a concurrent end-user lookup race; requires human review of the credential-handling change and external PyPI publisher setup.
View guided diff | Turn on auto-fix | Re-trigger cubic
| def _join_accounts_listing(self, missing_end_user_for: str | None = None) -> None: | ||
| with self._cache_lock: | ||
| fetching = self._fetching_accounts | ||
| sequence = 0 | ||
| if fetching is None: | ||
| if missing_end_user_for is not None and missing_end_user_for in self._end_user_ids: | ||
| return | ||
| self._accounts_sequence += 1 | ||
| sequence = self._accounts_sequence | ||
| fetching = self._fetching_accounts = concurrent.futures.Future() |
There was a problem hiding this comment.
🟡 Medium - Concurrent end-user lookup can reuse a stale mapping indefinitely
When an MCP request snapshots an account as missing its end-user id, a concurrent /accounts request can populate that account with an id before the MCP refusal is handled. If that mapping is stale because the account was relinked or the response lagged the server, the new early return skips the refresh and retries once with the stale id; the request is rejected again and subsequent calls continue using the stale mapping until the caller manually refreshes accounts.
Show fix
| def _join_accounts_listing(self, missing_end_user_for: str | None = None) -> None: | |
| with self._cache_lock: | |
| fetching = self._fetching_accounts | |
| sequence = 0 | |
| if fetching is None: | |
| if missing_end_user_for is not None and missing_end_user_for in self._end_user_ids: | |
| return | |
| self._accounts_sequence += 1 | |
| sequence = self._accounts_sequence | |
| fetching = self._fetching_accounts = concurrent.futures.Future() | |
| def _join_accounts_listing(self, missing_end_user_for: str | None = None) -> None: | |
| with self._cache_lock: | |
| fetching = self._fetching_accounts | |
| sequence = 0 | |
| if fetching is None: | |
| self._accounts_sequence += 1 | |
| sequence = self._accounts_sequence | |
| fetching = self._fetching_accounts = concurrent.futures.Future() |
More info - Reply on this comment to give feedback or ignore the issue.
Publishing currently relies on a stored PyPI API token. This change keeps the existing Release Please flow and uploads tested artifacts using GitHub OIDC through PyPI Trusted Publishing.
The build job checks out the exact release commit, verifies it belongs to main and its package version matches the release, runs the existing test suite, and installs both the wheel and source archive in isolated environments. The separate publish job has no source checkout, downloads only its own run's artifacts, and is the only job with
id-token: write. Workflow PRs exercise the build without publishing.Required setup before merging
The current PyPI account cannot manage stackone-ai (403). A project owner must add the publisher below before this PR is merged.
stackone-aiStackOneHQstackone-ai-pythonrelease.yamlpypiThe GitHub
pypienvironment has already been configured and verified to allow only themainbranch, with no tag rules. No new secret is needed. Keep the existing token until the first successful trusted publish; then remove the unused secret and revoke the token only after checking other uses. Full release instructions are in.github/RELEASING.md.Validation and review
GitHub CI passed, including the new release build, package installation checks, and the Python test matrix. The publish job was skipped as expected on this PR. The Aikido PR check was skipped on the draft; its existing critical/high alerts were inspected separately for this diff. An actual OIDC upload is intentionally deferred until the next release; no package version or application dependencies change here.