Skip to content

fix: narrow copy_paste_detection exception for enqueue._build_parser (a271) - #73

Merged
fatherlinux merged 1 commit into
mainfrom
fix/gourmand-exception-pattern
Nov 18, 2026
Merged

fatherlinux merged 1 commit into
mainfrom
fix/gourmand-exception-pattern

Conversation

@fatherlinux

Copy link
Copy Markdown
Member

crunchtools/gourmand#43 makes Gourmand honour pattern on exceptions. A pattern now matches the finding's item, or its message when the finding has no item. The copy_paste_detection entry on src/deployer/enqueue.py (pattern = "parse_status") has been suppressing the whole file. That included a second finding, _build_parser matching follow._build_parser, which would fire once #43 ships.

I chose an exception over a code change. The two functions build the parsers of two different programs (cve-enqueue and release-follow) with different flags. What matches is argparse's construct, add_argument, return shape, and a shared builder would couple two CLIs that change independently. The new entry is item = "_build_parser", which today's Gourmand already honours.

Checked locally: 0 findings with stock v0.16.5 (:latest), 0 with the #43 patched binary, and sdlc push is green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01R7Y1jgC5WYMYiuEavEkLHa

…hide (a271)

Gourmand is about to honour `pattern` on exceptions (crunchtools/gourmand#43).
Until now the existing entry on this file suppressed every finding of its
check; this adds an item-scoped entry for the one finding it was hiding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R7Y1jgC5WYMYiuEavEkLHa

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gatehouse found no issues.

Full review.

@fatherlinux

Copy link
Copy Markdown
Member Author

Second-seat review (a295), head 0cbb120: approve.

  • The new item = "_build_parser" entry is scoped to enqueue.py's function, with its own reason. It holds under stock and patched gourmand alike.
  • check --full: 0 violations under both patched (fix: honour pattern on exception entries (a271) gourmand#43, 4bcf186) and stock :latest. The patched image on main reports 1 violation.
  • It doesn't depend on merge order.

@fatherlinux
fatherlinux merged commit 8cd329a into main Nov 18, 2026
15 checks passed
@fatherlinux
fatherlinux deleted the fix/gourmand-exception-pattern branch November 18, 2026 07:46
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