Repository navigation
ci: publish stackone-ai using PyPI trusted publishing #244
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
Open
glebedel
wants to merge
5
commits into
main
Choose a base branch
from
ci/pypi-trusted-publishing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
47ab071
ci: publish stackone-ai using PyPI trusted publishing
glebedel 10ea6ef
Merge branch 'main' into ci/pypi-trusted-publishing
s2d2-s1 5f6c060
Preserve release-source verification with the updated uv action
glebedel b269be1
Isolate the shared account-listing test from unrelated HTTP clients
glebedel 78a9aac
Reuse the accounts listing when a sibling already resolved a refusal
glebedel 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,44 @@ | ||
| # Publishing stackone-ai | ||
|
|
||
| Release Please prepares the version and changelog in a release pull request. | ||
| Merging that release PR into `main` creates the GitHub release, tests and builds | ||
| its exact commit, then publishes the tested wheel and source archive to PyPI. | ||
| Normal development PRs do not publish. Changes to the release workflow run the | ||
| same build checks on the PR without access to publishing credentials. | ||
|
|
||
| ## Configure PyPI before merging the publishing migration | ||
|
|
||
| A PyPI project owner must open **Manage → Publishing → Add a new publisher → GitHub** | ||
| for `stackone-ai` and register these values: | ||
|
|
||
| | Field | Value | | ||
| | --- | --- | | ||
| | Owner | `StackOneHQ` | | ||
| | Repository | `stackone-ai-python` | | ||
| | Workflow filename | `release.yaml` | | ||
| | Environment | `pypi` | | ||
|
|
||
| Use the filename alone, without `.github/workflows/`. Keep the environment set to | ||
| `pypi`, even though PyPI labels that field optional. | ||
|
|
||
| In GitHub repository settings, the `pypi` environment must allow deployment from | ||
| the **main branch only**, with no tag rules. This prevents an unreviewed branch | ||
| from replacing the publishing workflow and using the project's PyPI identity. | ||
| Keep any existing reviewer requirements. | ||
|
|
||
| Publishing uses GitHub's short-lived identity, called **Trusted Publishing** by | ||
| PyPI. No new PyPI API token or GitHub secret is needed. The upload job has no | ||
| source checkout and installs no package dependencies. Only that job can request | ||
| the identity needed to upload, and it downloads artifacts from its own workflow run. | ||
|
|
||
| ## Release and verification | ||
|
|
||
| Review and merge the release PR, then check the **Release Please** workflow. | ||
| The source commit must be on `main`, and its package version must match the | ||
| GitHub release. A failed test or build prevents uploading. Confirm both files | ||
| appear on PyPI after the publish job succeeds. | ||
|
|
||
| Do not merge this migration until the PyPI publisher is configured. Keep the | ||
| existing token until the first successful publish through Trusted Publishing. | ||
| Then remove the unused `PYPI_API_TOKEN` secret and revoke its PyPI token after | ||
| checking that no other workflow uses it. |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 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
/accountsrequest 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
More info - Reply on this comment to give feedback or ignore the issue.