Skip to content

docs(test): unstale the #1470 attic test's comments - #1491

Merged
kalbasit merged 1 commit into
mainfrom
user/wnasreddine/ncps_issue_1470
Sep 6, 2026
Merged

kalbasit merged 1 commit into
mainfrom
user/wnasreddine/ncps_issue_1470

Conversation

@kalbasit

@kalbasit kalbasit commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

Comment-only cleanup left behind by #1474. No test or production behaviour changes.

The transport-level subtest in pkg/cache/attic_narinfo_url_compression_test.go skips with:

t.Skip("known open: transport-level zstd — follow-up change, see #1470")

Both references are now dead:

So a reader hitting this skip today is pointed at a closed issue and a PR that does not exist, and cannot tell whether the test is blocked on something in flight. That is the only thing wrong here.

What changed

The skip is restated as what it actually is — a standing description of an open gap with no fix planned. The gap itself is unchanged and still real: upstream.GetNar unconditionally sends Accept-Encoding: zstd and blind-strips any Content-Encoding: zstd, so an upstream applying zstd at the transport level over an uncompressed body leaves ncps holding a raw NAR, which it stores and serves under a .nar.zst key while the narinfo advertises Compression: zstd.

The comment now also records what was learned while diagnosing #1470 and was not written down anywhere:

  • why the gap is ncps-specific — ncps always advertises zstd, while nix's curl often is not built with it, so a proxy may compress for ncps alone even though such an upstream is arguably nonconforming and breaks plain nix too (Substitution does not work for binary caches behind reverse proxies with compression NixOS/nix#10275);
  • that no real upstream has been observed doing this;
  • exactly what would close it (stop requesting transport zstd for content the narinfo already declares compressed, in pkg/cache/upstream), after which the subtest should pass with no edit and the skip can be deleted.

The header comment had gone stale the same way. It described the pre-fix behaviour in the present tense ("ncps derives a NAR's compression exclusively from the URL's file extension… and never reconciles") and cited a cache.go comment that #1474 itself rewrote. Reworded to past tense as the bug the test guards against, and the drifting cache.go:4368 line reference dropped.

Alternative considered

Deleting the transport-level subtest outright. Kept instead because it encodes a real, code-verified gap and is the ready-made failing test if anyone ever hits it — but deletion is defensible if you would rather not carry a permanently-skipped case. Happy to switch.

Test plan

  • task fmt, task lint (0 issues), task test — all green
  • TestAtticNarInfoURLWithoutCompressionExtension: content-level subtest PASS, transport-level SKIP (unchanged)

@kalbasit

kalbasit commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner Author

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 411c157c-39cf-4efa-98e3-5975198411ec

📥 Commits

Reviewing files that changed from the base of the PR and between 91c80c7 and 8b2b409.

📒 Files selected for processing (1)
  • pkg/cache/attic_narinfo_url_compression_test.go

Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Summary

Summary by CodeRabbit

  • Documentation

    • Clarified documentation around compression-resolution behavior.
    • Distinguished content-level and transport-level variants.
    • Expanded the explanation of the known gap for the transport-level variant.
  • Tests

    • Retained the existing skip behavior for the transport-level test.

Walkthrough

The pull request updates documentation in the attic narinfo URL compression test. It explains the fixed compression-resolution behavior, identifies the reported content-level zstd case, and documents the skipped transport-level zstd gap.

Changes

Compression test documentation

Layer / File(s) Summary
Clarify compression test behavior
pkg/cache/attic_narinfo_url_compression_test.go
The comments describe URL-extension parsing, declared compression handling, the content-level zstd issue, and the skipped transport-level zstd limitation.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 8b2b4

This updates test documentation for compression behavior and the known skipped transport-level case without changing production or test behavior. No current merge-readiness risk remains.

Poem

A rabbit reads the notes with care
Compression clues are written there
Content zstd now has its name
Transport waits outside the frame
The skipped test keeps watch tonight

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the comment-only documentation update for the attic test and relates directly to the main change.
Description check ✅ Passed The description accurately explains the stale comments, the transport-level zstd gap, the unchanged test behavior, and the completed validation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

The transport-level subtest's skip pointed at "follow-up change, see
#1470". Both references are now dead: #1470 is closed (the reporter was
on the content-level variant and v0.10.0-rc17 fixed them), and the
follow-up PR was deliberately dropped once that variant was ruled out
as their failure mode. A reader hitting the skip today is sent to a
closed issue and a PR that never existed, and cannot tell whether the
test is waiting on something in flight.

Restate it as what it actually is: a standing description of an open
gap with no fix planned. The gap itself is unchanged and still real —
upstream.GetNar always sends Accept-Encoding: zstd and blind-strips any
Content-Encoding: zstd, so an upstream applying zstd at the transport
level over an uncompressed body leaves ncps holding a raw NAR. The
comment now records why that is ncps-specific (ncps always advertises
zstd; nix's curl often is not built with it, so a proxy may compress
for ncps alone), that no real upstream has been observed doing it, and
exactly what would close it and let the skip be deleted.

The header comment had gone stale the same way: it described the
pre-fix behaviour in the present tense and cited a code comment that
the fix itself rewrote. Reworded to past tense, and the drifting
cache.go line number dropped.

Comments only; no test or production behaviour changes.

Co-Authored-By: Claude Opus 5 <[email protected]>
@kalbasit
kalbasit force-pushed the user/wnasreddine/ncps_issue_1470 branch from 8b2b409 to 395d773 Compare September 6, 2026 23:38
@kalbasit
kalbasit merged commit de9a02c into main Sep 6, 2026
39 checks passed
@kalbasit
kalbasit deleted the user/wnasreddine/ncps_issue_1470 branch September 6, 2026 23:55
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