Skip to content
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 keep policies up to date after package install #174093

Merged
merged 5 commits into from
Jan 3, 2024

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Jan 2, 2024

Summary

Resolve #148524

The code path to keep package policies up to date after a package upgrade was never called, that PR should fix that by retrieving correctly the installation with all the attributes including keep_policies_up_to_date that is used in the condition to upgrade package policies.

Tests

I manually tested that, looking if there is some automated test that could be added here.

@kpollich I am wondering if after that fix that codepath is still needed https://github.com/nchaulet/kibana/blob/d2c1d0cb297d3a5718ae6665ec2e5c95e89cc84b/x-pack/plugins/fleet/server/services/managed_package_policies.ts#L31-L58 ?

@nchaulet nchaulet added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team labels Jan 2, 2024
@nchaulet nchaulet self-assigned this Jan 2, 2024
@nchaulet nchaulet requested a review from a team as a code owner January 2, 2024 15:44
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM, could we add a comment why the package has to be queried from ES? It's not trivial from the code.

@nchaulet
Copy link
Member Author

nchaulet commented Jan 2, 2024

LGTM, could we add a comment why the package has to be queried from ES? It's not trivial from the code.

Yes it's a good idea, I am going to add one 👍

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Makes sense to me 🚀 - agree that a comment would go a long way here, it's not obvious that we were previously checking a stale package reference and need to refetch before we check the keep_policies_up_to_date flag.

@nchaulet
Copy link
Member Author

nchaulet commented Jan 2, 2024

@elasticmachine merge upstream

@nchaulet
Copy link
Member Author

nchaulet commented Jan 2, 2024

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nchaulet

@nchaulet nchaulet merged commit 3ce276d into elastic:main Jan 3, 2024
21 checks passed
@nchaulet nchaulet deleted the fix-keep-up-to-date branch January 3, 2024 09:27
@kibanamachine kibanamachine added v8.13.0 backport:skip This commit does not require backporting labels Jan 3, 2024
jloleysens added a commit that referenced this pull request Jan 4, 2024
* main: (4129 commits)
  [Logs Explorer] Change the default link for "Discover" in the serverless nav (#173420)
  [Fleet] fix unhandled error in agent details when components are missing (#174152)
  [Obs UX] Unskip transaction duration alerts test (#174069)
  [Fleet] Fix keep policies up to date after package install (#174093)
  [Profiling] Stack traces embeddable (#173905)
  [main] Sync bundled packages with Package Storage (#174115)
  [SLO Form] Refactor to use kibana data view component (#173513)
  [Obs UX] Unskip APM Service Inventory Journey (#173510)
  [Obs UX] Unskip preview_chart_error_count test (#173624)
  [api-docs] 2024-01-03 Daily api_docs build (#174142)
  Update babel runtime helpers (#171745)
  Handle content stream errors in report pre-deletion (#173792)
  [Cloud Posture] [Quick wins] Enable edit DataView on the Misconfigurations Findings Table (#173870)
  [ftr] abort retry on invalid webdriver session (#174092)
  Upgrade openai to 4.24.1 (#173934)
  chore(NA): bump node into v20 (#173461)
  [Security Solution][Endpoint] Fix index name pattern in SentinelOne dev. script (#174105)
  fix versions.json
  [Obs AI Assistant] Add guardrails (#174060)
  [ML] Transforms: Refactor validators and add unit tests. (#173736)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] API Keys are not updated after adding data streams to package
7 participants