fix: unbreak main — rand 0.10 API move and napi runtime/derive skew - #149
Merged
Merged
Conversation
`main` has failed `Code Linting and SAST`, `Tests`, `Code Checks`, `Lint`,
`Build CLI (Linux)` and `Build Docker image` on every push since 2026-09-13.
Two independent breakages, neither previously root-caused:
1. `rand` 0.10 moved `Rng::fill` onto a new `RngExt` trait, so
`crates/vym-fyi-model/src/services/slug.rs`'s `rand::rng().fill(..)` no
longer resolves. The workspace pins `rand = "0.10"`, so the caret range
picked the breaking major up silently. One import line.
2. `napi` and `napi-derive` are both pinned `"3"`, and drifted apart under
that range: the lockfile held `napi` 3.8.6 against `napi-derive` 3.6.5
(backed by `napi-derive-backend` 6.1.3). The derive macro expands to
calls the older runtime crate does not expose —
`napi::bindgen_prelude::{from_raw_optional_field, from_raw_required_field,
get_named_property_raw, set_named_property_raw}`, `NativeBorrowBarrier`,
`NativeBorrowScope` — producing 19 E0425/E0433 errors that all originate
inside the `#[napi]` attribute macro rather than in any source line a
reader would suspect. `cargo update -p napi` resolves 3.8.6 -> 3.12.2.
Lockfile-only for the second; no manifest range changed for either.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4 tasks
stephane-segning
added a commit
that referenced
this pull request
Sep 18, 2026
…152) `Docker build for Server`/`Docker build for Redirect` (build.yml) were failing on main before #149, and #148's run showed the same `rand::RngExt` compile error #149 fixed. #149's own build.yml run (triggered on push, run 35349420384) proves that compile fix is complete and sufficient on its own: both matrix legs now genuinely finish `cargo build --profile prod` for both amd64 and arm64 (`Finished 'prod' profile [optimized] target(s)`), and the image is built and exported successfully. But that same run then fails at push, with a different, unrelated error: ERROR: failed to push ghcr.io/vymalo/fyi-redirect:latest: denied: permission_denied: The requested installation does not exist. `IMAGE_NAME: vymalo/fyi` (env, this file) is stale: this repository used to live at `vymalo/fyi` and was renamed/transferred to `vaam-apps/fyi` (confirmed: `gh api repos/vymalo/fyi` resolves to `vaam-apps/fyi` via GitHub's own rename redirect). The `GITHUB_TOKEN` this workflow authenticates to `ghcr.io` with is scoped to this repository's *actual current* owner (`vaam-apps`) -- it has no "installation" letting it push to a package namespace under a different, no-longer-current owner (`vymalo`), regardless of the rename redirect still resolving the repo itself. Fixed by making `IMAGE_NAME` track the real repository dynamically (`${{ github.repository }}`) instead of a literal that can go stale on the next rename -- the same fix shape already used elsewhere for this exact class of problem (see the sibling `vsms` repo's own release pipeline, which already publishes to `ghcr.io/${{ github.repository_owner }}/...` for the identical reason after going through two of its own org renames). Not touched, deliberately out of scope for "the two Docker build jobs": `charts/vym-fyi-server-{crud,redirect}/values.yaml` (`image. repository: ghcr.io/vymalo/fyi-{crud,redirect}`, the Helm chart's default pull target -- equally stale, but a helm-publish.yml/chart concern, not build.yml) and `charts/.../Chart.yaml` `home`/`sources` URLs, `mkdocs.yml`'s site description, `docs/index.md`/`docs/arc42.md` prose, `README.md`'s illustrative image tag, and `.github/FUNDING.yml` (also all reference the old `vymalo` name, cosmetic/documentation or a separate chart-publish concern rather than something breaking this task's own two CI jobs). Flagged for the maintainer as a follow-up rather than swept in the same PR. Verification: - `python3 -c "import yaml; yaml.safe_load(...)"`: valid YAML - `actionlint .github/workflows/build.yml`: exit 0, no findings - `zizmor .github/workflows/build.yml`: "No findings to report", exit 0 - Pushing this branch (build.yml triggers on `push` to any branch, paths including `.github/workflows/build.yml` itself) is the actual end-to-end verification -- see the PR for the resulting run's conclusion. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Merged
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
mainhas been red since 2026-09-13 — every push failingCode Linting and SAST,Tests,Code Checks,Lint,Build CLI (Linux)andBuild Docker image. Two independent breakages, neither previously root-caused. Both are fixed here;cargo check --workspace --all-targetsandcargo test --workspaceare clean afterwards.Intent
Unblocks #147 (org-wide SAST/lint/Trivy adoption), which cannot be judged on its own merits while
mainfails the same jobs for unrelated reasons. Found while fixing the Trivy severity-gate findings in #148.Scope
crates/vym-fyi-model/src/services/slug.rs— one import line.Cargo.lock—napi3.8.6 → 3.12.2,napi-sys3.2.1 → 3.3.1,ctorconsolidation.No manifest version range changed. Nothing else touched.
1.
rand0.10 movedRng::fillontoRngExtThe workspace pins
rand = "0.10", so the breaking major arrived through the caret range.rand::rng().fill(buf.as_mut_slice())no longer resolves:use rand::Rng;→use rand::RngExt;.Rngwas imported forfillalone in that file, so this is a replacement, not an addition.2.
napiandnapi-derivedrifted apart under one caret rangeBoth pinned
"3"in the workspace manifest. The lockfile heldnapi3.8.6 againstnapi-derive3.6.5 (napi-derive-backend6.1.3). The derive macro expands to calls the older runtime crate does not expose:19 errors, all originating inside the
#[napi]attribute macro rather than at any source line a reader would suspect — which is why this was hard to see.cargo update -p napiresolves it.This supersedes dependabot #141, which proposes the same
napibump without therandhalf; either alone leavesmainred.Verification
Run locally against a clean clone of
main(914411f):cargo check --workspace --all-targetsfails —vym-fyi-modelon E0599, thenvym-fyi-nodeon 19 E0425/E0433.randfix alone:vym-fyi-modelcompiles;vym-fyi-nodestill fails with the same 19 errors — confirming the two breakages are genuinely independent and neither fix alone is sufficient.cargo check --workspace --all-targets→Finished dev profile.cargo test --workspace→ 8 test binaries, 8 passed, 0 failed (5 + 1 + 2 across the three crates that have tests).Screenshots/Evidence
Pasted above: the real compiler output for each failure mode, and the resolved versions (
Updating napi v3.8.6 -> v3.12.2,Updating napi-sys v3.2.1 -> v3.3.1).Risk Assessment
Low, with one thing a reviewer should confirm rather than take on trust.
randchange is a trait-import swap.RngExt::fillfills a byte slice with random bytes exactly asRng::filldid;generate_slug's two existing tests pass unchanged. No behavioural change to slug generation.napibump is a minor version within the pinned"3"range and is lockfile-only —cargo updatewould have picked it up on any unrelated dependency refresh. The native addon is the part worth a second look:cargo checkandcargo testprove it compiles and links, but neither loads the built.nodefrom Node.js. CI'sBuild CLI (Linux)andBuild Docker imagejobs are the real confirmation, and they run on this PR.mainis currently red, so CI on this branch should be read as "does it go green", not "does it stay green".AI Usage Declaration
Claude Opus 5 root-caused both failures and wrote the fix. Every claim in this description was verified by running the command and reading its output, not inferred: the before/after compile states, the intermediate state proving the two breakages are independent, and the test results. Human accountability:
Reviewer Focus
napishould be pinned more tightly than"3"alongsidenapi-derive. This class of skew recurs by construction while both sit on the same caret range with no lockstep constraint, and the failure it produces points at the macro rather than at the mismatch.Build CLI (Linux)/Build Docker imageresults on this PR — those are what actually exercise the native addon.🤖 Generated with Claude Code