Skip to content

ci: daily check that nss-rs still builds against NSS head - #186

Merged
larseggert merged 10 commits into
mainfrom
nss-head-watch
Sep 4, 2026
Merged

larseggert merged 10 commits into
mainfrom
nss-head-watch

Conversation

@larseggert

Copy link
Copy Markdown
Collaborator

Bisects the breaking NSS commit per platform from the last known-good revision and reports every failing platform in one NSS Bugzilla bug, closing it once head works again.

Needs a BUGZILLA_API_KEY secret. The mozilla/actions pin is temporary, pending the release of mozilla/actions#140.

Bisects the breaking NSS commit per platform from the last known-good revision and reports every failing platform in one NSS Bugzilla bug, closing it once head works again.

Needs a BUGZILLA_API_KEY secret. The mozilla/actions pin is temporary, pending the release of mozilla/actions#140.
Comment thread .github/workflows/nss-head.yml Fixed
Comment thread .github/workflows/nss-head.yml Fixed
@codecov-commenter

codecov-commenter commented Sep 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.65%. Comparing base (b7d4581) to head (d62e2e9).
⚠️ Report is 46 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #186      +/-   ##
==========================================
+ Coverage   72.30%   72.65%   +0.35%     
==========================================
  Files          28       28              
  Lines        3405     3376      -29     
  Branches     3405     3376      -29     
==========================================
- Hits         2462     2453       -9     
+ Misses        726      708      -18     
+ Partials      217      215       -2     
Flag Coverage Δ
freebsd 72.65% <ø> (+0.35%) ⬆️
linux 72.65% <ø> (+0.35%) ⬆️
macos 72.65% <ø> (+0.35%) ⬆️
windows 72.65% <ø> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Logs the Bugzilla payloads instead of posting them, so the reporting path can be exercised without filing a real bug.
Verify the range is good at its old end, and only read refs/bisect/bad after a converged run, so an environment that fails everywhere cannot blame an innocent commit.

Supersede a pull request's earlier runs, while leaving scheduled and dispatched bisects to finish. Add a test-bugzilla input that reports to the dev instance.
@larseggert
larseggert marked this pull request as ready for review September 4, 2026 11:02
Copilot AI balanced review requested due to automatic review settings September 4, 2026 11:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical workflow and credential-handling issues must be resolved before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds daily cross-platform NSS head compatibility checks, regression bisection, and automated Bugzilla reporting.

Changes:

  • Tests NSS head across seven platforms.
  • Bisects failures from the last known-good revision.
  • Creates, updates, or closes a consolidated Bugzilla report.

Review findings:

  • Critical: Fix the invalid local-action path at .github/workflows/nss-head.yml:93.
  • Critical: Require verdicts from all seven matrix jobs before updating Bugzilla.
  • Critical: Prevent test mode from falling back to the production Bugzilla API key.
  • Moderate: Enable failure handling for cleanup commands in nss-check.sh to prevent stale bindings and false results.
File summaries
File Description
.github/workflows/nss-head.yml Defines matrix testing, bisection, caching, and Bugzilla reporting.
.github/scripts/nss-check.sh Builds NSS and tests nss-rs for each bisected revision.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/scripts/nss-check.sh Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice piece of CI engineering — pinning head once in setup, one verdict file per platform, and a fingerprint so a stable failure set doesn't spam the bug are all the right calls. The pull_request self-trigger and the dry-run/test-bugzilla inputs are a good answer to "how do you test a workflow that files bugs". Comments inline; a few whole-PR observations:

Cost/scale. Seven platforms × up to 5.5 h, daily, with rm -rf dist forcing a from-scratch NSS build per bisect step and no warm cargo cache. A breaking NSS API change is almost always platform-independent, so bisecting on ubuntu-24.04 only and reporting plain pass/fail elsewhere would cut most of that while keeping the signal. If the full-matrix bisect is deliberate, git clone --filter=blob:none for NSS would at least trim the clone.

DRY. install-nss/action.yml already pairs nss-metadata with mozilla/actions/nss and re-exports min-version. Threading a deps-only input through it would let this workflow use ./install-nss for one step instead of repeating both, and keeps the mozilla/actions/nss pin in one place.

