Skip to content

Conversation

@brew42
Copy link

@brew42 brew42 commented Dec 29, 2025

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?

Replace all registry calls to fetch feature flags with bulk calls to the feature flag gateway.

Adds a call to feature flag gateway api to fetch the 'show-maven-build-scope'
Pass this feature flag to the maven plugin -> Plugin call to feature flag gateway from src/lib/snyk-test/index.js and pass flags to src/lib/plugins/get-single-plugin-result.ts where the mvn plugin is invoked with feature flag.

Added Feature Flag Gateway server to cliv2 in order to fetch the feature flag for otel.

Where should the reviewer start?

Replace registry with feature flag gateway calls.
src/lib/snyk-test/index.ts
src/cli/commands/monitor/index.ts
src/cli/commands/fix/validate-fix-command-is-supported.ts
src/cli/commands/test/index.ts
src/cli/commands/test/iac/index.ts
src/cli/commands/iac/local-execution/process-results/share-results.ts
src/cli/commands/test/iac/local-execution/rules/rules.ts

src/lib/feature-flag-gateway/index.ts
Implement post call to feature flag gateway and added wrapper
Company id is fetched from config (getOrganizationId) and not from options.

src/lib/snyk-test/index.js
Call Feature Flag Gateway and set flag in featureFlags

src/lib/plugins/get-single-plugin-result.ts
Update to pass feature flag to maven plugin

cliv2/cmd/cliv2/main.go
Added call to feature flag gateway service to fetch the 'show-maven-build-scope' flag

cliv2/internal/feature-flag-gateway
Implement service to call the feature flag gateway evaluate api

How should this be manually tested?

Test all functionality to assess replacement of registry feature flag calls with feature flag gateway calls.

Run sbom generation for org with and without the show-maven-build-scope feature flag enabled in flipt.
cli/binary-releases/snyk-macos-arm64 sbom --format cyclonedx1.6+json --debug

Run sbom generation for user authenticated with group service account token. Confirm default organization is passed to feature flag call scope is generated as expected.
cli/binary-releases/snyk-macos-arm64 auth <token>

Flag enabled - sbom output contains scope

{
            "bom-ref": "2-com.jpmorgan.snykcode:moneta-commons@2.0.4",
            "type": "library",
            "group": "com.jpmorgan.snykcode",
            "name": "com.jpmorgan.snykcode:moneta-commons",
            "version": "2.0.4",
            "purl": "pkg:maven/com.jpmorgan.snykcode/moneta-commons@2.0.4",
            "properties": [
                {
                    "name": "snyk:maven:build_scope",
                    "value": "compile"
                }
            ]
        },

Flag disabled - sbom output does not contain scope

{
            "bom-ref": "2-com.jpmorgan.snykcode:moneta-commons@2.0.4",
            "type": "library",
            "group": "com.jpmorgan.snykcode",
            "name": "com.jpmorgan.snykcode:moneta-commons",
            "version": "2.0.4",
            "purl": "pkg:maven/com.jpmorgan.snykcode/moneta-commons@2.0.4",
            "properties": [
            ]
        },

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

Sbom generated output will contain maven scope information for those organizations with the 'show-maven-build-scope' feature flag enabled

@brew42 brew42 self-assigned this Dec 29, 2025
@brew42 brew42 requested review from a team as code owners December 29, 2025 17:14
@brew42 brew42 marked this pull request as draft December 29, 2025 17:14
@github-actions
Copy link
Contributor

github-actions bot commented Dec 29, 2025

Warnings
⚠️

Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style imports and exports to ES6 ones.
A file you've modified is using either module.exports or require(). If you can, please update them to ES6 import syntax and export syntax.
Files found:

  • src/cli/commands/test/index.ts
  • test/jest/unit/cli-commands/test-and-monitor.spec.ts
  • test/jest/unit/lib/commands/fix/fix.spec.ts
  • test/tap/auth.test.ts
  • test/tap/cli.test.ts
  • test/tap/docker-token.test.ts
  • test/tap/monitor-target.test.ts
  • test/tap/run-test.test.ts
  • test/tap/severity-threshold.test.ts

Generated by 🚫 dangerJS against f565256

@brew42 brew42 force-pushed the feature/CSENG_99_ReplaceRegistryFlagCalls branch 3 times, most recently from c00a7dd to 0ac439c Compare December 31, 2025 12:31
@brew42 brew42 marked this pull request as ready for review December 31, 2025 12:42
return process.env.SNYK_INTERNAL_ORGID;
}

if (process.env.SNYK_CFG_INTERNAL_ORGID) {
Copy link
Author

Choose a reason for hiding this comment

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

Work around in order to pass default organization id in for acceptance tests!

chore:[CSENG-68] correct ffg path in fake server

chore:[CSENG-68] update ffg hidden end point

chore: [CSENG-68] plug in ffg call

chore: [CSENG-68] update package

chore: [CSENG-68] correct org

chore: code tidy for CSENG-68

chore: update to use makeRequest

chore: update tap tests [CSENG-68]

chore: remove status check for CSENG-68

chore: implement ffg for otel [CSENG-68]

chore: correct go mod [CSENG-68]

chore: revert to standard http client lib [CSENG-68]

chore: correct ffg unit test [CSENG-68]

chore: lint service [CSENG-68]

chore: replace all registry flag calls with ffg [CSENG-99]

chore: update unit tests

chore: update acceptance tests for snyk-test

chore: update logic for snyk monitor

chore: add ffg to fix command

chore: remove feature flags

chore: update fake server

chore: update acceptance tests with org

chore: check ff before setting options

chore: check ff before setting options

chore: update iac to use public org id

chore: update acceptance tests

chore: update acceptance tests

chore: set org for acceptance tests

chore: set hidden api url

chore: update acceptance

chore: update acceptance tests
@brew42 brew42 force-pushed the feature/CSENG_99_ReplaceRegistryFlagCalls branch from 0ac439c to f565256 Compare December 31, 2025 13:04
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