CLI-973 Add dependency risks global hook - #759
Conversation
✅ Deploy Preview for sonarqube-cli canceled.
|
tomshafir-sonarsource
left a comment
There was a problem hiding this comment.
Looks good! Left a few small comments.
5531c07 to
873998b
Compare
Building on #715's (CLI-970) dynamic project-key resolution, drop the InvalidOptionError thrown when --dependency-risks resolves no project key. The existing "only run the SCA stage when a key resolved" gate already did the right thing once the throw is gone — the secrets stage and the commit itself are unaffected by a dependency-risks resolution miss, consistent with this hook's other fallback paths. Adds a user-facing skip notice matching the style of the sibling sca-scanner-missing message.
…itionally, update messages
Defer the "no project key resolved" warning until after the manifest-changed/binary-installed check, so it only fires when a dependency-risks scan would actually have run. Fix a stale comment still describing --dependency-risks as opt-in, and correct the CLAUDE.md paragraph that contradicted itself on prompt behavior. Add coverage for declining the dependency-risks prompt and for the reordered warning.
A test added on this branch predates the master-side migration to ctx.console and was left referencing the removed getMockUiCalls() global mock when rebased onto it. Switch it to the FakeConsole instance the rest of the file already uses.
873998b to
aa59f23
Compare
Code Review ✅ Approved 6 resolved / 6 findingsEnables global dependency risks git hook with graceful project resolution and prompts for opt-in during setup. Resolved issues include contradictory documentation on opt-out behavior, untested decline path and success path for lazy project discovery, generated docs still advertising removed command, and test ambient state leakage. No issues remain open. ✅ 6 resolved✅ Quality: CLAUDE.md paragraph contradicts itself on dep-risks opt-out
✅ Quality: Decline path for the new dep-risks prompt is untested
✅ Quality: Generated docs still advertise removed
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|



Summary by Gitar
This will update automatically on new commits.