Repository navigation
Validate --report-format values before scan create(AST-182795) - #1636
Open
cx-sumit-morchhale wants to merge 2 commits into
Open
cx-sumit-morchhale wants to merge 2 commits into
cx-sumit-morchhale wants to merge 2 commits into
Conversation
Reject unsupported --report-format values early in `results show` and `scan create`, before any API call or scan submission. - Add printer.ValidateReportFormats, which uses the same comma split and case-insensitive matching as CreateScanReport. - Call it at the top of runGetResultCommand, after the scan-ID check. - Call it at the start of the scan create run function. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
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.
Summary
printer.ValidateReportFormats, which checks comma-separated--report-formatvalues using the same split and case-insensitive matching asCreateScanReport.cx results show: validates after the scan-ID check and beforeGetByID, so a bad value makes no API call.cx scan create: validates invalidateCreateScanFlags. Known gap: this runs aftervalidateScanTypes, which still calls the token and feature-flag APIs before the format is rejected.Known issues
Invalid report format <x>. Supported formats are: .... Previously it wasbad report format <x>.TestRunGetResultsByScanIdWrongFormatwas changed to check thebad report formatprefix, so it fails against this text. Needs a decision before merge.scan createcheck is at the start of the run function. It is invalidateCreateScanFlags(see the Summary).scan createcheck in this PR../internal/commands/...run did not pass. It hit the 25-minute timeout, and several environment-dependent tests failed:ScaResolvernot found, no container engine for KICS realtime, Windows permission tests, ASCA installer, and SCA realtime. Not yet checked against the base branch.Test plan
TestRunGetResultsByScanIdWrongFormatpass.results show --report-format abcfails before any API request.scan create --report-format abcfails, and check whether API requests happen first.scan create --async.🤖 Generated with Claude Code