Fix CI breakage with click 8.5.0: declare explicit default for --only-findings - #5292
Merged
AyanSinhaMahapatra merged 1 commit intoAug 27, 2026
Conversation
click 8.5.0 (released 2026-08-26) exposes Sentinel.UNSET as the .default of options declared without an explicit default, and that sentinel is truthy. run_scan() collects raw option defaults, so every function-API scan silently enabled the only-findings output filter and dropped findingless resources: the directory entry disappeared from results and test_can_call_run_scan_as_a_function fails with 'assert 1 == 2' in all the *_latest_from_pip CI jobs since then. --only-findings was the only option in the codebase declared without an explicit default. Declaring default=False restores the previous behavior on click 8.5 and is a no-op on older versions. Signed-off-by: Manoj Gowda <manojgowdabs18@gmail.com>
AyanSinhaMahapatra
approved these changes
Aug 27, 2026
AyanSinhaMahapatra
left a comment
Member
There was a problem hiding this comment.
Thanks @MGpromax LGTM!
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.
All the
*_latest_from_pipCI jobs fail since 2026-08-26 on every PR (e.g. this PR's runs and #5271's) with:Root cause: click 8.5.0 (released 2026-08-26 13:33 UTC, right when the failures started) exposes
Sentinel.UNSETas the.defaultof options declared without an explicit default -- and that sentinel is truthy.run_scan()builds its option set from raw.defaultvalues ({clio.name: clio.default for clio in plugin_options}), soonly_findingsbecame truthy, the only-findings output filter silently activated on every function-API scan, and findingless resources (the directory entry in the test) were dropped from the results. The CLI path is unaffected because click resolves the sentinel at parse time.Bisected by installing the repo with latest deps (fails), downgrading only click to 8.4.2 (passes), and re-upgrading to 8.5.0 (fails again). An audit of all plugin options shows
--only-findingswas the only one declared without an explicit default, so declaringdefault=Falseis the complete fix; it is a no-op on older click versions (verified: the test and the only-findings plugin tests pass on both click 8.4.2 and 8.5.0 locally).Tasks