Skip to content

[Fleet] only auto-install content packages newer than the installed version#262509

Merged
juliaElastic merged 1 commit into
elastic:mainfrom
juliaElastic:fix-content-packages-install
Apr 10, 2026
Merged

[Fleet] only auto-install content packages newer than the installed version#262509
juliaElastic merged 1 commit into
elastic:mainfrom
juliaElastic:fix-content-packages-install

Conversation

@juliaElastic
Copy link
Copy Markdown
Contributor

@juliaElastic juliaElastic commented Apr 10, 2026

Summary

Closes #260677

The auto-install content packages task was using string equality (!== version) to decide whether to reinstall a package. This meant any version mismatch would trigger a reinstall, effectively downgrading packages. For example, if 2.0.0-preview was installed and the registry listed 1.4.0 as the latest stable, the task would downgrade to 1.4.0.

The fix replaces string equality with semverGt to make sure there are no downgrades happening.
A package is now only installed when the registry version is strictly newer than the installed version.

To verify:

  • install prerelease version of a content package
POST kbn:/api/fleet/epm/packages/kubernetes_otel/2.0.0-preview5
{
    "force": true
}
  • wait 10m until the auto install content packages task runs
  • verify that the kubernetes_otel package is not downgraded

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@juliaElastic juliaElastic requested a review from a team as a code owner April 10, 2026 11:30
@botelastic botelastic Bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Apr 10, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 10, 2026

Approvability

Verdict: Needs human review

This PR changes the runtime behavior of when content packages get auto-installed, switching from version mismatch detection to semantic version comparison to prevent downgrades. While the change is focused and well-tested, it modifies package installation decision logic that could affect production deployments, and the author is not a designated owner of the Fleet files being changed.

You can customize Macroscope's approvability policy. Learn more.

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Fleet Cypress Tests #1 / View agents list Bulk actions should navigate to Maintenance and diagnostics submenu
  • [job] [logs] Fleet Cypress Tests #1 / View agents list Bulk actions should navigate to Security and removal submenu and show unenroll option
  • [job] [logs] Fleet Cypress Tests #1 / View agents list Bulk actions should show hierarchical menu with submenus

Metrics [docs]

✅ unchanged

Copy link
Copy Markdown
Member

@criamico criamico left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@juliaElastic juliaElastic merged commit 3f939ce into elastic:main Apr 10, 2026
35 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/24249149029

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.2 Backport failed because of merge conflicts
9.3 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 262509

Questions ?

Please refer to the Backport tool documentation

juliaElastic added a commit to juliaElastic/kibana that referenced this pull request Apr 13, 2026
…ersion

Backport of elastic#262509 to 9.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
juliaElastic added a commit to juliaElastic/kibana that referenced this pull request Apr 13, 2026
…ersion

Backport of elastic#262509 to 9.3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
juliaElastic added a commit to juliaElastic/kibana that referenced this pull request Apr 13, 2026
Backport of elastic#262509 test changes to 9.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
juliaElastic added a commit to juliaElastic/kibana that referenced this pull request Apr 13, 2026
Backport of elastic#262509 test changes to 9.3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
juliaElastic added a commit that referenced this pull request Apr 13, 2026
…lled version (#262704)

## Summary

Backport of #262509 to 9.3.

The auto-install content packages task was using string equality (`!==
version`) to decide whether to reinstall a package. This meant any
version mismatch would trigger a reinstall, effectively downgrading
packages.

The fix replaces string equality with `semverGt` to ensure a package is
only installed when the registry version is strictly newer than the
installed version.

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-10T14:55:34Z","message":"[Fleet]
only auto-install content packages newer than the installed version
(#262509)","sha":"3f939ce873bcbba27b7ccfd44093aa2198bcc743"},"sourcePullRequest":{"number":262509,"url":"https://github.com/elastic/kibana/pull/262509"},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.4","state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
juliaElastic added a commit that referenced this pull request Apr 13, 2026
…lled version (#262703)

## Summary

Backport of #262509 to 9.2.

The auto-install content packages task was using string equality (`!==
version`) to decide whether to reinstall a package. This meant any
version mismatch would trigger a reinstall, effectively downgrading
packages.

The fix replaces string equality with `semverGt` to ensure a package is
only installed when the registry version is strictly newer than the
installed version.

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"90178898+juliaElastic@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-10T14:55:34Z","message":"[Fleet]
only auto-install content packages newer than the installed version
(#262509)","sha":"3f939ce873bcbba27b7ccfd44093aa2198bcc743"},"sourcePullRequest":{"number":262509,"url":"https://github.com/elastic/kibana/pull/262509"},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.9","state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 14, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@juliaElastic juliaElastic removed backport missing Added to PRs automatically when the are determined to be missing a backport. v9.4.0 labels Apr 14, 2026
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 15, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

29 similar comments
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 262509 locally
cc: @juliaElastic

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

Labels

backport missing Added to PRs automatically when the are determined to be missing a backport. backport:version Backport to applied version labels release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team v9.2.9 v9.3.4 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet] Content packages should only if the currently installed version is older

4 participants