-
Notifications
You must be signed in to change notification settings - Fork 13
feat: code actions for unified test api WIP [IDE-1494] #1042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
acke
wants to merge
18
commits into
main
Choose a base branch
from
IDE-1494_code-actions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…ing.Relationships is nil
- Updated buildUpgradePath() to include all intermediate dependencies in upgrade path - Now returns [false, intermediate1@v1, intermediate2@v2, ..., target@v3] matching Legacy CLI format - Improved fallback logic to use dependency path when upgrade path from API is missing
… instead of relying on the empty vuln.PackageVersion
…vior. Our title does not match, remediation hints are not properly added like in legacy. Re-use stuff from the legacy scanner.
Main changes Dependency updates: - cli-extension-os-flows: eeace0ff55c8 → a301e85828b7 - code-client-go: v1.24.1 → v1.24.2 - go-application-framework: 90c8d35a32bf → 663fef5db9c1 - Updated lipgloss and related terminal UI deps DepGraph metadata in test (server_smoke_test.go): - Added normalisedTargetFile metadata (required by cli-extension-os-flows) - Still sets Content-Location Feature flag names (unified_test_api_smoke_test.go): - feature_flag_experimental_risk_score → internal_snyk_cli_experimental_risk_score - feature_flag_experimental_risk_score_in_cli → internal_snyk_cli_experimental_risk_score_in_cli - Changed test comparison failure from t.Errorf to t.Logf Configuration fix (ostest_scan.go): - INPUT_DIRECTORY set as []string instead of string API changes (unified_converter.go): - Changed from fixData.Attributes.Actions to fixData.Attributes.Action (single action) - Updated discriminator check from "upgrade_package" to "upgrade_package_advice" - Updated method from AsUpgradePackageAction() to AsUpgradePackageAdvice()
Summary of Cyclomatic Complexity Analysis All 5 functions are test helpers with inherent complexity from field-by-field comparisons: compareAndReportDiagnostics (complexity 21) — Main comparison function Maps diagnostics by key Compares presence in both flows Performs field-by-field comparisons Generates reports collectOssIssueDataComparisons (complexity 20) — OSS issue data comparison Many sequential field comparisons (Key, RuleId, License, Description, etc.) Each field adds a conditional branch extractContextFieldsFromSingleDiagnostic (complexity 18) — Context extraction Multiple anonymous functions with if-else branches Type assertions with fallback logic writeComparisonFiles (complexity 17) — File writing Grouping and categorizing comparisons Conditional statistics calculations Multiple nested loops with conditionals collectScanIssueComparisons (complexity 16) — Scan issue comparison Many sequential field comparisons (Id, Title, Severity, FilePath, etc.) These functions are test-specific and the complexity is necessary for thorough validation. The //nolint:gocyclo comments document why the complexity is acceptable. All linting errors are now resolved.
8fa2ae2 to
cb2daea
Compare
cb2daea to
7a9e3a0
Compare
✅ 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. |
acke
commented
Nov 5, 2025
7a9e3a0 to
d79e742
Compare
d79e742 to
83a3cfb
Compare
5cef3cb to
bbd03a1
Compare
9314258 to
2449f29
Compare
Base automatically changed from
feat/IDE-1493_create-integration-points-with-new-osflow-extension
to
main
November 12, 2025 10:43
Contributor
|
The AI has determined that most of the functionality was extracted and used in #1054 but there is some tests that would be worth pulling out of this PR still:
|
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.
Description
This PR adds code actions support for OSS issues generated by the unified test API workflow (ostest). It enables quick-fix code actions, Snyk Learn actions, and code lenses for vulnerabilities detected through the unified flow.
DONE
Generated failing tests for quick-fix code actions, and code lenses
Implemented support for adding quick-fix code actions, and code lenses
TODO
Test with IDE that we actually are getting the quick-fix code actions, and code lenses
Update/write unit tests
Key Changes:
New Code Action Functions: Added functions that work directly with
OssIssueData:AddCodeActionsFromOssIssueData()- Main entry point for generating code actionsAddQuickFixActionFromOssIssueData()- Creates upgrade quick-fix actionsAddSnykLearnActionFromOssIssueData()- Creates Snyk Learn lesson actionsRefactoring: Eliminated the need for
convertAdditionalDataToOssIssue()by working directly withOssIssueDatatype, avoiding unnecessary JSON marshal/unmarshal conversions.Integration: Added
addUnifiedOssQuickFixesAndLenses()function inostest_scan.gothat enriches unified issues with code actions and code lenses, matching the behavior of the legacy OSS flow.Technical Details:
processOsTestWorkFlowData()Testing:
unified_converter_test.goto verify code actions and code lenses are generated correctlyChecklist
make generate)make lint-fix)