Skip to content

refactor: remove the unused CalculateChecksum and GzipDecompress helpers - #93

Merged
bketelsen merged 2 commits into
mainfrom
groom/remove-dead-helpers
Nov 11, 2026
Merged

bketelsen merged 2 commits into
mainfrom
groom/remove-dead-helpers

Conversation

@frostyard-machines

Copy link
Copy Markdown

What changed and why

Removes 2 exported helpers in internal/utils that have no caller in the module or in its tests:

  • CalculateChecksum(data []byte, hashType string) in internal/utils/checksum.go (and its now unused hash import). Every generator uses the single-pass CalculateChecksums(path).
  • GzipDecompress(data []byte) in internal/utils/compression.go (and its now unused io import). The generators use GzipCompress only; the Debian index reader has its own streaming readGzipFile.

go run golang.org/x/tools/cmd/deadcode@latest -test ./... reported both as unreachable at the base. internal/utils is internal, so no code outside this module can import them.

No change in behavior

Only unreachable code is removed. No test is deleted or changed (no test called either helper).

Evidence

  • Base 86a7607: make check exit 0.
  • Head f11c579: make build and make check exit 0 (15 packages ok, test cache cleaned first).
  • deadcode -test ./... at the head lists only GenerateReleaseFile (see below).

Left out on purpose

  • GenerateReleaseFile in internal/generator/deb/release.go is also unreachable, but that file is a risk path (.github/risk-paths.json: Release and InRelease signing), so a grooming PR does not touch it.
  • No risk path is touched by this PR.

Neither helper has a caller in the module or in its tests: deadcode
-test ./... reports both as unreachable. The generators use
CalculateChecksums (single pass) and GzipCompress only.
@github-actions github-actions Bot added the level:L3 Skim label Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@frostyard-machines

Copy link
Copy Markdown
Author

Cross-review (grooming, no change in behavior): Ready, Blocking: none.

  • Reviewer: openai/gpt-6.1-sol. Coder: anthropic/claude-opus-5-5.
  • Base 86a7607b44b462853560e89c52b9d88497662ea4, reviewed head f158ebdd48d0d16a6ab1a00dc22519b24c7211cd (initial review at f11c579 + 1 re-review).
  • Initial findings: (1) removal of exported names; withdrawn at re-review: the package is internal, the module has 1 go.mod, no caller exists, and the grooming policy names unused exports as a target. (2) stale line in docs/design/overview.md; fixed in f158ebd.
  • Revert test: exempt (pure refactor: dead-code removal with no new behavior; the proof is the unchanged tests green on base and head).
  • Checks: make check exit 0 at base and head; CI make ci green at f158ebd.

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 11, 2026
@bketelsen
bketelsen added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit f986e3f Nov 11, 2026
4 checks passed
@frostyard-machines
frostyard-machines deleted the groom/remove-dead-helpers branch November 13, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L3 Skim ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants