Skip to content

docs(cli): document --project-tags for snyk code test#6879

Open
apzuk3 wants to merge 2 commits into
mainfrom
docs/code-test-project-tags
Open

docs(cli): document --project-tags for snyk code test#6879
apzuk3 wants to merge 2 commits into
mainfrom
docs/code-test-project-tags

Conversation

@apzuk3
Copy link
Copy Markdown
Contributor

@apzuk3 apzuk3 commented Jun 4, 2026

What does this PR do?

Adds a --project-tags option section to the snyk code test help documentation in cli/help/cli-commands/code-test.md, matching the wording and structure already used in iac-test.md, monitor.md, and container-monitor.md.

The flag is implemented in code-client-go and wired into the Code workflow (code-client-go/pkg/code/code.go registers --project-tags, internal/commands/code_workflow/native_workflow.go calls GenerateProjectTags and forwards them via codeclient.WithProjectTags), but was not yet surfaced in snyk code test --help or the CLI command docs.

snyk code test --help is rendered directly from this markdown by cli/src/cli/commands/help/index.ts, so no source code changes are required here.

Where should the reviewer start?

  • cli/help/cli-commands/code-test.md - the new ### --project-tags=<TAG>[,<TAG>]... section, placed between --target-reference and --remote-repo-url to sit with the other project metadata / report options.
  • Wording mirrors cli/help/cli-commands/iac-test.md (which already documents this flag with --report).

How should this be manually tested?

make build
./binary-releases/snyk-macos-arm64 code test --help | grep -A 10 'project-tags'

Expected: the new section appears, with the example --project-tags=department=finance,team=alpha and the clear-by-empty-value note.

Functional behaviour of the flag is covered by existing tests in code-client-go:

  • code-client-go/internal/commands/code_workflow/project_tags_test.go - parsing / validation of the flag value
  • code-client-go/internal/analysis/analysis_test.go::TestAnalysis_RunTest_WithProjectTags - tags forwarded to the test API

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

None for this PR specifically - this only documents an already-implemented flag. The product-facing announcement belongs with the PR that added --project-tags support to snyk code test.

Risk assessment

Low - markdown-only change, no code paths affected, prettier passes, no test or behaviour changes.

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)
  • Highlights breaking API changes (if applicable) - N/A, no API changes
  • Links to automated tests covering new functionality - N/A for this PR (docs only); existing tests in code-client-go linked under "How should this be manually tested?"
  • Includes manual testing instructions
  • Updates relevant GitBook documentation (PR link: docs(cli): document --project-tags for snyk code test user-docs#1311) - the CLI help files are synced from snyk/user-docs weekly via sync-cli-help-to-user-docs.yml. Without the companion user-docs PR, this change would be reverted by the next sync.
  • Includes product update to be announced in the next stable release notes - N/A for this PR (docs only); the product announcement belongs with the PR that added --project-tags support to Code.

Adds a `--project-tags` option section to the `snyk code test`
help documentation in help/cli-commands/code-test.md, matching the
wording and structure already used in iac-test.md, monitor.md, and
container-monitor.md.

The flag is implemented in code-client-go and is wired into the
Code workflow, but was not yet surfaced in `snyk code test --help`
or the CLI command docs. Help is rendered directly from this
markdown file, so no other source changes are required.
@apzuk3 apzuk3 requested a review from a team as a code owner June 4, 2026 13:08
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Jun 4, 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Warnings
⚠️

Please make changes to snyk help text in Gitbook. Changes will be automatically synchronised to Snyk CLI as a scheduled PR.
For more information, see: help/README.md.

⚠️ There are multiple commits on your branch, please squash them locally before merging!

Generated by 🚫 dangerJS against 6082839

@snyk-pr-review-bot

This comment has been minimized.

@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: 0.83)

🤖 Repository instructions applied (from AGENTS.md)

@CatalinSnyk
Copy link
Copy Markdown
Contributor

Hey @apzuk3, as mentioned here and here, documentation updates are done through GitBook.

We then sync the contents from the public documentation through a GitHub Action.

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