chore: update flake inputs and fix new gosec findings#728
Merged
Conversation
Update nixpkgs (2026-03-09) and git-hooks (2026-03-07). Add ignore entries for GO-2026-4601 (url.Parse IPv6 host flaw; only caller parses user's own config, not attacker input) and GO-2026-4602 (os.ReadDir traversal via Root-constrained File; micasa uses plain os.ReadDir, never os.OpenRoot). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The flake update pulled a newer golangci-lint with new gosec rules: - G118: cancel stored in struct field, called later (not leaked) - G602: specs and natural slices have equal length by construction - G703: WriteFile paths are tmpDir + constant filename, not tainted Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use t.Cleanup(cancel) so the context is always cancelled at test end, replacing the nolint suppression. The extraction.go case genuinely cannot be restructured (cancel stored in struct, called on close). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files
🚀 New features to boost your workflow:
|
- G118: add t.Cleanup(cancel) to all test context.WithCancel calls so the cancel function is always invoked at test end - G602: nolint on table.go slice access where specs and natural have equal length by construction - G703: nolint on WriteFile calls where path is tmpDir + constant filename (no tainted components) - Keep nolint on extraction.go production code where cancel is stored in struct field and called on extraction close Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gosec reports issues on the opening line of multi-line expressions, so nolint comments must appear on or before that line — not on the closing paren where golines would place them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cpcloud
added a commit
that referenced
this pull request
Mar 19, 2026
## Summary - Update nixpkgs (2026-03-09) and git-hooks (2026-03-07) flake inputs - Add ignore entries for GO-2026-4601 (url.Parse IPv6 flaw; only caller parses user config) and GO-2026-4602 (os.ReadDir traversal via Root; micasa never uses os.OpenRoot) - Fix gosec G118 in all test files with `t.Cleanup(cancel)` instead of nolint; keep nolint in extraction.go where cancel is stored in struct field - Suppress false-positive gosec G602 (slice bounds proven equal by construction) and G703 (WriteFile paths use tmpDir + constant filenames) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
t.Cleanup(cancel)instead of nolint; keep nolint in extraction.go where cancel is stored in struct field