Skip to content

fix(ci): run release jobs on hosted runners and gate the PyPI publish (ENG-2000) - #90

Open
lucas-koontz wants to merge 2 commits into
mainfrom
fix/eng-2000-hosted-release-jobs
Open

lucas-koontz wants to merge 2 commits into
mainfrom
fix/eng-2000-hosted-release-jobs

Conversation

@lucas-koontz

@lucas-koontz lucas-koontz commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

User story

As a maintainer who publishes minds-sdk releases
I want the release tests and the PyPI upload to run on GitHub-hosted runners, with the upload waiting for the tests to pass
So that PyPI gets only versions whose integration tests passed, built from a commit that main holds

Why this matters

When a maintainer publishes a minds-sdk release, PyPI gets it whether or not its release tests pass, so users can install a version that failed them. Versions 2.0.0 and 2.0.1 both reached PyPI after their release test runs failed. The 2.0.1 run could not have passed: the workflow sets MINDS_API_KEY and BASE_URL, but tests/integration/config.py reads MINDS_API_TOKEN and MINDS_API_BASE_URL, so pytest exits 4 at import. Both jobs also run on a self-hosted runner, and GitHub recommends GitHub-hosted runners for public repositories. A release tag can also point at a branch commit that never merged, so the publish now checks that main holds the commit it builds.

Test plan

Each line is a test in tests/unit/test_workflows.py unless it says otherwise.

  • The release test job and the publish job run on ubuntu-latest, and no workflow names a self-hosted runner in any letter case.
  • The publish runs only after a successful release run from this repository, and deploy.yml has no other trigger.
  • The publish builds the commit the release tests ran on.
  • Negative: a release commit that main does not hold fails before the upload. The test runs the check against a real git history.
  • The release test step passes MINDS_API_TOKEN and MINDS_API_BASE_URL, and with them pytest tests/integration --collect-only collects 5 tests (run by hand).
  • Negative: a failing release test fails the release run, so nothing publishes.
  • Every action in both release workflows is pinned to a commit, and both checkouts keep the token out of .git/config.
  • Not run yet: a release, which waits on the CLA signature.

Part of ENG-2000. This PR depends on no other change.

The release integration tests and the PyPI publish run on ubuntu-latest
instead of mdb-dev. GitHub recommends GitHub-hosted runners for public
repositories. Both jobs keep the secrets and variables they use today.

deploy_to_pypi publishes only when the triggering run of "Run
Integration Tests on Release" succeeded, came from a release event and
has its head in this repository. It checks out that run's head_sha, so
PyPI gets the commit the tests ran on, not the default branch's head.

The release test step passes MINDS_API_TOKEN and MINDS_API_BASE_URL,
the names tests/integration/config.py reads. With MINDS_API_KEY and
BASE_URL, config.py fails at import and pytest exits 4 before any test
runs, so the new gate could never pass.

Both release workflows pin actions/checkout and actions/setup-python to
commit SHAs with version comments, and their checkouts set
persist-credentials: false. The clean step globs ./*.egg-info, and the
publish step's comment says what it builds.

The workflow_run trigger carries an inline zizmor ignore for
dangerous-triggers. tests/unit/test_workflows.py checks the publish
conditions, the checkout ref and that workflow_run stays the only
trigger. It also checks that no workflow names a self-hosted runner
label, that a failing test fails the release run, the env names, the
pins and persist-credentials. requirements_test.txt gains pyyaml for it.

Part of Lucas Koontz's ticket "Take the public repos off the
credentialed runner group and require devops to release a privileged
run".

Refs: ENG-2000
@lucas-koontz
lucas-koontz requested a review from a team October 4, 2026 05:25
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

1 participant