[Elastic Assistant] React to FF updates#223429
Conversation
| 'my-overridden-flag': true, | ||
| 'myPlugin.myOverriddenFlag': true, | ||
| myDestructuredObjPlugin: { myOverriddenFlag: true }, | ||
| 'myDestructuredObjPlugin.myOverriddenFlag': true, |
There was a problem hiding this comment.
we're now flattening the object as we receive the overrides to make sure that we capture all flag names
|
Pinging @elastic/kibana-core (Team:Core) |
💚 Build Succeeded
Metrics [docs]
History
cc @afharo |
| * @param enabled If the feature flag is enabled or not. | ||
| * @return `true` if susbscription needs to stay active, `false` if it can be unsubscribed. | ||
| */ | ||
| fn: (enabled: boolean) => boolean | Promise<boolean>; |
There was a problem hiding this comment.
The subscription/unsubscribe feels a bit complex and easy to get wrong, is it necessary or could we just keep the subscription always?
There was a problem hiding this comment.
We covered it on Slack.
The 2 current use cases should stop the subscription as soon as the flag is true because they can't re-run the same code twice and they don't provide a path to unregister for the false path.
But this doesn't mean that future feature flags will follow this approach. The security team is free to simplify it, though, if they want to.
rudolf
left a comment
There was a problem hiding this comment.
Core changes lgtm but the code consuming it feels rather complex.
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15613479735 |
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 52a016f)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.19`: - [[Elastic Assistant] React to FF updates (#223429)](#223429) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Alejandro Fernández Haro","email":"alejandro.haro@elastic.co"},"sourceCommit":{"committedDate":"2025-06-12T14:34:24Z","message":"[Elastic Assistant] React to FF updates (#223429)\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"52a016fc35b9f509b4398129a8354f71f20b7461","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","Team:Security Generative AI","backport:version","v9.1.0","v8.19.0"],"title":"[Elastic Assistant] React to FF updates","number":223429,"url":"https://github.com/elastic/kibana/pull/223429","mergeCommit":{"message":"[Elastic Assistant] React to FF updates (#223429)\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"52a016fc35b9f509b4398129a8354f71f20b7461"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/223429","number":223429,"mergeCommit":{"message":"[Elastic Assistant] React to FF updates (#223429)\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"52a016fc35b9f509b4398129a8354f71f20b7461"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Alejandro Fernández Haro <alejandro.haro@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Elastic Assistant currently evaluates 2 feature flags during Kibana startup. If the flag is
false, it skips the registration of some features (like alerting rules). Since it's not subscribed to updates, it doesn't react if the flag is later switched totrue. This PR changes the usage from the single-evaluation API to the observable subscription.Additional fix
The Feature flags service now reacts to live changes to the dynamic config overrides.