Skip to content

fix(kerykeion): drop the redundant Instrument import from collector_tests - #471

Merged
forkwright merged 1 commit into
mainfrom
fix/kerykeion-redundant-instrument-import
Aug 26, 2026
Merged

fix(kerykeion): drop the redundant Instrument import from collector_tests#471
forkwright merged 1 commit into
mainfrom
fix/kerykeion-redundant-instrument-import

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Finding

gate / full-gate-build fails on main, which blocks release PR #465 (chore(main): release 0.6.2, open 8 days). gate / gate reports failure too, but it is a downstream reporter of the
same result — one cause, not two.

Evidence

gate / full-gate-build step check, verbatim:

error: unused import: `tracing::Instrument`
--> crates/kerykeion/src/collector_tests.rs:4:5
|
4 | use tracing::Instrument as _;
| ^^^^^^^^^^^^^^^^^^^
= note: `-D unused-imports` implied by `-D warnings`
error: could not compile `kerykeion` (lib test) due to 1 previous error

gate / gate (job 98205969995) then reports:

BUILD_RESULT: failure
ERROR: no Gate-Passed trailer, not a docs-only changeset, and full-gate-build did not succeed

This is not the release commit's doing.gh pr diff 465 touches only
.release-please-manifest.json, CHANGELOG.md, Cargo.lock, Cargo.toml.
crates/kerykeion/src/collector_tests.rs is byte-identical between origin/main and the release
head, so the fix belongs here on main.

Why this matters

collector.rs:688-690 declares the test file as a child module:

#[cfg(test)]#[path = "collector_tests.rs"]mod tests;

collector.rs:15 already carries use tracing::{Instrument as _, instrument};, and
collector_tests.rs:6 opens with use super::*;. A non-pub item is visible to its defining
module and its descendants, so that glob already brings Instrument into scope — the file's own
line 4 binds a name it would have either way.

Desired correction

Delete line 4 and its trailing blank. The two .instrument() call sites (lines 258, 332) keep
resolving through use super::*;, and collector.rs keeps its own import — it uses both the trait
and the #[instrument(...)] attribute macro directly.

Done when:full-gate-build passes on main and #465's gate / gate goes green.

WARNING — the detection is non-deterministic, the defect is not

The same check command over these byte-identical files passed on a main-push run 15 hours
earlier (run 32907547269, job 97994832002, same pinned toolchain 1.97.1) and failed here.
Swatinem/rust-cache shares one key (gate-attestation) across the push and pull_request
triggers, so an incremental cache hit can let rustc skip re-linting this compilation unit.

The import is unconditionally redundant and removing it is correct regardless of cache state — but
treat a green run on this workspace as not evidence that a -D warnings lint is absent. That
shared cache key is worth a separate look.

…ests
`collector.rs` declares `collector_tests.rs` as a child module via
`#[cfg(test)] #[path = "collector_tests.rs"] mod tests;`, and the test file opens
with `use super::*;`. That glob already re-exposes the parent's private
`use tracing::{Instrument as _, instrument};`, so the file's own
`use tracing::Instrument as _;` binds a name that is in scope either way.
Under `RUSTFLAGS: -D warnings` the gate's `cargo check --workspace --all-targets`
rejects it as `unused_imports`, failing `full-gate-build` and, downstream,
`gate / gate`.
The two `.instrument()` call sites keep resolving through `use super::*;`, and
`collector.rs` keeps its own import — it uses both the trait and the
`#[instrument(...)]` attribute directly.
WARNING for whoever sees this recur: the same command over these byte-identical
files passed on a main-push run 15 hours earlier under the same pinned toolchain.
The import is unconditionally redundant, but its DETECTION is not deterministic —
`Swatinem/rust-cache` shares one key across the push and pull_request triggers, so
an incremental cache hit can skip re-linting this unit. A green run is therefore
not evidence the lint is absent.
@forkwright
forkwright merged commit 2b2e0ee into mainAug 26, 2026
12 checks passed
@forkwright
forkwright deleted the fix/kerykeion-redundant-instrument-import branch August 26, 2026 14:45
forkwright added a commit that referenced this pull request Aug 26, 2026
## Finding
Release PRs here arrive with their required contexts **absent rather
than red**, because
release-please creates them with `GITHUB_TOKEN` and GitHub raises no
workflow-triggering events
for that token. Branch protection holds a PR with a missing context
forever.
## Evidence
#465 (`chore(main): release 0.6.2`) sat **8 days** at `mergeStateStatus:
BLOCKED` with an **empty**
`statusCheckRollup` while five workflow runs waited at
`action_required`. `gh api
repos/forkwright/akroasis/actions/runs?status=action_required` currently
returns **51** held runs.
## Why this matters
A missing check is worse than a failing one — a red check advertises
itself; an absent one looks
exactly like a PR still waiting on CI. Releases stop, and nothing
surfaces the cause.
## Desired correction
Adopt the reusable healer merged as `forkwright/.github#56`. This file
asks for it and declares
nothing about how it works, so it cannot drift from the other 17 repos
that will carry it.
**Done when:** a subsequent release PR here reaches a non-empty
`statusCheckRollup` without a
human approving runs by hand.
## The permissions block is load-bearing
It is not the usual boilerplate. For `workflow_call`, the caller's
`permissions` is a **cap** — a
called workflow can only *downgrade* the token, never upgrade it. A
caller declaring the customary
`contents: read` alone would leave the healer unable to approve a single
run, and the only symptom
would be a release that stayed stuck. `actions: write` approves the held
runs; `pull-requests:
read` finds the release PR and its head SHA. Nothing here writes to a
PR.
## Note
This is the first adopter, deliberately — akroasis is the only repo with
an open stuck release PR
right now, so it is where the end-to-end path can actually be observed
rather than assumed. The
remaining 17 follow once a run here is read.
Independent of this, #465 is also blocked by a real compile failure that
#471 fixes; the two are
unrelated causes on the same PR.
Co-authored-by: forkwright <cody@forkwright.com>
Sign up for freeto 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.

1 participant

@forkwright