Skip to content

feat: enable json and sarif output formats for secrets [PS-588]#6803

Merged
CatalinSnyk merged 1 commit into
mainfrom
chore/PS-588/enable-secrets-acceptance-tests-in-prod
May 20, 2026
Merged

feat: enable json and sarif output formats for secrets [PS-588]#6803
CatalinSnyk merged 1 commit into
mainfrom
chore/PS-588/enable-secrets-acceptance-tests-in-prod

Conversation

@alexandru-manea-snyk
Copy link
Copy Markdown
Contributor

@alexandru-manea-snyk alexandru-manea-snyk commented May 13, 2026

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages are release-note ready, emphasizing what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)
  • Includes product update to be announced in the next stable release notes

What does this PR do?

Bumps cli-extension-secrets to a version that ships JSON and SARIF output for snyk secrets test, and turns on the acceptance tests that were previously skipped while those outputs were in progress.

  • Test activation: Un-skips and runs --sarif, --sarif-file-output, and --json format tests.
  • Bug fix: Fixed a false-positive in the cross-CWD identity test (corrected a broken property lookup from fingerprint to identity).
  • Test refactor: Replaced the complex "SARIF with ignores" test with a focused payload validation test (should generate a well-formed SARIF payload).
  • Scope cleanup: Removed the setupIsolatedIgnoreEnv helper and its assertions; testing ignore behavior is intentionally excluded from the acceptance suite.

Where should the reviewer start?

How should this be manually tested?

  1. Build the CLI from this branch.
  2. Clone https://github.com/leaktk/fake-leaks at 366ae0080cc67973619584080fc85734ba2658b2.
  3. Run ./snyk secrets test <repo> --sarif and confirm a valid SARIF payload (results have fingerprints.identity, multi-location grouping is present).
  4. Same with --json and --sarif-file-output=out.json.
  5. Run the acceptance suite:
    TEST_SNYK_COMMAND=<path to built binary> \
      npx jest --maxWorkers=1 \
      --testPathPattern snyk-secrets-test-user-journey
    
    Expected: 23 passed, 0 skipped (should enrich SARIF with suppressions when ignores exist).

What's the product update that needs to be communicated to CLI users?

N/A

Risk assessment (Low | Medium | High)?

Low — this PR only enables acceptance coverage for already-shipping behavior.

Any background context you want to provide?

What are the relevant tickets?

Screenshots (if appropriate)

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented May 13, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch 3 times, most recently from b50d89f to 4cb25b7 Compare May 13, 2026 14:57
@alexandru-manea-snyk alexandru-manea-snyk marked this pull request as ready for review May 14, 2026 13:21
@alexandru-manea-snyk alexandru-manea-snyk requested review from a team as code owners May 14, 2026 13:21
@snyk-pr-review-bot

This comment has been minimized.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch from 4cb25b7 to d9155f8 Compare May 18, 2026 13:31
@snyk-pr-review-bot

This comment has been minimized.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch from d9155f8 to 82bb316 Compare May 19, 2026 07:10
@snyk-pr-review-bot

This comment has been minimized.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch 2 times, most recently from d09940d to 54da15a Compare May 19, 2026 10:54
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch from 54da15a to e80fc79 Compare May 19, 2026 11:53
@snyk-pr-review-bot

This comment has been minimized.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch 2 times, most recently from 43d45fe to 202561b Compare May 19, 2026 13:09
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch from 202561b to 2b3822d Compare May 19, 2026 13:28
@snyk-pr-review-bot

This comment has been minimized.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch from 2b3822d to 1bd8178 Compare May 19, 2026 13:37
@snyk-pr-review-bot

This comment has been minimized.

Comment thread cliv2/go.sum Outdated
}
});
// TODO: Re-enable once SARIF and JSON WIP outputs are finalized [PS-533]
it.skip('should correctly render multiple ignores and their metadata in the output', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: I think for this ones we can just follow what we did for code: we import the project into the testing org and have 2-3 ignored issues that we expect for our tests. We can tackle this as a follow up

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay, I will log a follow-up ticket for this, thank you.

@alexandru-manea-snyk alexandru-manea-snyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch from 1bd8178 to 3b4f143 Compare May 19, 2026 13:50
@snyk-pr-review-bot

This comment has been minimized.

@andreeaneata andreeaneata changed the title chore: enable secrets acceptance tests in prod [PS-588] feat: enable json and sarif output formats for secrets [PS-588] May 19, 2026
@CatalinSnyk CatalinSnyk enabled auto-merge May 19, 2026 13:52
@andreeaneata andreeaneata force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch from 3b4f143 to b308844 Compare May 19, 2026 13:53
@snyk-pr-review-bot

This comment has been minimized.

@CatalinSnyk CatalinSnyk force-pushed the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch from b308844 to f44b091 Compare May 19, 2026 14:29
@snyk-pr-review-bot
Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected
📚 Repository Context Analyzed

This review considered 6 relevant code sections from 4 files (average relevance: 1.00)

@CatalinSnyk CatalinSnyk mentioned this pull request May 19, 2026
9 tasks
@CatalinSnyk CatalinSnyk merged commit 9d34f6e into main May 20, 2026
9 checks passed
@CatalinSnyk CatalinSnyk deleted the chore/PS-588/enable-secrets-acceptance-tests-in-prod branch May 20, 2026 07:27
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.

2 participants