Skip to content

[9.3] [Fleet] Fix package policy count filters: use NOT latest_revision:false instead of latest_revision:true#264041

Merged
juliaElastic merged 10 commits intoelastic:9.3from
juliaElastic:backport-263717-to-9.3
Apr 17, 2026
Merged

[9.3] [Fleet] Fix package policy count filters: use NOT latest_revision:false instead of latest_revision:true#264041
juliaElastic merged 10 commits intoelastic:9.3from
juliaElastic:backport-263717-to-9.3

Conversation

@juliaElastic
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

@botelastic botelastic Bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Apr 17, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@juliaElastic juliaElastic added backport This PR is a backport of another PR release_note:skip Skip the PR/issue when compiling release notes labels Apr 17, 2026
@juliaElastic juliaElastic requested review from a team and criamico April 17, 2026 12:13
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 17, 2026

Approvability

Verdict: Needs human review

This PR changes query filter logic from latest_revision:true to NOT latest_revision:false to include policies without the field (8.x upgrades). While well-tested and clearly intentional, this modifies runtime query behavior across multiple Fleet package policy code paths, affecting what documents are counted and returned.

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

juliaElastic and others added 8 commits April 17, 2026 14:18
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d add test cleanup

- Extract repeated NOT latest_revision:false filter expression into a
  buildCurrentRevisionFilter() helper used across all 6 call sites
- Add try/finally cleanup to integration test that strips latest_revision
  from a SO doc, restoring it after assertions so it does not affect
  subsequent tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When list() is called with fields:['policy_ids'] (e.g. from
checkFleetServerVersionsForSecretsStorage), the SO client returns
partial attributes and attributes.name is undefined — crashing with
TypeError on the audit log call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@juliaElastic juliaElastic force-pushed the backport-263717-to-9.3 branch from a15351a to a280561 Compare April 17, 2026 12:22
@juliaElastic
Copy link
Copy Markdown
Contributor Author

@elasticmachine run docs-build

@juliaElastic juliaElastic enabled auto-merge (squash) April 17, 2026 13:38
@juliaElastic juliaElastic merged commit 98266ca into elastic:9.3 Apr 17, 2026
14 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

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

Labels

backport This PR is a backport of another PR release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants