Skip to content

Make test_sdk_version aware of the RC-preflight ref file - #327

Merged
scouten-adobe merged 1 commit into
mainfrom
fix/preflight-sdk-version-check
Sep 17, 2026
Merged

scouten-adobe merged 1 commit into
mainfrom
fix/preflight-sdk-version-check

Conversation

@scouten-adobe

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #326/#325: test_sdk_version compares the loaded native library's version against c2pa-native-version.txt, but an RC-preflight run (per test-c2pa-rs-source-build.yml) actually builds the native library from whatever ref is in c2pa-rs-preflight-ref.txt instead. That mismatch meant a preflight run always failed this one assertion even when everything else -- including the thing the preflight actually exists to check -- passed cleanly.

parse_native_version() now prefers c2pa-rs-preflight-ref.txt when present, falling back to c2pa-native-version.txt otherwise -- the same precedence the workflow itself uses to decide what to build.

Test plan

  • Local: green against the pinned 0.90.22 with no preflight file present
  • Local: green against a c2pa-rc-v0.91.0-rc.3 build with c2pa-rs-preflight-ref.txt present (all 444 tests pass)
  • CI

🤖 Generated with Claude Code

test_sdk_version compares the loaded native library's version against
c2pa-native-version.txt, but an RC-preflight run (per
test-c2pa-rs-source-build.yml) actually builds from whatever ref is in
c2pa-rs-preflight-ref.txt instead, so the test always failed on that
one assertion during a preflight even when everything else passed.

parse_native_version() now prefers c2pa-rs-preflight-ref.txt when
present, falling back to c2pa-native-version.txt otherwise -- the same
precedence the workflow itself uses to decide what to build. Verified
both paths locally: green against the pinned 0.90.22 with no preflight
file, and green against a c2pa-rc-v0.91.0-rc.3 build with the file
present.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
scouten-adobe added a commit that referenced this pull request Sep 17, 2026
This is the entire diff this PR now carries on top of #327: pin the
preflight workflow at c2pa-rc-v0.91.0-rc.3 so it builds from that git
tag (no crates.io publish, no prebuilt GitHub release binaries for an
RC) and runs the full unit test suite against it.

Verified locally and in CI: all 444 tests pass, including
test_sdk_version now that #327 teaches it to check against this file
during a preflight instead of against the pinned release.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@scouten-adobe
scouten-adobe merged commit f9ea2b2 into main Sep 17, 2026
24 checks passed
@scouten-adobe
scouten-adobe deleted the fix/preflight-sdk-version-check branch September 17, 2026 23:04
scouten-adobe added a commit that referenced this pull request Sep 17, 2026
#328)

#327's parse_native_version() fix preferred c2pa-rs-preflight-ref.txt
whenever it existed in the checked-out tree. That broke the *real*
build.yml jobs on #325: that PR adds the ref file to the branch, so an
ordinary tests-unix/tests-windows run (which downloads and installs
the actual pinned release, unrelated to the preflight workflow) picked
up the file too and wrongly expected the RC's version string, failing
with e.g. "'0.91.0-rc.3' not found in '0.90.22'".

The file's mere presence was never a reliable signal -- only
test-c2pa-rs-source-build.yml's own "Run tests" step actually builds
from that ref. Gate on a new C2PA_PREFLIGHT_RUN env var that only that
step sets instead.

Verified locally: with the pinned 0.90.22 installed and no env var
set, all 444 tests pass regardless of whether
c2pa-rs-preflight-ref.txt happens to exist in the tree.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant