feat: add excluded_components config to filter components from scan#7
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (5)
WalkthroughAdds an ChangesJira Component Exclusion Filter
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds a config-driven excluded_components option to JiraConfig that appends AND component NOT IN (...) to the scan JQL. This allows consumers to skip components that are out of scope for AI triage. OSAC config excludes the Enclave component. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0d77fa2 to
4e50d17
Compare
adalton
left a comment
There was a problem hiding this comment.
The logic looks correct and the config plumbing is clean. Two things before merging:
- Scanner tests needed — see inline comment.
- Document the new field in
chart/triage-bot/values.yaml— every otherjira.*field has a default and comment in the chart's values file. Please addexcluded_components: []with a short comment (e.g.,# -- Component names to exclude from the scan JQL) so the chart stays self-documenting.
… chart - Add TestBuildJQL with 3 cases: no exclusion, one component, multiple - Add excluded_components field to chart/triage-bot/values.yaml with Helm doc comment for self-documenting chart Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
adalton
left a comment
There was a problem hiding this comment.
Both items addressed — scanner tests cover all three branches and the chart default is documented. LGTM.
Summary
jira.excluded_componentsconfig option to skip specific Jira components during triage scanAND component NOT IN (...)to the scan JQL queryEnclavecomponent — these bugs are out of scope for AI triageChanges
config/config.go— addExcludedComponents []stringtoJiraConfig+ env bindingscanner/scanner.go— modifybuildJQL()to use the new fielddeploy/osac/values.yaml— setexcluded_components: ["Enclave"]Test plan
go build ./...passesgo test ./config/passesgofmtcleancomponent NOT IN ("Enclave")🤖 Generated with Claude Code
Packages and Components Affected
Packages: config/, scanner/
Control Plane: This change affects the control plane's polling/scanning phase. It modifies the Jira query construction in the scanner to exclude specified components before bugs are fetched, preventing out-of-scope components from entering triage processing.
Configuration, Helm Charts, and Deployment:
config.JiraConfigwithExcludedComponents []stringfield, bound to environment variableTRIAGE_BOT_JIRA_EXCLUDED_COMPONENTSexcluded_componentsconfiguration option underconfig.jirainchart/triage-bot/values.yamlEnclavecomponent viadeploy/osac/values.yamlImplementation Summary
The PR introduces component filtering for Jira triage scans:
Scanner.buildJQL()to conditionally appendAND component NOT IN (...)clause when excluded components are configuredExcludedComponentsfield toJiraConfigwith mapstructure binding and environment variable supportTestBuildJQLwith three test cases covering no exclusion, single component, and multiple component scenariosThe implementation allows operators to exclude components out of scope for AI triage at query time, reducing unnecessary processing and improving triage efficiency.