Skip to content

CI: test against production SDKs, enforce version bumps, fix test tooling (#4) - #27

Merged
MTG-Thomas merged 3 commits into
mtgfrom
ci/gitops-checks
Nov 16, 2026
Merged

MTG-Thomas merged 3 commits into
mtgfrom
ci/gitops-checks

Conversation

@MTG-Thomas

@MTG-Thomas MTG-Thomas commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What

CI (.github/workflows/ci.yml), on PRs into main/mtg and pushes to mtg:

Job Does
python-tests Python 3.13, requirements.txt + pytest pytest-asyncio pydantic pyyaml packaging + the instance's bifrost Python SDK ($BIFROST_URL/api/cli/download/bifrost-cli.tar.gz), then pytest tests and the version-policy unit tests
app-tests Node 24, npm ci, installs the instance's web SDK (bifrost@$BIFROST_URL/api/sdk/download, --no-save), checks that package.json/package-lock.json are unchanged, then npm test and npm run build
version-policy PRs into mtg only. If the PR changes deployable paths, the head bifrost.solution.yaml version must be greater than the base version (PEP 440). A failure lists the deployable files and suggests the next +mtg.N version
  • Non-deployable paths: docs/**, **/*.md, tests/**, .github/**, apps/*/src/**/*.test.*, apps/*/scripts/**. Everything else counts as deployable.
  • The policy lives in .github/scripts/version_policy.py, with unit tests in .github/scripts/test_version_policy.py. The tests cover path classification, +mtg.N suggestions, 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.
  • Both SDKs are public downloads from vars.BIFROST_URL, which defaults to the production instance. No secrets are used. The token is contents: 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.py now checks properties instead of exact versions:
    • The descriptor version parses as PEP 440, so 0.1.3+mtg.N works.
    • No bifrost dependency appears in any package.json or lockfile-root section, there is no node_modules/bifrost lock entry, and no /api/sdk/download URL appears.
    • Vitest is a dev dependency, and its range matches between package.json and the lockfile. It is no longer pinned to ^4.1.11.
    • Every other guard is unchanged.
  • The README's "Development" section has check commands that work on a clean machine. They install 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 to mtg without a version bump never reaches installs. This PR enforces the bump. The old portability test pinned 0.1.3 and ^4.1.11, which blocks the +mtg.N scheme and already fails on mtg since 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 against mtg prints "No deployable paths changed".

Notes

  • fix/test-tooling is based on 1cfdfa3, the current gobifrost/docs tip and the merge base of main and mtg. It does not contain the main-only npm audit commit (fix(docs): clear the npm audit findings in bifrost-docs #26), so merging it here does not bring main's package.json/lockfile changes into mtg. It can be proposed upstream on its own.
  • The web SDK install differs from the CLI on purpose. bifrost solution sdk update runs npm install --force --no-save --package-lock=false bifrost@<url>/api/sdk/download. Locally, after npm ci, that re-resolved the tree without the lockfile and changed about 150 packages. CI and the README use npm install --no-save instead. It adds exactly one package (bifrost), leaves the rest of the tree as locked, and still records nothing in package.json or the lockfile.
  • HEAD /api/sdk/download returns 404 and GET returns 200 with the tarball. npm uses GET, so the install works.
  • The policy would currently fail PR Port Skra expiration tracking and IT Glue sign-in redirect fix from personal fork #1, as expected: .bifrost/workflows.yaml is deployable and its suggested version is 0.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 (python:3.13-slim, README recipe against production SDKs): tests 342 passed. .github/scripts 38 passed.
  • App (Node 24.21 / npm 11.19): npm ci installed 388 packages and the SDK install added 1 (bifrost SDK 2.0.1); package.json and the lockfile were unchanged. 40 test files / 308 tests passed, and npm run build succeeded.
  • version_policy.py --base mtg --head HEAD: exit 0 (no deployable paths).
  • actionlint: clean.
  • ggshield secret scan commit-range: no secrets in mtg..ci/gitops-checks or in main..fix/test-tooling.

Refs #3, Closes #4

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

MTG-Thomas and others added 3 commits November 16, 2026 12:55
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>
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3054b8b3-f711-4749-9646-30e1ccfa332d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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