Skip to content

chore: adding a central check for the experimental flag - #6056

Merged
PeterSchafer merged 1 commit into
mainfrom
chore/global_experimental
Jul 22, 2025
Merged

chore: adding a central check for the experimental flag#6056
PeterSchafer merged 1 commit into
mainfrom
chore/global_experimental

Conversation

@PeterSchafer

Copy link
Copy Markdown
Contributor

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?

This PR is based on newly introduced helper functions to ensure experimental workflows are handled consistently.
It also moves the responsibility to raise an error from the workflows themselves to the application layer, which is more correct from the perspective of concerns as an error might not be the correct behaviour for every application.
Some existing tests had to be adapted to not expected an explicit text but rather ensure that the cli fails.

Where should the reviewer start?

snyk/go-application-framework#386

How should this be manually tested?

Running the following commands should behave the same and show the following error

image

Errors (SNYK-CLI-0015)

snyk whoami
snyk sbom test
snyk tools connectivity-check

No or other Errors

snyk whoami --experimental
snyk sbom test  --experimental
snyk tools connectivity-check  --experimental

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

@PeterSchafer
PeterSchafer requested a review from a team as a code owner July 21, 2025 09:12
@snyk-io

snyk-io Bot commented Jul 21, 2025

Copy link
Copy Markdown

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

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

@PeterSchafer
PeterSchafer force-pushed the chore/global_experimental branch from 66a1a34 to 0fa86c0 Compare July 21, 2025 09:13

@bsalomon-snyk bsalomon-snyk left a comment

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.

looks good to me

@PeterSchafer
PeterSchafer force-pushed the chore/global_experimental branch from 0fa86c0 to 8b74482 Compare July 21, 2025 17:04
@PeterSchafer
PeterSchafer force-pushed the chore/global_experimental branch from 8b74482 to b8cf2a6 Compare July 21, 2025 19:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Connectivity Check Workflow Visibility Issue

The removal of the initConnectivityCheck wrapper function, replaced by a direct call to workflows.InitConnectivityCheckWorkflow, eliminates the explicit SetVisibility(true) call for the "tools.connectivity-check" workflow. Consequently, the snyk tools connectivity-check command becomes hidden and inaccessible, preventing its use even with the --experimental flag, as the centralized experimental flag check cannot operate on an invisible workflow.

cliv2/cmd/cliv2/main.go#L562-L563

cli/cliv2/cmd/cliv2/main.go

Lines 562 to 563 in b8cf2a6

globalEngine.AddExtensionInitializer(container.Init)
globalEngine.AddExtensionInitializer(workflows.InitConnectivityCheckWorkflow)

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@PeterSchafer
PeterSchafer enabled auto-merge July 21, 2025 20:11
@PeterSchafer

Copy link
Copy Markdown
Contributor Author

as the centralized experimental flag check cannot operate on an invisible workflow.

This is just not correct. Sorry. Workflows are visible by default!

@PeterSchafer
PeterSchafer merged commit 64cecf9 into main Jul 22, 2025
9 checks passed
@PeterSchafer
PeterSchafer deleted the chore/global_experimental branch July 22, 2025 07:12
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.

3 participants