Repository navigation
CM-77192: Add Project/Diff/File scan scope - #103
Conversation
omer-roth
left a comment
There was a problem hiding this comment.
Reviewed for DRY / KISS / YAGNI / SOLID. Inline comments are tagged by severity: 1 Blocker, 5 High, 9 Medium. Low/nit items are left out.
The main ask (Blocker): split this PR into scan scope core, tool window UI polish and the editor tab setting. Several High/Medium items go away once the polish is out.
🤖 Generated with Claude Code
Add a scan scope selector (Project, Diff and File) to the Cycode tool window, ported from the VS Code extension (CM-73887). - Diff scans the changes between two revisions or a revision and the local directory (commit ranges use the merge base and full SHAs); IaC falls back to a full project scan; Diff needs a git repository and CLI 3.25.0 or later - File scans the file open in the editor - The scope is persisted per project, the revisions are session-only - Require Cycode CLI 3.25.0 (CM-72985) - Bump the foojay toolchain resolver to 1.0.0 for Gradle 9 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- DiffSide (Local or Rev) replaces the NUL-prefixed sentinel string, so the compiler enforces the local-directory special case - DiffRefsService owns the repository state, the selected sides and the cached revision lists; ScanScopeService keeps the scope and the dispatch - Rename GitRepository to GitCli so it does not clash with git4idea.repo.GitRepository Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
7d35691 to
c1308ae
Compare
…eck custom CLI version once Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…drop the refs cache Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
omer-roth
left a comment
There was a problem hiding this comment.
Approving at 70adef4. All DRY / KISS / YAGNI / SOLID threads are fixed, moved to #105, or tracked in CM-79606.
Before merging, please run one manual end-to-end check against CLI 3.25.0+ (the PR's Testing section says this hasn't been run yet). The unit tests check the arguments we build, not that the CLI accepts them or that the results show up:
- Diff, Local directory vs HEAD (
pre-commit --include-unstaged --base-ref ... --path ...): the findings appear in the tool window. - Diff, branch A vs branch B (
commit-history --commit-range <merge-base>..<tip>): only the changes in that range are reported. - File scope on an unsupported file type for SCA/IaC: the "not supported for the open file" notification is shown.
Please post the results here, or note any issue you find.
Summary
pre-commit --base-ref/--include-unstaged/--path(CM-72985).This PR was split after review. It now holds only the scan scope core. The follow-ups are separate PRs that build on this one:
Review changes included here:
DiffSideinstead of a sentinel string, aDiffRefsServicesplit out ofScanScopeService,GitRepositoryrenamed toGitCli, and no rewrite of the saved scope when the CLI is too old.Jira
CM-77192, related to CM-73887
Testing
./gradlew test): real temporary git repos for commit ranges and revision lists, the diff scan planner, argument builders, the planner refusals and file support rules.Not done
🤖 Generated with Claude Code