Add reusable c2pa-rs RC-preflight workflow; fix latent test bugs - #326
Merged
Merged
Conversation
Adds .github/workflows/test-c2pa-rs-source-build.yml: a workflow that builds the native FFI library from an arbitrary c2pa-rs git ref (needed when testing a release candidate that has no crates.io publish and no prebuilt GitHub release binaries) instead of downloading a release asset. It's a no-op on ordinary PRs -- it only activates when a PR commits a target ref to c2pa-rs-preflight-ref.txt, at which point it reruns automatically on every push to that PR, same as any other check. Also fixes three latent test bugs found while probing c2pa-rs 0.91.0-rc.1 with this tool, all confirmed to still pass against the currently-pinned release: - Four ingredient tests declared testPath2 (an actual JPEG fixture) as "image/png" when adding it as an ingredient. Harmless while add_ingredient() didn't validate ingredient bytes against the declared MIME type, but still a bug in the test. - Several ingredient-archive tests built manifests with an empty or c2pa.placed-only actions list. Added an explicit leading c2pa.created/c2pa.opened action (or reordered where one already existed) to match what a real C2PA manifest should look like. - test_swapped_builder_is_freed_exactly_once asserted a swapped builder handle's address always differs from the original. That's an implementation detail of the native allocator, not a guarantee; relaxed it to check the invariant that actually matters (freed exactly once). 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 #326: pin the preflight workflow at c2pa-rc-v0.91.0-rc.1 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. CI is expected to show 8 failures per platform, all 'Valid' != 'Trusted' plus one SDK-version string mismatch: 0.91.0-rc.1 moves trust.trust_anchors/trust.trust_config under a new trust.anchors[] array, and the currently-pinned c2pa-native-version.txt release doesn't understand that schema. That's the actual, documented incompatibility this PR exists to surface -- not a bug in the tooling. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks
tmathern
approved these changes
Sep 17, 2026
3 tasks
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.
Summary
Split out of #325 per review feedback, so that PR can shrink down to just the 0.91.0-rc.1-specific validation. This PR contains everything from that work that's useful independent of any particular c2pa-rs release candidate.
.github/workflows/test-c2pa-rs-source-build.yml: builds the native FFI library from an arbitrary c2pa-rs git ref instead of downloading a release asset. Needed for testing an RC that has no crates.io publish and no prebuilt GitHub release binaries. It's a no-op on ordinary PRs -- it only activates when a PR commits a target ref toc2pa-rs-preflight-ref.txt, at which point it reruns automatically on every push to that PR (so you get real CI signal while iterating on adaptation fixes, instead of having to remember to re-dispatch by hand). See the workflow's header comment for the full design, including why it'spull_request-only (noworkflow_dispatch) -- CodeQL flagged the latter as a cache-poisoning vector, since a dispatch against the default branch gets cache-write access while the workflow executes an arbitrary, unvalidated external ref.tests/test_unit_tests.pyfound while probing 0.91.0-rc.1 with this tool, all verified to still pass against the currently-pinned release (0.90.22):testPath2(an actual JPEG fixture) as"image/png"when adding it as an ingredient -- harmless whileadd_ingredient()didn't validate bytes against the declared MIME type, but a bug regardless.c2pa.placed-only actions list; added an explicit leadingc2pa.created/c2pa.openedaction (or reordered where one already existed) to match what a real C2PA manifest should look like.test_swapped_builder_is_freed_exactly_onceassumed a swapped builder handle's address always differs from the original -- that's an implementation detail of the native allocator, not a guarantee. Relaxed it to check the invariant that actually matters (freed exactly once).Test plan
🤖 Generated with Claude Code