Log error and only enable code-scanning if multiple analysis kinds are specified - #3892
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens handling of the experimental analysis-kinds input by disallowing multiple enabled analysis kinds in normal (non-test) runs, with an escape hatch via a new feature flag for internal/testing environments. This reduces maintenance burden ahead of planned removal of multi-kind support.
Changes:
- Pass
featuresintogetAnalysisKindsfrominit-actionso multi-kind gating can consult feature enablement. - Introduce
Feature.AllowMultipleAnalysisKinds(defaultfalse) to allow multi-kind runs only when explicitly enabled. - Update
getAnalysisKindsto throw aConfigurationErrorwhen multiple analysis kinds are enabled outside test mode, plus add/adjust unit tests.
Show a summary per file
Copilot's findings
- Files reviewed: 5/17 changed files
- Comments generated: 2
henrymercer
left a comment
There was a problem hiding this comment.
How about instead treating multiple inputs as just code-scanning instead? If we want to make it an error, I'd suggest we allow a month's deprecation period and in the meantime logging a warning that this will be treated as an error in June? I agree this was marked as an internal input in the action.yml but I don't think we can rely on customers reading that.
code-scanning if multiple analysis kinds are specified

The
analysis-kindsinput is experimental and for GitHub-internal use only. We provide no support for this input or its functionality.We stopped using multiple analysis kinds per job months ago and intend to remove support for it entirely to reduce maintenance overheads and code complexity.
This PR logs an error if multiple analysis kinds are requested at the same time outside of our testing environments and only enables
code-scanning. Full removal of the related code will follow at a future point.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Workflow types:
Managed workflows do not specify multiple inputs for
analysis-kindsand advanced setup is unsupported.Products:
N/A
Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).pr-checks).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist