Skip to content

[Security Solution] Remove rule changes history feature flags - #278197

Open
maximpn wants to merge 8 commits into
mainfrom
changes-history/clean-up-feature-flags
Open

[Security Solution] Remove rule changes history feature flags#278197
maximpn wants to merge 8 commits into
mainfrom
changes-history/clean-up-feature-flags

Conversation

@maximpn

@maximpn maximpn commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Related to: https://github.com/elastic/security-team/issues/12367

Summary

Removes the feature flags gating the Detection Rule Changes History feature, now that it's shipping unconditionally. Both flags defaulted to true, so there's no behavior change for the majority of deployments — this only removes the opt-out.

Details

Alerting plugin

  • Remove ruleChangeTracking.enabled config schema key from config.ts (kept ruleChangeTracking.scope)
  • plugin.ts always constructs ChangeTrackingService, no longer gated by the removed config flag
  • Update RuleChangeTrackingDisabledError doc comment in get_rule_history.ts to reflect the service can no longer be disabled via config
  • Update alerting integration test config (common/config.ts, group6/enabled.ts, group6/config_with_change_tracking_enabled.ts) and unit tests/test utils to drop the removed config key

Security Solution

  • Remove ruleChangesHistoryEnabled experimental feature flag from experimental_features.ts
  • ui_settings.ts always registers ENABLE_RULE_CHANGES_HISTORY_SETTING, no longer conditional on the removed flag
  • routes.tsx, rule_details/index.tsx, rule_actions_overflow/index.tsx, and register_routes.ts drop the useIsExperimentalFeatureEnabled('ruleChangesHistoryEnabled') check, relying only on the advanced setting
  • log_rule_changes.ts updated for the alerting config change

Security Solution Serverless

  • plugin.ts always pushes securitySolution:enableRuleChangesHistory to project settings, no longer gated by the removed flag
  • Remove now-unneeded flag overrides from config/ess/config.base.ts and config/serverless/config.base.ts

Tests

  • Update trial_license_complete_tier/change_tracking.ts and security_solution/server/ui_settings.test.ts for the flag removal

How to test

Covered by existing alerting integration tests (alerting_api_integration/common/config.ts, group6/change_tracking) and security_solution/server/ui_settings.test.ts. No new manual testing needed — behavior is unchanged since both flags defaulted to enabled.

Release note

skip

Checklist

Identify risks

Removes the xpack.alerting.ruleChangeTracking.enabled config key entirely. Any deployment with this key explicitly set to false in kibana.yml will hit a config validation error on upgrade, and any deployment relying on it to opt out will lose that opt-out on the backported branches (9.5, 9.6).

@maximpn maximpn added technical debt Improvement of the software architecture and operational architecture release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Feature:Rule Management Security Solution Detection Rule Management area backport:version Backport to applied version labels v9.5.0 Team:Detection Engineering Security Detection Engineering Team v9.6.0 labels Jul 14, 2026
@maximpn maximpn self-assigned this Jul 14, 2026
@maximpn
maximpn force-pushed the changes-history/clean-up-feature-flags branch from 5419716 to a282a96 Compare July 14, 2026 18:33
@maximpn
maximpn requested a review from sdesalas July 14, 2026 22:55
@maximpn
maximpn marked this pull request as ready for review July 14, 2026 22:55
@maximpn
maximpn requested review from a team as code owners July 14, 2026 22:55
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/security-solution (Team: SecuritySolution)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the feature-flag cleanup. The change is coherent, but the removal of the xpack.alerting.ruleChangeTracking.enabled config key needs a config deprecation to avoid a fatal startup error for deployments that set it explicitly — see the inline comment. The rest of the diff (always-construct ChangeTrackingService, UI setting always registered, route always mounted, test config enabledscope rename) looks consistent and the always-present service is still guarded in get_rule_history.ts.

Generated by Claude Reviewer for #278197 · 117.6 AIC · ⌖ 10.8 AIC · ⊞ 4.3K

