Move executor categorization enable flag under errorCategories.enabled#4892
Conversation
Signed-off-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
72f022e to
bec644f
Compare
Greptile SummaryThis PR relocates the executor's failure-classification feature flag from
Confidence Score: 5/5Safe to merge; the change is a pure config-field rename with identical runtime behavior, and all call sites have been updated. Every reference to the old No files require special attention. All changed files are consistent and the migration is complete. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ExecutorConfiguration] --> B[ApplicationConfiguration]
B --> C[ErrorCategoriesConfig]
C --> D["Enabled bool (NEW — was EnableJobErrorCategorization)"]
C --> E[DefaultCategory string]
C --> F[DefaultSubcategory string]
C --> G["Categories []CategoryConfig"]
H[application.go setupExecutorApiComponents] -->|"if ErrorCategories.Enabled"| I[categorizer.NewClassifier]
I --> J[Classifier used in event reporting]
H -->|"Enabled == false"| K[classifier = nil, no categorization]
Reviews (2): Last reviewed commit: "Merge branch 'master' into move-categori..." | Re-trigger Greptile |
Summary
Move the executor's failure-classification feature flag from
application.enableJobErrorCategorizationtoapplication.errorCategories.enabled. The flag now lives with the rules it gates rather than as a separate top-level boolean.Shipped default in
config/executor/config.yamlisenabled: false.Why
The flag was added in a separate refactor PR after the categorizer config already existed at the top level, which left the on/off switch sitting next to (rather than inside) the thing it controls. The nested form is cohesive: an operator reading or writing categorization config sees
enabledas a sibling ofdefaultCategory,categories, etc.Code-side, this also lets future validation (e.g. "if
enabled: truethencategoriesmust be non-empty") live insidecategorizer.ErrorCategoriesConfig.Validate()rather than spanning two structs.Migration
This is a breaking config change for any operator deployment that sets
enableJobErrorCategorization: truetoday.Before:
After:
If
errorCategories.enabledis unset/false, the executor skips classifier construction entirely (same behavior as the old flag being off). The shipped default inconfig/executor/config.yamlisenabled: false, so categorization remains opt-in.Validation
go test ./internal/executor/...passes.golangci-lint run ./internal/executor/...clean.e2e/config/executor_config.yamlupdated to the new shape (still enabled in e2e where rules are exercised).config/executor/config.yamladdserrorCategories.enabled: falseas the explicit shipped default.