Skip to content

feat: upload file content to file upload api - #165

Open
florinMiro wants to merge 4 commits into
mainfrom
feat/WR-1220/upload_file_content_to_file-upload-api
Open

feat: upload file content to file upload api#165
florinMiro wants to merge 4 commits into
mainfrom
feat/WR-1220/upload_file_content_to_file-upload-api

Conversation

@florinMiro

@florinMiro florinMiro commented Jul 23, 2026

Copy link
Copy Markdown

Integrate with the FUA client from GAF and use FUA to upload and execute the analysis.

This PR relies on a small change in GAF, which I'm in the processing of getting ready to merge:
snyk/go-application-framework#666

I've successfully tested these changes with a local build of the CLI.
Interaction id logs

What I will address before merging this PR:

  • Bugs in core production logic
  • Gaps in test coverage.
  • PR feedback

What I will address in a follow-up PR:

  • monitoring, and observability improvements for CLI logs as well as CLI analytics.

@snyk-io

snyk-io Bot commented Jul 23, 2026

Copy link
Copy Markdown

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
Secrets 0 0 0 0 0 issues

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

@snyk-io

snyk-io Bot commented Jul 23, 2026

Copy link
Copy Markdown

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.

@CLAassistant

CLAassistant commented Jul 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@florinMiro
florinMiro force-pushed the feat/WR-1220/upload_file_content_to_file-upload-api branch from 2f6f8c5 to b6c1827 Compare July 23, 2026 14:35
}
}

func WithInputUploadRevision(id string, localFilePath string, repoUrl *string) CreateTestOption {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Compared to WithInputBundle we can't set the branch, commit_id, or limit_test_to_files properties based on the spec.

I know that limit_test_to_files is used only for IDE analyses, but I'm not sure about the other 2 properties.

This is something I need to check with code-owners

@florinMiro florinMiro changed the title chore: extract file filtering logic outside of bundle manager feat: upload file content to file upload api Jul 24, 2026
@florinMiro
florinMiro force-pushed the feat/WR-1220/upload_file_content_to_file-upload-api branch 3 times, most recently from e33a7bf to 5423778 Compare July 24, 2026 14:28
@github-actions github-actions Bot added feature and removed feature labels Jul 24, 2026
@florinMiro
florinMiro force-pushed the feat/WR-1220/upload_file_content_to_file-upload-api branch from d81f57d to 743c6ad Compare July 27, 2026 10:54
Comment thread scan.go
)
scanner.analysisOrchestrator = analysisOrchestrator

orgID := uuid.MustParse(scanner.config.Organization())

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Question to clarify with code integrations.

Is it safe to use mustParse here? The testService client already uses must parse to convert the orgId string to a UUID.

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.

This is safe.

The exploration test shows --org=<invalid uuid> gets ignored by the CLI. User experience will default to the user's default org.

@florinMiro
florinMiro force-pushed the feat/WR-1220/upload_file_content_to_file-upload-api branch from 743c6ad to 9c0db59 Compare July 27, 2026 11:11
@florinMiro
florinMiro marked this pull request as ready for review July 27, 2026 12:01
@florinMiro
florinMiro requested a review from a team as a code owner July 27, 2026 12:01
@snyk-pr-review-bot

Copy link
Copy Markdown

PR Reviewer Guide 🔍

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

Silently Skipping Files 🟡 [minor]

In IsFileSupported, if os.Stat(path) fails (e.g., due to a temporary permission error), the function logs the error but returns false, nil. This results in the file being silently excluded from the scan. It would be safer to return the error so the caller can decide whether to abort or skip, ensuring the user is aware of why specific files might be missing from the results.

if fileErr != nil {
	s.logger.Error().Err(fileErr).Str("filePath", path).Msg("Failed to read file info")
	return false, nil
}
📚 Repository Context Analyzed

This review considered 45 relevant code sections from 15 files (average relevance: 1.00)

🤖 Repository instructions applied (from AGENTS.md)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants