Repository navigation
CI: test against production SDKs, enforce version bumps, fix test tooling (#4) - #27
Merged
Merged
Conversation
The portability test asserted exact versions (`version == "0.1.3"`, `vitest == "^4.1.11"`), so every dependency bump or downstream version label broke it. It now checks the properties it exists to protect: - the descriptor version is a valid PEP 440 version (local labels such as `0.1.3+site.1` are allowed; the platform compares with `packaging`); - no `bifrost` SDK dependency or `/api/sdk/download` URL in package.json or the lockfile, and no `node_modules/bifrost` lock entry; - Vitest is a dev dependency whose range agrees between package.json and the lockfile root, without pinning a version. The README's check commands failed on a clean machine: the Python command skipped requirements.txt and the `bifrost` Python SDK, and the app tests needed an authenticated `solution sdk update`. Both SDKs are served by any Bifrost instance without authentication, so the README now installs them from `$BIFROST_URL` directly. The web SDK goes into node_modules with `npm install --no-save`, so it is never recorded in package.json or the lockfile while the lockfile still pins the rest of the tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds .github/workflows/ci.yml for pull requests into main and mtg and for pushes to mtg: - python-tests: requirements.txt plus test tooling and the instance's `bifrost` Python SDK (the public CLI sdist), then the Solution tests and the version-policy unit tests. - app-tests: `npm ci`, the instance's web SDK installed with `--no-save` so it never reaches package.json or the lockfile (asserted), `npm test`, and `npm run build`. - version-policy (PRs into mtg only): when a PR changes deployable paths, the head `bifrost.solution.yaml` version must be greater than the base version (PEP 440). The failure names the next `+mtg.N` version. Both SDKs come from `vars.BIFROST_URL` (default the production instance) without credentials. Actions are pinned to commit SHAs, the token is read-only, and superseded PR runs are cancelled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
CI (
.github/workflows/ci.yml), on PRs intomain/mtgand pushes tomtg:python-testsrequirements.txt+pytest pytest-asyncio pydantic pyyaml packaging+ the instance'sbifrostPython SDK ($BIFROST_URL/api/cli/download/bifrost-cli.tar.gz), thenpytest testsand the version-policy unit testsapp-testsnpm ci, installs the instance's web SDK (bifrost@$BIFROST_URL/api/sdk/download,--no-save), checks thatpackage.json/package-lock.jsonare unchanged, thennpm testandnpm run buildversion-policymtgonly. If the PR changes deployable paths, the headbifrost.solution.yamlversion must be greater than the base version (PEP 440). A failure lists the deployable files and suggests the next+mtg.Nversiondocs/**,**/*.md,tests/**,.github/**,apps/*/src/**/*.test.*,apps/*/scripts/**. Everything else counts as deployable..github/scripts/version_policy.py, with unit tests in.github/scripts/test_version_policy.py. The tests cover path classification,+mtg.Nsuggestions, PEP 440 ordering, and end-to-end runs in a temporary git repo, including a base that has moved on since the branch was cut.vars.BIFROST_URL, which defaults to the production instance. No secrets are used. The token iscontents: read, checkout does not persist credentials, every action is pinned to a commit SHA (checkout v7.0.1, setup-python v7.1.0, setup-node v7.1.0), and superseded PR runs are cancelled.Test tooling (merged in from
fix/test-tooling):tests/test_publication_portability.pynow checks properties instead of exact versions:0.1.3+mtg.Nworks.bifrostdependency appears in anypackage.jsonor lockfile-root section, there is nonode_modules/bifrostlock entry, and no/api/sdk/downloadURL appears.package.jsonand the lockfile. It is no longer pinned to^4.1.11.requirements.txt, the test tooling, and both SDKs from$BIFROST_URL.Why
#3 decided on GitOps releases. Bifrost only offers an update when
version:on the followed branch increases, so a deployable merge tomtgwithout a version bump never reaches installs. This PR enforces the bump. The old portability test pinned0.1.3and^4.1.11, which blocks the+mtg.Nscheme and already fails onmtgsince the Vitest 4.1.12 bump. #4 has the details.This PR only changes CI, tests, and docs, so it is non-deployable under its own policy and leaves the descriptor at
0.1.3. A local policy run againstmtgprints "No deployable paths changed".Notes
fix/test-toolingis based on1cfdfa3, the currentgobifrost/docstip and the merge base ofmainandmtg. It does not contain themain-only npm audit commit (fix(docs): clear the npm audit findings in bifrost-docs #26), so merging it here does not bringmain'spackage.json/lockfile changes intomtg. It can be proposed upstream on its own.bifrost solution sdk updaterunsnpm install --force --no-save --package-lock=false bifrost@<url>/api/sdk/download. Locally, afternpm ci, that re-resolved the tree without the lockfile and changed about 150 packages. CI and the README usenpm install --no-saveinstead. It adds exactly one package (bifrost), leaves the rest of the tree as locked, and still records nothing inpackage.jsonor the lockfile.HEAD /api/sdk/downloadreturns 404 andGETreturns 200 with the tarball. npm usesGET, so the install works..bifrost/workflows.yamlis deployable and its suggested version is0.1.3+mtg.1, which matches the plan in Deploy the Skra ports (PR #1) together with the workflow authorization fix #3.Local verification
python:3.13-slim, README recipe against production SDKs):tests342 passed..github/scripts38 passed.npm ciinstalled 388 packages and the SDK install added 1 (bifrost SDK 2.0.1);package.jsonand the lockfile were unchanged. 40 test files / 308 tests passed, andnpm run buildsucceeded.version_policy.py --base mtg --head HEAD: exit 0 (no deployable paths).actionlint: clean.ggshield secret scan commit-range: no secrets inmtg..ci/gitops-checksor inmain..fix/test-tooling.Refs #3, Closes #4
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.