ruleChangeTracking: schema.object({
enabled: schema.boolean({ defaultValue: true }),
scope: schema.arrayOf(ruleChangeTrackingSolutions, { defaultValue: ['security'] }),
}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the enabled key from the ruleChangeTracking schema without a config deprecation is an upgrade-safety regression. schema.object rejects unknown keys by default, and there's no matching entry in config_deprecations.ts, so any deployment that still has xpack.alerting.ruleChangeTracking.enabled: false (the opt-out this PR is removing) in kibana.yml will hit a fatal config validation error on startup after upgrade — including on the 9.5/9.6 backport branches.

The PR description already identifies this risk. The standard fix is to register an unused() deprecation so the stale key is dropped with a warning instead of crashing:

// config_deprecations.ts
unused('ruleChangeTracking.enabled', {
  level: 'warning',
  message: 'The setting "xpack.alerting.ruleChangeTracking.enabled" is deprecated and no longer used. Please remove it.',
}),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good general rule, but I don't think it applies here. ruleChangeTracking.enabled was only ever introduced in #261981 (2026-04-28), after the 9.5 branch was cut (2026-04-10) — it's not present on the 9.4 branch at all, and 9.5.0 hasn't GA'd yet (no v9.5.0 tag; current release train is 9.4, up to v9.4.3).

So there's no released Kibana version where a real deployment could have set xpack.alerting.ruleChangeTracking.enabled: false in their kibana.yml — the key only ever existed on unreleased 9.5/main dev builds. Since this PR removes it before 9.5.0 ships, no customer upgrade path is affected, so I don't think we need an unused() deprecation for it.

@maximpn
maximpn force-pushed the changes-history/clean-up-feature-flags branch from 7d66396 to 5276363 Compare July 15, 2026 09:37

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One inline finding: the experimental_features.ts change appears to swap the removed ruleChangesHistoryEnabled flag for an unrelated new flag rather than just deleting it. The pre-existing config-deprecation concern already noted on alerting/server/config.ts still stands and is not repeated here.

Generated by Claude Reviewer for #278197 · 109.3 AIC · ⌖ 7.65 AIC · ⊞ 4.3K

@maximpn
maximpn force-pushed the changes-history/clean-up-feature-flags branch 2 times, most recently from bd9f48f to fb40615 Compare July 15, 2026 13:42

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the feature-flag removal. One upgrade-safety concern on the removed alerting config key (inline). The rest — UI checks now relying solely on the advanced setting, always-constructing ChangeTrackingService, the serverless project-settings push, and the test config scope renames — looks consistent, and I found no leftover references to the removed ruleChangesHistoryEnabled / ruleChangeTracking.enabled flags.

Generated by Claude Reviewer for #278197 · 230.8 AIC · ⌖ 12.8 AIC · ⊞ 4.3K

Comment thread x-pack/platform/plugins/shared/alerting/server/config.ts

@pmuellr pmuellr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResponseOps changes LGTM

@maximpn
maximpn force-pushed the changes-history/clean-up-feature-flags branch from 549ad76 to 04e85ed Compare July 21, 2026 08:53

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the feature-flag cleanup. One backward-compatibility concern flagged inline regarding removal of the xpack.alerting.ruleChangeTracking.enabled config key without a deprecation. The rest of the flag removals and test updates look consistent.

Generated by Claude Reviewer for #278197 · 127.5 AIC · ⌖ 11.7 AIC · ⊞ 4.6K

Comment thread x-pack/platform/plugins/shared/alerting/server/config.ts

@szaffarano szaffarano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maximpn
maximpn force-pushed the changes-history/clean-up-feature-flags branch from ec5debd to 5b2533e Compare September 11, 2026 15:37
@maximpn
maximpn requested review from a team as code owners September 11, 2026 15:37

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One upgrade-safety concern: the removed ruleChangeTracking.enabled config key needs an unused() deprecation so deployments that set it don't hit a fatal config-validation error on boot (see inline comment). The rest of the flag removal is mechanically consistent, and the test updates track the change appropriately.

Generated by Claude Reviewer for #278197 · claude · opus · 127.9 AIC · ⌖ 22.4 AIC · ⊞ 5.5K

Comment thread x-pack/platform/plugins/shared/alerting/server/config.ts
@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
shared-plugins 12.1MB 12.1MB -29.0B
Unknown metric groups

shared chunks total size

id before after diff
all 7.0MB 7.0MB -142.0B

total optimizer output size

id before after diff
all 63.9MB 63.9MB -171.0B

History

cc @maximpn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Rule Management Security Solution Detection Rule Management area release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engineering Security Detection Engineering Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. technical debt Improvement of the software architecture and operational architecture v9.5.0 v9.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants