Skip to content

feat: parse legacy CLI stdout workflow.Data and convert to issues [IDE-1697]#1139

Draft
acke wants to merge 10 commits intomainfrom
IDE-1697
Draft

feat: parse legacy CLI stdout workflow.Data and convert to issues [IDE-1697]#1139
acke wants to merge 10 commits intomainfrom
IDE-1697

Conversation

@acke
Copy link
Contributor

@acke acke commented Feb 10, 2026

IDE-1697 – Legacy CLI flow for ostest

Changes

  • ostest_scan.go: In processOsTestWorkFlowData, branch on content_type.LEGACY_CLI_STDOUT; parse payload with UnmarshallOssJson and convertScanResultToIssues.
  • converter.go / oss_test.go: Support for legacy JSON parsing and tests.

Depends on

  • go-application-framework IDE-1697 (LEGACY_CLI_STDOUT + legacy_workflow).
  • cli-extension-os-flows IDE-1697 (emitting LEGACY_CLI_STDOUT data).

Made with Cursor

…issues

- Branch on content_type.LEGACY_CLI_STDOUT in processOsTestWorkFlowData.
- Parse payload with UnmarshallOssJson and convertScanResultToIssues.
- Update converter and oss tests for legacy JSON handling.

Co-authored-by: Cursor <cursoragent@cursor.com>
@snyk-io
Copy link

snyk-io bot commented Feb 10, 2026

⚠️ Snyk checks are incomplete.

Status Scanner Critical High Medium Low Total (0)
⚠️ Open Source Security 0 0 0 0 See details
⚠️ Licenses 0 0 0 0 See details
Code Security 0 0 0 0 0 issues

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

… type

- Match data.GetIdentifier() to legacycli/stdout type id.
- Content type remains application/json or text/plain from CLI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match legacycli/stdout data by Scheme, Host, and Path instead of
String() equality so payload is used regardless of url.URL formatting
(e.g. path with or without leading slash).

Co-authored-by: Cursor <cursoragent@cursor.com>
Data identifiers use Scheme "did" after workflow.NewData; type id "tpe" is overwritten.

Co-authored-by: Cursor <cursoragent@cursor.com>
@snyk-pr-review-bot
Copy link

PR Reviewer Guide 🔍

🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Error Handling

The processOsTestWorkFlowData function returns immediately upon encountering an error during conversion (line 139) or unmarshalling (line 159). If the scanOutput can contain multiple independent workflow.Data entries, this "fail-fast" approach might lead to loss of other valid scan results. Consider logging the errors and continuing to process other data entries, aggregating partial results for increased resilience, if that aligns with the intended behavior for mixed workflow.Data types.

	return nil, fmt.Errorf("couldn't convert test result to issues: %w", err)
}
Test Content Type

Line 519 changes the content type from a generic "application/json" to content_type.UFM_RESULT. While this aligns with the new branching logic in processOsTestWorkFlowData for Unified Findings Model results, ensure there is also a test case specifically for content_type.LEGACY_CLI_STDOUT data, as described in the PR description, to fully validate the new legacy parsing logic.

data := workflow.NewData(workflow.NewTypeIdentifier(workflow.NewWorkflowIdentifier("test"), "payload"), content_type.UFM_RESULT, []byte("{}"))
📚 Repository Context Analyzed

This review considered 23 relevant code sections from 12 files (average relevance: 0.88)

@bastiandoetsch bastiandoetsch marked this pull request as draft February 11, 2026 08:09
…Type

- Use content_type.LegacyCLIContentType for extension marker/payload
- Keep isLegacyCliStdoutData for type id legacycli/stdout (actual JSON)
- Skip empty payload before unmarshalling

Co-authored-by: Cursor <cursoragent@cursor.com>
…[IDE-1697]

- ProcessScanResults: take only ctx, scanOutput, packageIssueCache, readFiles;
  config, workDir, filePath, learnService, errorReporter from context
- processOsTestWorkFlowData: resolve c, workDir, filePath, learnService,
  errorReporter from context; use config.FormatMd
- unmarshallAndRetrieveAnalysis: drop workDir, path, format; use
  FilePathFromContext for error reporting
- ConvertJSONToIssues: build context with deps and workDir before calling
  ProcessScanResults
- convertScanResultToIssues: remove format param, use config.FormatMd;
  add TODO to remove format from toIssue

Co-authored-by: Cursor <cursoragent@cursor.com>
…-1697]

Use remote module versions instead of ../go-application-framework and
../cli-extension-os-flows; go.sum updated accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@acke acke changed the title feat(IDE-1697): parse legacy CLI stdout workflow.Data and convert to issues feat: parse legacy CLI stdout workflow.Data and convert to issues (IDE-1697) Feb 12, 2026
@acke acke changed the title feat: parse legacy CLI stdout workflow.Data and convert to issues (IDE-1697) feat: parse legacy CLI stdout workflow.Data and convert to issues [IDE-1697] Feb 12, 2026
… call [IDE-1697]

- Use content_type.LEGACY_CLI_STDOUT from go-application-framework (replace
  points to local GAF; use commit a6888bafc081 for that constant).
- Fix processOsTestWorkFlowData test call to pass 4 args (ctx, data, cache, readFiles).
- Resolve go.mod/go.sum merge conflicts; keep main's Snyk dependency versions.

Co-authored-by: Cursor <cursoragent@cursor.com>
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