feat: add new consolidated --print-graph flag [CSENG-181]#6706
Open
snyk-abedonik wants to merge 1 commit intofeat/CSENG-173_allow_incomplete_sbomfrom
Open
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This comment has been minimized.
This comment has been minimized.
5e47b2d to
eff54d7
Compare
This comment has been minimized.
This comment has been minimized.
eff54d7 to
ac72e3d
Compare
This comment has been minimized.
This comment has been minimized.
ac72e3d to
78de39c
Compare
PR Reviewer Guide 🔍
|
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.
Pull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
Introduces a new composable
--print-graphflag set that supersedes the legacy monolithic flags (--print-effective-graph,--print-effective-graph-with-errors). The old flags remain fully functional during the migration window.New flags:
--print-graph--effective-graph--jsonl-output--print-errorsThe core of the change is a new
getPrintGraphMode()function that acts as a single source of truth — it reads both new and legacy flags and returns a canonicalPrintGraphModestruct. All graph-printing paths across the codebase now derive their behavior from this struct.Where should the reviewer start?
Start with
getPrintGraphMode()and thePrintGraphModeinterface incommon.ts— everything else follows from there.How should this be manually tested?
1. Plain graph output (no regression):
snyk test --print-graph2. Legacy flags still work:
3. New flags produce equivalent output:
4. Unmanaged ecosystem (C/C++) with JSONL:
snyk test --unmanaged --print-graph --jsonl-outputWhat's the product update that needs to be communicated to CLI users?
A new composable
--print-graphflag family is now available. It replaces--print-effective-graphand--print-effective-graph-with-errorswith finer-grained controls (--effective-graph,--jsonl-output,--print-errors). Legacy flags remain supported.Risk assessment (Low | Medium | High)?
Low. The change is purely additive — no existing flags are removed. Legacy flags continue to work via a backward-compatible shim. Unit tests cover both old and new paths.
Any background context you want to provide?
The legacy flags coupled three orthogonal behaviors (graph mode, output format, error inclusion) into a single switch. CSENG-181 breaks these apart into composable primitives so that the SBOM extension and other consumers can request exactly the output shape they need.
What are the relevant tickets?
CSENG-181