Skip to content

test: gate the CEF release tags against their provenance manifests (#2674) - #21

Merged
zackees merged 1 commit into
mainfrom
test/cef-release-provenance
Oct 28, 2026
Merged

zackees merged 1 commit into
mainfrom
test/cef-release-provenance

Conversation

@zackees

@zackees zackees commented Oct 28, 2026

Copy link
Copy Markdown
Member

Criterion 5 of obs-rust/obs-studio#2674: the drift gate that keeps the CEF release
provenance from rotting again.

obs-rust/cef now ships releases/<tag>.json per release and retargets each release tag
onto the commit that adds its own file (obs-rust/cef#2). Nothing enforced that, and the
failure it fixes was silent for weeks: all three tags pointed at one unrelated docs commit.

The gate

tests/test_cef_release_provenance.py, for every published release:

  1. resolve the tag to its target commit through the git-refs API;
  2. fetch releases/<tag>.json at that commit (not from the default branch — a tag
    pointing elsewhere has no manifest there, which is the exact pre-#2674 state);
  3. assert the manifest's tag is that release, its asset list is exactly the release's
    asset list, every sha256 is a well-formed hex digest equal to the digest GitHub
    computes for the published asset, and patch_commit is recorded (a sha or explicit
    null).

It skips, rather than fails, when GitHub is unreachable: it is a provenance gate, not a
test of local code. No token needed (public data).

Evidence

  • RED on the pre-move tag commit de09a29b1: all three tags have no
    releases/<tag>.json (404) — the test fails with "release tags do not carry their own
    provenance manifest".
  • GREEN now: 7871, 8078, 8078-r2 each resolve to a commit serving its own
    manifest, and the digests match 11 of 11 assets.
  • uv run --group dev pytest -q → 25 passed; ruff check . and ruff format --check . clean.

Note on model.py

The repository's tests/test_no_dict_access.py forbids JSON handling outside
obs_studio_libs/model.py, so the GitHub release/ref documents and the CEF manifest are
parsed into frozen dataclasses there (CefReleaseManifest, CefReleaseAsset,
GithubRelease, GithubReleaseAsset, parse_git_ref_target) instead of in the test. The
CEF manifest carries free-text fields by design, so it is read leniently; the manifest.json
parsers are untouched.

Refs obs-rust/obs-studio#2674

…2674)

Every obs-rust/cef release now ships releases/<tag>.json and each tag points at the
commit that adds its own file. This adds the drift gate: for each published release, read
the tag's target commit, fetch the manifest at that commit, and assert it describes that
release and matches every published asset digest.

RED: against the pre-move tag commit (de09a29b1) all three tags have no manifest (404);
GREEN: each tag's current commit serves its own manifest, and the whole 25-test suite
passes offline except this one, which skips when GitHub is unreachable.

The GitHub documents are read in obs_studio_libs/model.py, the repo's single JSON
boundary, so tests/test_no_dict_access.py still passes.

Refs obs-rust/obs-studio#2674

@zackees zackees left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review — verified locally, merging.

  • Ran the branch in a clean worktree: uv run --group dev pytest -q → 25 passed (including tests/test_cef_release_provenance.py, 2 network cases), ruff check . and ruff format --check . clean.
  • The gate is meaningful rather than tautological: it resolves the tag through the git-refs API and fetches releases/<tag>.json at that commit, so the pre-#2674 state (all three tags on one docs commit) fails with a 404 instead of silently passing off the default branch — and it skips, not fails, when GitHub is unreachable, which is right for a provenance gate with no local-code surface.
  • tests/test_no_dict_access.py is respected the right way: the GitHub release/ref documents and the CEF manifest are parsed into frozen dataclasses in obs_studio_libs/model.py rather than subscripted in the test; the manifest.json parsers are untouched.
  • Cross-checked against the sibling PR obs-rust/cef#2: all 10 asset digests match the manifests the tags now point at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant