Skip to content

build: tune the release profile, drop the no-op feature flag, and share test helpers - #8

Merged
ctxswitch merged 1 commit into
cleanup/phase-5-configfrom
cleanup/phase-6-build-docs-tests
Aug 30, 2026
Merged

ctxswitch merged 1 commit into
cleanup/phase-5-configfrom
cleanup/phase-6-build-docs-tests

Conversation

@ctxswitch

Copy link
Copy Markdown
Owner

Summary

Final phase of six. Based on cleanup/phase-5-config (#7).

Build. Added [profile.release] with lto = "thin" and codegen-units = 1 — a
performance-sensitive server was shipping untuned. Dropped CARGO_FEATURES ?= --all-features and its six expansions from the Makefile; the crate has no
[features] table, so it was a no-op on every target, and the build help text that
promised "every feature enabled" went with it.

Docs. AGENTS.md claimed Cargo auto-discovers the integration tests. It does not —
they live in a subdirectory, so each is an explicit [[test]] target in Cargo.toml,
and a new file needs a new entry. Corrected, with a note on how the new shared-helper
module is included without becoming a target itself.

Test scaffolding. The oneshot call/request wrapper duplicated across
channels.rs, build_cache.rs, local_artifacts.rs, and maintenance.rs moves to
tests/integration/common/mod.rs. The bind-and-serve block repeated eight times in
cacheprog_test.rs becomes one serve(app) helper. The SpacePolicy literal repeated
four times in space_test.rs becomes ledger_from(source). ring_test.rs loses a
dangling comment and gains an honest test name.

Also folds in one cross-phase fix, described under Review notes.

Verification

make ci clean, including clippy --all-targets -- -D warnings.

docker build . succeeds — this was the end-of-sweep check that the release
profile and the dependency removal from an earlier PR in this stack do not break the
release build.

Assertion accounting across the scaffolding changes: test and assertion counts are
byte-identical before and after in every touched file except cacheprog_test.rs,
which drops exactly one test and its three assertions — the deliberate deletion below.

  • make ci
  • Documentation and examples are accurate
  • New or changed behavior has test coverage

Operational impact

Release binaries are now built with thin LTO and a single codegen unit: slower builds,
faster binary. No runtime behaviour, configuration, storage format, route, or metric
changes.

Review notes

One deletion, verified before removing it.
foreground_get_waits_for_the_inflight_prefetch_download was deleted as subsumed by
the queued variant that follows it. The subsumption is genuine, not assumed:
begin_download runs at enqueue time, before limit.acquire_owned(), so "actively
downloading" and "queued behind the semaphore" are the same entry in the same
inflight map, and the foreground get performs the same single
download_in_progress lookup, pending.changed().await, and disk recheck for both.
The queued test exercises the strictly harder precondition and carries an assertion
the deleted one lacked — a released flag proving the get actually blocked rather
than racing through.

Two planned items were already resolved by earlier PRs in the stack, and correctly
changed nothing.
The stale doc comment in proxy/mod.rs went out with the function
it was glued to. And docs/operations.md needed no metric updates: every string
literal in src/telemetry.rs was diffed between the base commit and HEAD, yielding
only six new literals, all tracing field names and messages. The agent metrics look
changed under a name grep only because they moved from format!("flywheel_agent_ {suffix}") to full literals; extracting the (name, help) pairs at both revisions
gives 19 identical pairs in identical order.

One fix from outside this phase's scope is included, deliberately. The container
build surfaced warning: value assigned to observation is never read in
observe_prefetch_body, which the earlier consolidation introduced. It looked like a
miscounting bug — completed transfers recorded as cancelled — so it was tested rather
than assumed: driving a body to completion through observe_prefetch_body with a
probe recorder shows the recorder receives completed = true. Drop reads the field,
so the metric was always correct and the warning is a false positive.

It is still worth fixing, because it is a latent CI break: local rustc is 1.91.0 and
the container's is 1.97.1, and the expanded unused_assignments lint only fires on the
newer one — so clippy -- -D warnings would fail on a current toolchain even though
it passes here. The flag is now written through a complete() method, which is what
the original plan specified anyway. Folded into this PR rather than sent back through
the stack, since rebasing five stacked branches to place a three-line change would
cost more review than it saves; cherry-pick it onto #5 instead if you would rather it
sat with the code it belongs to.

Noted, not fixed: tests/integration/package_proxies.rs has four more call-family
helpers and two inline .oneshot(...) sites that could sit on common::call. It was
not on this phase's list; the module is in place for a follow-up.

@ctxswitch
ctxswitch force-pushed the cleanup/phase-6-build-docs-tests branch from 69cb6b6 to 48c86ae Compare August 30, 2026 18:24
@codecov

codecov Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (cleanup/phase-5-config@0feba38). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                    @@
##             cleanup/phase-5-config       #8   +/-   ##
=========================================================
  Coverage                          ?   89.59%           
=========================================================
  Files                             ?       37           
  Lines                             ?     6737           
  Branches                          ?        0           
=========================================================
  Hits                              ?     6036           
  Misses                            ?      701           
  Partials                          ?        0           

☔ 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.

…re test helpers

Configure thin LTO and one codegen unit, remove the no-op all-features Make variable, and correct the integration-test guidance.

Share repeated integration and unit-test scaffolding, and remove the prefetch test subsumed by the queued-download case.
@ctxswitch
ctxswitch force-pushed the cleanup/phase-6-build-docs-tests branch from 48c86ae to 5527df0 Compare August 30, 2026 18:49
@ctxswitch
ctxswitch merged commit adf4e36 into main Aug 30, 2026
7 of 12 checks passed
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.

1 participant