Bugzilla ownership. The [nss-rs-head] whiteboard marker is the only thing tying the workflow to the bug, so once head recovers the workflow will resolve it WORKSFORME even if a human has since taken it over and the real fix landed in nss-rs. Worth considering whether to skip closing when the bug is assigned. Also nothing documents that BUGZILLA_API_KEY/BUGZILLA_TEST_API_KEY must exist or which account owns them — a line in the workflow header would help whoever rotates the key.

Before merging, please run workflow_dispatch with test-bugzilla (and once without dry-run) on this branch: the pull_request trigger deliberately skips the report step, so the file/update/close paths and the whiteboard= search semantics get no coverage from CI.

The two zizmor findings on the earlier commit (unpinned mozilla/actions#140 ref) look resolved by b801415 moving to the v2.0.7 tag.

Comment thread .github/scripts/nss-check.sh Resolved
Comment thread .github/scripts/nss-check.sh Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Copilot AI review requested due to automatic review settings September 4, 2026 12:47
Comment thread .github/workflows/nss-head.yml Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Secret exposure risk and workflow correctness issues must be resolved before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (3)

.github/scripts/nss-check.sh:6

  • pipefail alone does not stop on ordinary command failures, so a failed cargo clean is ignored and cargo test may reuse the stale generated bindings this script intends to invalidate. Enable errexit so cleanup failures cannot produce a false-good bisect result.
set -o pipefail

.github/workflows/nss-head.yml:93

  • Local actions must use a path beginning with ./. This value is treated as an invalid action reference, so every matrix job stops before testing NSS; the existing call site in .github/workflows/semver.yml:60 uses the required form.
        uses: $/.github/actions/nss-metadata

.github/workflows/nss-head.yml:218

  • Requiring only one artifact allows a platform that fails before “Record the verdict” to disappear from the aggregate. If every remaining artifact passes, BROKEN becomes false and the workflow can close the bug while an unreported platform never completed. Require exactly one verdict for every matrix entry before making any Bugzilla decision.
          verdicts=(verdicts/*/verdict.json)
          [ ${#verdicts[@]} -gt 0 ] || { echo "::error::No platform reported a verdict"; exit 1; }
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread .github/workflows/nss-head.yml Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Second pass, on 7e78b0b. New comments inline; none of the points from my earlier review (bisect exit 125, unchecked cargo clean/NSS_PREBUILT, the NSPR clone location, gating the WORKSFORME close on needs.head.result, curl -L) appear to have been addressed yet, so I'm not repeating them.

Re Copilot's line-93 finding ("not valid local-action syntax, every matrix job will fail"): that's a false positive. The step ran fine in the last full run — the job step is logged as Run mozilla/nss-rs/.github/actions/nss-metadata@cad279a… on all seven platforms (ubuntu-24.04 job) — and the same uses: line already exists in install-nss/action.yml, which every workflow depends on.

The watcher isn't green on itself yet. In run 33866061143 all seven platforms failed, each in ~2 min at Test NSS head and then ~10 min in Bisect NSS — a shape that looks like the check script failing for environmental reasons (and then failing at the last-known-good too) rather than an actual NSS regression. Worth reading the uploaded nss-head.log/last-good.log before merging: in that state the bug gets filed with logs but no first-bad commit, which is the least useful outcome and the one the design is trying to avoid.

Pin regression. 7e78b0b moves mozilla/actions/nss back to an untagged main commit, which re-opens the two zizmor findings that b801415 had cleared and takes the step out of Renovate's reach. The FIXME covers the intent; consider filing a tracking issue so it doesn't sit there indefinitely (also, the comment says mozilla/actions#141 while the PR description says #140).

Still worth a decision from the earlier round: the DRY overlap with install-nss (a deps-only input would keep the mozilla/actions/nss pin in one place), and whether the full 7-platform bisect is worth its cost when a breaking NSS API change is almost always platform-independent.

Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Skip untestable NSS revisions with exit 125 rather than blaming them, bisect from the release branch point since the RTM tag is not an ancestor of head, and separate the per-platform cache keys so ubuntu-24.04 cannot restore the arm entry.

Require a complete matrix before closing a bug, keep the production Bugzilla key from standing in for a missing test key, drop curl -L so the key cannot follow a cross-host redirect, and find the bug by marker alone so a product move does not hide it.

Use actions/checkout for the NSS and NSPR trees.
Copilot AI review requested due to automatic review settings September 4, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The workflow currently fails on an invalid local-action reference and does not pin one NSPR revision across matrix jobs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

.github/workflows/nss-head.yml:93

  • This is not a valid local-action reference, so every matrix job will fail before testing NSS. Local actions must use a path beginning with ./ (as in semver.yml:60).
        uses: $/.github/actions/nss-metadata
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread .github/workflows/nss-head.yml Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Solid design, and the comments explaining why each guard exists make it reviewable — rare for a workflow this size. All ten points from my earlier pass have been addressed (exit 125 for untestable revisions, the release branch point instead of the RTM tag, the -- cache-key separator, the HEAD_RESULT gate before closing, no -L on curl, marker-only bug search with a deterministic order, and CARGO_TERM_COLOR: never).

A few things at the whole-PR level:

Cost and duplicated work. Seven runners each bisect the same NSS range independently, at up to 5.5 h and with the macOS ×10 / Windows ×2 minute multipliers. A single NSS API break will usually be one commit for all of them, so a cheaper shape is: everyone runs the head check, and only the first failing platform of each class (or just ubuntu-24.04) bisects, with the others reporting pass/fail. That also shortens the feedback loop, since the report job currently waits on the slowest bisect.

uses: $/.github/actions/nss-metadata (line 93). Copilot flagged this as invalid, but the same form is already on main in install-nss/action.yml:32 with green CI, so it is at least valid inside a composite action. Whether it also resolves at workflow level is what the in-flight run will tell you — worth confirming before merge, and worth making semver.yml (./) and this one consistent either way.

Discoverability of the new secret. BUGZILLA_API_KEY / BUGZILLA_TEST_API_KEY are only mentioned in the PR description. A line in the workflow header saying which secrets it needs and what happens when they are absent would save the next person a bisect of their own.

Minor: the report job has no timeout-minutes, so a hung curl sits for the default 6 h; and NSS_PREBUILT is documented in the head job's env comment (line 75) as coming from mozilla/actions/nss, but nss-check.sh now exports it itself — worth dropping from that comment so the two do not contradict each other.

Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Resolve NSPR once so every platform tests the same pair, skip the bisect when NSS head itself does not build, bound and retry Bugzilla reads, and refresh the bug summary when the failing set changes.

Keep the pull_request trigger for now, flagged to remove before merge.
Copilot AI review requested due to automatic review settings September 4, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Secret exposure and reporting correctness issues must be resolved before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

.github/workflows/nss-head.yml:236

  • This accepts any nonempty subset of matrix artifacts. If one leg fails before recording a verdict while another reports a breakage, the later code updates Bugzilla from incomplete data and can drop the missing platform from the reported failing set. Require all seven matrix verdicts before calculating or publishing the aggregate.
          [ ${#verdicts[@]} -gt 0 ] || { echo "::error::No platform reported a verdict"; exit 1; }
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Second-round review. The structure — pin head once, one verdict file per platform, merge into a single Bugzilla bug keyed on a whiteboard marker and a fingerprint — reads well, and most of the previous round is addressed: exit 125 / NO_BUILD for unbuildable NSS, the -- cache-key separator, the merge-base fallback instead of the raw RTM tag, CARGO_TERM_COLOR: never, whiteboard-only search with order=bug_id, NSPR pinned in setup, curl --max-time/retry-reads-only/no -L, and the hoisted summary on the update path.

Still open, not re-raised inline:

  • Copilot's finding on line 95 (uses: $/.github/actions/nss-metadata) is unfixed and fails every matrix job before anything is tested — the local-action path needs to be ./.github/actions/nss-metadata, as in semver.yml. Two zizmor code-scanning alerts on the hash pins are also open; the mozilla/actions/nss one is covered by the FIXME, the other (mismatched/unknown version comment) is not.
  • NSPR is checked out under github.workspace, relying on mozilla/actions/nss putting NSS_DIR directly beneath it for build.sh's sibling lookup; and head's NSPR is reused for every bisected revision back to the min-version branch point.
  • Forcing dry-run on pull_request would exercise the Bugzilla half (payload construction, heredoc, fingerprint dedup) that no CI run currently reaches, and would remove the need for the production key on that path — which also answers Copilot's point about the secret being reachable from same-repo PR runs.

Architectural: seven runners each willing to spend 5.5 h bisecting is a lot of daily CI for a signal that is largely redundant across images of the same family. Consider bisecting only on ubuntu-24.04/macos-15/windows-2025 and having the older images just build-and-report head; the per-OS last-good cache and the per-platform verdict schema already accommodate that, and a platform that only ever reports first_bad: "" costs one build instead of seven.

Also worth deciding deliberately: cargo test as the bisect predicate means any flaky test in nss-rs bisects to an arbitrary NSS commit. The last-known-good pre-check catches the always-failing case, but not an intermittent one.

Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Comment thread .github/workflows/nss-head.yml Resolved
Carry no-build and self-broken through to the verdict so the report can word them correctly and skip filing when no platform got far enough to implicate NSS. Treat a failed comment read as fatal rather than as evidence of nothing reported.

Pin mozilla/actions v2.0.8, and drop the pull_request trigger: the job holds a Bugzilla API key that a same-repository pull request could edit its way to.
Copilot AI review requested due to automatic review settings September 4, 2026 14:17
shellcheck SC2015: A && B || C is not if-then-else.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The cross-platform CI, bisection, caching, and external Bugzilla automation require final human review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings September 4, 2026 14:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Three moderate workflow issues could produce stale or incomplete Bugzilla reporting.

Review details

Suppressed comments (3)

Previously missed (2) — in code that hasn't changed since the last review.

.github/workflows/nss-head.yml:241

  • The fingerprint omits no_build and self_broken, although those fields determine the diagnosis posted below. If a platform changes from an inconclusive bisect to a bad last-known-good build (or, in a mixed failure, to an NSS build failure) while first_bad remains empty, this fingerprint is unchanged and the new diagnosis is never posted. Include both state fields in the fingerprint.
    .github/workflows/nss-head.yml:314
  • Searching the entire comment history makes a recurring failure set look current. For example, after fingerprints A → B → A, the old A comment still matches this grep, so the workflow leaves the bug summary and latest report describing B. Compare against only the most recent automated fingerprint instead of any historical occurrence.

.github/workflows/nss-head.yml:285

  • This path can mutate the bug from an incomplete result set. The green path checks HEAD_RESULT, but if one matrix job times out before uploading a verdict while another job reports a real failure, BROKEN is true and execution reaches here with the timed-out platform omitted. That can file or rewrite the bug as if the partial platform list were complete. Track the expected verdict count and skip Bugzilla mutations whenever any platform verdict is missing.
          failed=$(jq -r '[.[] | select(.broken) | .os] | join(", ")' all.json)
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A daily watcher that builds nss-rs against NSS head on 7 platforms, bisects the breakage per platform, and funnels every verdict into one Bugzilla bug that it also closes again. The structure is sound: verdicts are per-platform JSON merged in one place, the fingerprint keeps the bug from being re-commented, SELF_BROKEN/NO_BUILD distinguish "not NSS's fault", and the mutation paths are dry-runnable.

Since the earlier round, these all look addressed: the API-key fallthrough to production, the -L/redirect header leak, the RTM tag vs. branch-point fallback, the nss-last-good-ubuntu-24.04-/-arm cache-key prefix collision, NSPR pinned once in setup, whiteboard-only + order=bug_id search, CARGO_TERM_COLOR: never, the stale summary on update, the fatal-on-failed-GET dedup, and the removal of the pull_request trigger (Copilot's secret-exposure point was right).

Two things that apply to the PR as a whole:

  • Duty cycle. Worst case is 7 runners × up to 5.5 h per day, including macOS (10× billing) and Windows (2×), and the bisect is repeated on every platform for what is usually one NSS commit. Bisecting on a single platform (say ubuntu-24.04) and letting the rest report pass/fail would give the same actionable bug for a fraction of the cost; the per-platform first_bad only really earns its keep when platforms disagree. Related: the older OS row (ubuntu-22.04, macos-14, windows-2022) mostly re-detects the same API break — worth deciding whether it needs to run daily rather than weekly.
  • Documentation. Nothing in the tree says this workflow files bugs, which secrets it needs (BUGZILLA_API_KEY, BUGZILLA_TEST_API_KEY), or that a missing key silently skips reporting. A short header comment in nss-head.yml (or a README section) covering the secrets and the dry-run/test-bugzilla dispatch inputs would help whoever inherits this — especially as the Bugzilla half is now only ever exercised by hand before merge.

Differing view on one existing comment: Copilot flags uses: $/.github/actions/nss-metadata as invalid local-action syntax. The same form is already on main in install-nss/action.yml#L32 and check.yml#L205, so it appears to be a deliberate repo convention rather than a typo — if it were invalid, the i686 job on main would already be failing.

git -C "$NSS_DIR" bisect start "$HEAD_SHA" "$last_good"
# Only a converged run leaves refs/bisect/bad on the first bad commit;
# after an abort it still points at the last revision tested.
if git -C "$NSS_DIR" bisect run "$CHECK" 2>&1 | tee bisect.log; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

On the Windows runners this blames an innocent commit.

git bisect run starts the predicate through the shell, and $CHECK contains backslashes (github.workspace is D:\a\nss-rs\nss-rs), which are among the metacharacters git tests for in prepare_shell_cmd(). So git runs sh -c 'D:\a\nss-rs\nss-rs/.github/scripts/nss-check.sh', sh eats the backslashes, the command is not found, and the status is 127 — neither 125 nor >= 128, so every revision is marked bad and the bisect converges on the commit right after last_good. The two direct "$CHECK" invocations above work, because bash resolves the mixed-separator path itself, so nothing else hints at the problem.

Passing the path as an argument keeps it out of the shell's word splitting:

Suggested change
if git -C "$NSS_DIR" bisect run "$CHECK" 2>&1 | tee bisect.log; then
if git -C "$NSS_DIR" bisect run bash "$CHECK" 2>&1 | tee bisect.log; then

Alternatively, drop the job-level env.CHECK and export a POSIX-style path after checkout, which also fixes it:

      - run: echo "CHECK=$(pwd)/.github/scripts/nss-check.sh" >> "$GITHUB_ENV"

Comment thread .github/scripts/nss-check.sh Outdated
cd "$NSS_RS_DIR" || exit 125
# Nothing tells cargo that dist changed, so force the bindings to regenerate.
cargo clean -p nss-rs || exit 125
cargo test --locked

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

The default feature set skips the code most likely to break against NSS head.

blapi gates src/freebl/mod.rs, a hand-written FFI to FREEBL_GetVector() with a hand-maintained FREEBLVector layout — exactly the private, unstable surface NSS changes without notice, and cargo test --locked never compiles it. check.yml covers it via cargo hack test --feature-powerset; the watcher does not, so a freebl ABI change stays invisible until a release.

A second run costs one cargo build on top of the NSS build that dominates each bisect step (note the || exit $?: without set -e, the second run would otherwise mask a failure in the first):

Suggested change
cargo test --locked
cargo test --locked || exit $?
# blapi's hand-written freebl FFI is not built by the default feature set.
cargo test --locked --features blapi

# Only a converged run leaves refs/bisect/bad on the first bad commit;
# after an abort it still points at the last revision tested.
if git -C "$NSS_DIR" bisect run "$CHECK" 2>&1 | tee bisect.log; then
first_bad=$(git -C "$NSS_DIR" rev-parse refs/bisect/bad)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tip

A converged bisect proves a new known-good commit; keeping it avoids re-bisecting the same range every day.

.nss-last-good is only updated when head is green, so while the bug stays open every daily run re-bisects from the old endpoint — ~7 from-scratch NSS builds × 7 platforms, every day, to rediscover the same commit. Recording the first bad commit's parent shrinks the next run to a day's worth of commits, and the pre-check above re-verifies the endpoint if it turns out not to be good after all.

Suggested change
first_bad=$(git -C "$NSS_DIR" rev-parse refs/bisect/bad)
first_bad=$(git -C "$NSS_DIR" rev-parse refs/bisect/bad)
# Narrow tomorrow's range: the parent of the first bad commit is
# good here, so there is no need to bisect the release again.
git -C "$NSS_DIR" rev-parse "$first_bad^" > .nss-last-good

The cache save step then needs to run for that case too:

        if: env.BROKEN == 'false' || env.FIRST_BAD != ''

Comment on lines +89 to +94
- id: meta
uses: $/.github/actions/nss-metadata

- uses: mozilla/actions/nss@264c6b750df669adb58286a26c5d0e04e839e06b # v2.0.8
with:
deps-only: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

This is install-nss/action.yml minus the version inputs, and it pins a different mozilla/actions/nss.

install-nss already pairs nss-metadata with mozilla/actions/nss, but pins f8e0d5c # v2.0.6 where this pins 264c6b7 # v2.0.8. The two will drift on the next Renovate bump, and the deps-only build would then use a different action version than every other workflow. A deps-only passthrough on install-nss (which already exposes min-version, the only thing steps.meta is used for here) keeps the pin in one place:

Suggested change
- id: meta
uses: $/.github/actions/nss-metadata
- uses: mozilla/actions/nss@264c6b750df669adb58286a26c5d0e04e839e06b # v2.0.8
with:
deps-only: true
- id: meta
uses: ./install-nss
with:
deps-only: true
token: ${{ secrets.GITHUB_TOKEN }}

Copilot AI review requested due to automatic review settings September 4, 2026 14:39
@larseggert
larseggert merged commit 17b11d2 into main Sep 4, 2026
16 of 17 checks passed
@larseggert

Copy link
Copy Markdown
Collaborator Author

Needs to be on main to be tested

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The build isolation, local-action reference, and incomplete-verdict handling issues must be fixed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

.github/workflows/nss-head.yml:90

  • This is not a valid local-action reference, so every matrix job will fail before reaching the NSS setup. Local actions must use a path beginning with ./; the same action is referenced correctly in .github/workflows/semver.yml:60.
        uses: $/.github/actions/nss-metadata

.github/workflows/nss-head.yml:234

  • This only rejects the case where every verdict is missing. If one matrix job times out or fails before recording its verdict while another platform is broken, the workflow will file or update the bug from a partial set and can incorrectly remove that missing platform from the summary. Require one verdict for every matrix entry (currently seven), or represent missing entries explicitly, before allowing any Bugzilla mutation.
          verdicts=(verdicts/*/verdict.json)
          [ ${#verdicts[@]} -gt 0 ] || { echo "::error::No platform reported a verdict"; exit 1; }
          jq -s 'sort_by(.os)' "${verdicts[@]}" > all.json
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

export NSS_PREBUILT=1

# build.rs reads $NSS_DIR/../dist, so a stale tree would mask a failed build.
rm -rf "${NSS_DIR}/../dist" || exit 125

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice shape overall: pinning NSS/NSPR once in setup, one verdict file per platform, and a single fingerprinted Bugzilla bug is the right factoring for a fan-out watcher, and the last round addressed most of the earlier feedback (125-as-untestable, the -- cache-key separator, whiteboard-only + order=bug_id search, no -L and retry-only-on-GET, fatal comment-read failure, hoisted summary, CARGO_TERM_COLOR: never, NSPR pinned in setup, the blapi run, and dropping the pull_request trigger).

Three things that apply to the PR as a whole, beyond the inline comments:

  • Confirming Copilot's finding on line 90 — uses: $/.github/actions/nss-metadata is still that way at the merged head. A local action must be ./-prefixed, so steps.meta fails before anything is tested and the workflow can never do its job; MIN_VERSION in Bisect NSS is then empty as well. Worth chasing two follow-ups: the same prefix appears at check.yml:205 and check-i686/action.yml:34 on main, and actionlint is supposed to reject this uses form — if it isn't firing, the same class of typo will keep landing.
  • The Bugzilla half now has no test path at all. With pull_request gone (correctly — the job holds a production secret), every jq payload, the heredoc and the fingerprint dedup are exercised for the first time at 05:17 UTC against the live tracker. workflow_dispatch with dry-run/test-bugzilla covers it, but only if someone remembers. Moving the ~70 lines of inline shell into .github/scripts/nss-report.sh would make it runnable (and reviewable) outside Actions and keep the YAML to orchestration, matching how the build half already works.
  • Standing cost while a bug is open. .nss-last-good only advances on a green head, so each daily run re-bisects the same range: up to ~9 from-scratch NSS builds × 7 runners, every day, to rediscover the same commit. That is also what makes timeout-minutes: 330 tight on the Windows/macOS runners, and a timed-out platform silently drops out of the report (the HEAD_RESULT gate only protects the close path). Recording the first-bad commit's parent as the new last-good — my earlier suggestion on line 159 — is what bounds this.

Also still open from my previous round and not re-raised inline: the Windows $CHECK backslash path (sh mangles it, exit 127 marks every revision bad), tags not being fetched when ref is a bare SHA (breaks the NSS_x_y_RTM fallback on exactly the first run), and the nss-metadata + mozilla/actions/nss duplication with install-nss, which pins a different action version and will drift on the next Renovate bump.

Comment on lines +24 to +26
cd "$NSS_RS_DIR" || exit 125
# Nothing tells cargo that dist changed, so force the bindings to regenerate.
cargo clean -p nss-rs || exit 125

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

The script's own failures reuse 125, which the workflow reads as "NSS head does not build".

cd, cargo clean and the rm -rf on line 16 are environment failures, not "this NSS revision is untestable". Exiting 125 makes the head job set NO_BUILD=true (line 128), which suppresses filing entirely when every failing platform hits it (line 301), and reports "NSS head does not build." in the NSS bug when only some do. A locked file under dist or a cargo clean that loses a race with sccache/AV on the Windows runners is the realistic trigger.

An exit code >= 128 is the right signal for both consumers: git bisect run aborts rather than silently skipping the revision (git-bisect docs: any code outside 0–127 aborts), and the head job no longer mistakes it for an NSS build failure.

Suggested change
cd "$NSS_RS_DIR" || exit 125
# Nothing tells cargo that dist changed, so force the bindings to regenerate.
cargo clean -p nss-rs || exit 125
cd "$NSS_RS_DIR" || exit 128
# Nothing tells cargo that dist changed, so force the bindings to regenerate.
cargo clean -p nss-rs || exit 128

Line 16 wants the same treatment; build.sh on line 22 is the only genuine 125.

Comment on lines +240 to +241
echo "FINGERPRINT=$(jq -cS 'map(select(.broken) | {os, first_bad})' all.json \
| sha256sum | cut -c1-12)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

The fingerprint ignores the failure mode, so a platform that changes why it fails posts no update.

first_bad is "" for all three of "NSS does not build", "fails at the last known-good too" and "bisect inconclusive", so e.g. windows-2025 going from no_build to a genuine-but-inconclusive failure keeps {os, first_bad} identical: the dedup on line 314 matches, no comment is added, and the bug's detail stays stale for as long as the set of platforms doesn't change.

Suggested change
echo "FINGERPRINT=$(jq -cS 'map(select(.broken) | {os, first_bad})' all.json \
| sha256sum | cut -c1-12)"
echo "FINGERPRINT=$(jq -cS 'map(select(.broken) | {os, first_bad, no_build, self_broken})' all.json \
| sha256sum | cut -c1-12)"

# A bisect over a release's worth of NSS commits is ~7 from-scratch builds.
timeout-minutes: 330
env:
# NSS_DIR, NSS_PREBUILT and NSS_BUILD_FLAGS come from mozilla/actions/nss.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

Stale after the last round: nss-check.sh exports NSS_PREBUILT itself (line 13 there), precisely because deps-only does not set it. Leaving it listed here invites someone to drop that export.

Suggested change
# NSS_DIR, NSS_PREBUILT and NSS_BUILD_FLAGS come from mozilla/actions/nss.
# NSS_DIR and NSS_BUILD_FLAGS come from mozilla/actions/nss; nss-check.sh
# exports NSS_PREBUILT itself.

@larseggert
larseggert deleted the nss-head-watch branch September 7, 2026 08:06
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.

4 participants