[Fleet] Limit reusable integration policies to 1000 agent policies#247276
Merged
[Fleet] Limit reusable integration policies to 1000 agent policies#247276
Conversation
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
bmorelli25
approved these changes
Dec 23, 2025
…com:elastic/kibana into feature-limit-reusable-integration-policies
Member
Author
|
@elasticmachine merge upstream |
Member
Author
|
@elasticmachine merge upstream |
juliaElastic
reviewed
Jan 5, 2026
| calls.forEach((call, idx) => { | ||
| expect(call[2]).toContain(`test-agent-policy-${idx + 1}`); | ||
| expect(call[3]).toMatchObject({ removeProtection: false }); | ||
| expect(call[3]).toMatchObject({ removeProtection: undefined }); |
Contributor
There was a problem hiding this comment.
did the logic change that removeProtection became undefined?
Member
Author
There was a problem hiding this comment.
The code has been refactored so the same code is called for all bump policies, and removeProtection: false or removeProtection: undefined has the same effect
juliaElastic
reviewed
Jan 5, 2026
| user: options?.user, | ||
| asyncDeploy: | ||
| options.asyncDeploy || policyIds.length > ASYNC_DEPLOY_POLICIES_THRESHOLD | ||
| ? true |
Contributor
There was a problem hiding this comment.
nit: ? true : false is unnecessary
juliaElastic
reviewed
Jan 5, 2026
| asyncDeploy: options?.asyncDeploy, | ||
| }); | ||
| } | ||
| await this.bumpAgentPoliciesRevision({ soClient, esClient }, [...agentPolicyIds], { |
Contributor
There was a problem hiding this comment.
nit: why is it necessary to copy agentPolicyIds and associatedPolicyIds below?
Member
Author
There was a problem hiding this comment.
agentPolicyIds is a Set and bumpAgentPoliciesRevision needs an array
Contributor
💚 Build Succeeded
Metrics [docs]
History
cc @nchaulet |
CAWilson94
pushed a commit
to CAWilson94/kibana
that referenced
this pull request
Jan 6, 2026
dej611
pushed a commit
to dej611/kibana
that referenced
this pull request
Jan 8, 2026
devamanv
pushed a commit
to devamanv/kibana
that referenced
this pull request
Jan 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolve #240983
Add a limit for the number of agent policies a reusable integration policy can reference. Set it to 1000 as we some code optimization it seems to be working on the API side (UI is probably not great with that number)
Details
When a package policy is referencing more than 100 agent policies, updating those policies will be done asynchronously in the task manager.
Test
I added some integration test to be sure we do not have regressions here in the future.