-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] Fix policy revision number getting bumped for no reason #104696
Conversation
Pinging @elastic/fleet (Feature:Fleet) |
Pinging @elastic/fleet (Team:Fleet) |
const configTopLevelFields = omit(preconfiguredAgentPolicy, 'package_policies', 'id'); | ||
const currentTopLevelFields = omit(policy, 'package_policies'); | ||
const currentTopLevelFields = pick(policy, ...Object.keys(configTopLevelFields)); | ||
|
||
if (!isEqual(configTopLevelFields, currentTopLevelFields)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it will make sense to have a non regression test here? and maybe extract this to a hasPreconfiguredPolicyChanged()
or better naming to make writing this test easier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test 🚀
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @Zacqary |
…tic#104696) * [Fleet] Fix policy revision number getting bumped for no reason * Add test for comparing preconfig policy to current
…tic#104696) * [Fleet] Fix policy revision number getting bumped for no reason * Add test for comparing preconfig policy to current
) (#104767) * [Fleet] Fix policy revision number getting bumped for no reason * Add test for comparing preconfig policy to current Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
…-of-max-results * 'master' of github.com:elastic/kibana: (36 commits) Lower Kibana app bundle limits (elastic#104688) [Security Solutions] Fixes bug with the filter query compatibility for transforms (elastic#104559) [RAC] Add mapping update logic to RuleDataClient (elastic#102586) Fix import workpad (elastic#104722) [canvas] Fix Storybook service decorator (elastic#104750) [Detection Rules] Add 7.14 rules (elastic#104772) [Enterprise Search] Fix beta notification in sidebar (elastic#104763) Fix engine routes that are meta engine or non-meta-engine specific (elastic#104757) [Fleet] Fix policy revision number getting bumped for no reason (elastic#104696) persistable state migrations (elastic#103680) [Fleet] Fix add agent in the package policy table (elastic#104749) [DOCS] Creates separate doc for security in production (elastic#103973) [SO Migration] fix reindex race on multi-instance mode (elastic#104516) [Security Solution] Update text in Endpoint Admin pages (elastic#104649) [package testing] Decrease timeout to 2 hours (elastic#104668) Fix background styling of waterfall chart sidebar tooltip. (elastic#103997) [Fleet + Integrations UI] Integrations UI Cleanup (elastic#104641) [Fleet] Link to download page of current stack version on Agent install instructions (elastic#104494) [Workplace Search] Fix Media Type field preview is unformatted bug (elastic#104684) [ML] add marker body (elastic#104672) ... # Conflicts: # x-pack/plugins/fleet/public/search_provider.test.ts
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
1 similar comment
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
) (#104768) * [Fleet] Fix policy revision number getting bumped for no reason * Add test for comparing preconfig policy to current Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
Summary
Fixes #104584
The check to see if any top-level fields on
is_managed
policies had changed was broken, and wasn't correctly filtering the current agent policy down to only the diff-checked fields. This fixes the issue.