Repository navigation
chore: remove dead code found by the 2026-07-11 audit (#286-292) - #330
Merged
Merged
Conversation
Deletes code with zero callers anywhere in the repo (verified across the main module, cmd/spored, cmd/orchestrator, and all lambda modules) plus the tests that only covered the removed code. No user-facing change. - pkg/streaming: unused TCP/gRPC/ZMQ transport library (#286) - pkg/instance: unused wildcard/pattern helpers (#287) - pkg/audit/context.go: 7 unused context helpers (#288) - pkg/dns: DecodeAccountID/GetAccountSubdomain/ParseDNSName + deprecated package-level GetFQDN (kept the live Client.GetFQDN method) (#289) - pkg/queue: DependenciesMet/GetReadyJobs (topo-sort path stays) (#291) - cmd: waitForDCV/getTagValue/formatTTLDuration (#292) - one unused alerts constructor (NewClientWithEncryption) + one unused scheduler method (UpdateScheduleMetadata) (#290, partial) Scope notes vs the findings (verified on the live tree): - #286: kept examples/streaming/ — the pipeline still advertises a "network streaming" feature (cmd/pipeline.go, pkg/pipeline peer discovery), so the demo dir is out of scope for a dead-code sweep. - #290: only 2 of the 7 named funcs had zero references. The rest (scheduler NewClientWithTableName/RecordExecution, alerts NewClientWithTableNames/GetAlert/RecordAlertHistory) are live test infrastructure — RecordExecution seeds the test for the live GetExecutionHistory — so removing them would strip real coverage. Left them; will re-scope #290 accordingly.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Jul 11, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #286, #287, #288, #289, #291, #292. Partially addresses #290 (see below). Part of the audit tracker #328 (Phase 0).
Deletes code with zero callers anywhere in the repo — verified across the main module,
cmd/spored,cmd/orchestrator, and all 12 lambda go-modules — plus the tests that only covered the removed code. No user-facing behavior change. ~2.4k lines removed.Removed
pkg/streaming— unused TCP/gRPC/ZMQ transport librarypkg/instance— unused wildcard/pattern helperspkg/audit/context.go— 7 unused context helpers (+ 4 orphaned tests; kept the test-coveredSetUserID/SetCorrelationID/GetCorrelationIDin logger.go)pkg/dns—DecodeAccountID/GetAccountSubdomain/ParseDNSName+ deprecated package-levelGetFQDN(kept liveEncodeAccountID/GetFullDNSName/Client.GetFQDN)pkg/queue—DependenciesMet/GetReadyJobs(the live topo-sort path stays)cmd—waitForDCV/getTagValue/formatTTLDuration(+ orphaned tests, stranded imports cleaned)alerts.NewClientWithEncryption+scheduler.UpdateScheduleMetadataScope deviations (verified against the live tree, not the finding text)
examples/streaming/— the pipeline still advertises a "network streaming" feature (cmd/pipeline.go,pkg/pipelinepeer discovery), so the demo dir is a separate concern, out of scope for a dead-code sweep.scheduler.NewClientWithTableName/RecordExecution,alerts.NewClientWithTableNames/GetAlert/RecordAlertHistory) are live test infrastructure — e.g.RecordExecutionseeds the test for the liveGetExecutionHistory. Deleting them would strip real coverage of live code. Left them; will re-scope [audit] Dead code: delete unused alt-constructors/methods in pkg/scheduler + pkg/alerts #290 to just the 2 removed here.Verification
go build ./...+go vet ./cmd ./pkg/...clean.go testgreen for all affected packages (pkg/dnspkg/auditpkg/schedulerpkg/alertspkg/queuecmd). Pre-existing unrelated failureTestCatalogValid(feat(plugin): permissions declaration block (#388) #392) fails onmaintoo.CHANGELOG updated under Removed.