fix: fcli aviator ssc audit: Reject --skip-if-exceeding-quota with --…#1019
fix: fcli aviator ssc audit: Reject --skip-if-exceeding-quota with --…#1019kireetivar wants to merge 2 commits into
Conversation
…folder-priority-order
…/kireetivar/option_bug
|
|
||
| import picocli.CommandLine; | ||
|
|
||
| public class AviatorSSCAuditCommandTest { |
There was a problem hiding this comment.
The fcli-app module currently only contains unit tests for asserting generic fcli characteristics, no module/command-specific tests. I think it would make more sense to move this test scenario to fcli-functional-test, using existing functional test infrastructure to expect an error when running this fcli command with invalid combination of options. Potentially, this would also allow you to test the same scenario on the bulkaudit.yaml action.
| @Option(names = {"--no-filterset"}) private boolean noFilterSet; | ||
| @Option(names = {"--folder"}, split = ",") @DisableTest(DisableTest.TestType.MULTI_OPT_PLURAL_NAME) private List<String> folderNames; | ||
| @Option(names = {"--skip-if-exceeding-quota"}) private boolean skipIfExceedingQuota; | ||
| @ArgGroup(exclusive = true, multiplicity = "0..1") private QuotaHandlingArgGroup quotaHandlingArgGroup = new QuotaHandlingArgGroup(); |
There was a problem hiding this comment.
Theoretically, this should be considered a breaking change as previous fcli versions allowed both options to be specified on a single invocation. If anyone has both options in some workflow/automation, this would now result in an error being reported instead of silently ignoring one of the options. As previous behavior was incorrect, I guess it's fine to classify this as a bug fix only though, not a breaking change.
This change prevents users from combining
--skip-if-exceeding-quotaand--folder-priority-orderonfcli aviator ssc auditThese options represent conflicting behaviors, so the command now fails fast with a clear validation error instead of skipping audit execution before folder prioritization can apply.The change also keeps the SSC bulk audit action aligned with the same validation and adds regression coverage for the direct command path.