-
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] Remove field package_policies from agent policy #138677
[Fleet] Remove field package_policies from agent policy #138677
Conversation
…package-policies-double-foreign-key
…package-policies-double-foreign-key
…package-policies-double-foreign-key
Pinging @elastic/fleet (Team:Fleet) |
...ck/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx
Outdated
Show resolved
Hide resolved
Pinging @elastic/apm-ui (Team:apm) |
@elasticmachine merge upstream |
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.
Thank you for making all those chances on the Endpoint side. They LGTM 👍
@@ -35,7 +35,7 @@ export interface NewAgentPolicy { | |||
export interface AgentPolicy extends Omit<NewAgentPolicy, 'id'> { | |||
id: string; | |||
status: ValueOf<AgentPolicyStatus>; | |||
package_policies: string[] | PackagePolicy[]; | |||
package_policies?: PackagePolicy[]; |
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.
cool. I like that you still left this property around, since it can be useful sometimes to have it all in one API call.
@@ -16,14 +16,14 @@ import { PackagePoliciesTable } from './package_policies_table'; | |||
export const PackagePoliciesView = memo<{ agentPolicy: AgentPolicy }>(({ agentPolicy }) => { | |||
useBreadcrumbs('policy_details', { policyName: agentPolicy.name }); | |||
|
|||
if (agentPolicy.package_policies.length === 0) { | |||
if (!agentPolicy.package_policies || agentPolicy.package_policies.length === 0) { |
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.
nit: there is a shorter way with lodash: isEmpty(agentPolicy.package_policies)
...ck/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/index.test.tsx
Outdated
Show resolved
Hide resolved
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.
Fleet change LGTM, added some comments
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.
APM changes LGTM
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.
cloud posture LGTM 👍
also noticed UI changed in integration policies
table:
looks like this has no hits now:
Line 83 in 1e82d04
kuery: agentPoliciesFilter, |
Good catch just pushed a change that should fix that |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: cc @nchaulet |
Summary
Resolve #137005
That PR remove the bi directionnal foreign key between agent policy and package policy.
Why?
That key was causing some issue when concurrent package policies are created, and it happens that the key was out of sync between the two index
package-policies
andagent-policies
. By removing thatpackage_policies
key in the agent policy document we make our APIs more robust.Now to retrieve the package policy for an agent policy we search for all the package policy with
policy_id:"agent_policy_id"
This is breaking change, but it should be mitigated in the plugin using that field by the introduction of a bulk GET api for agent and package policy.
Release note
Breaking change remove the
package_policies
field from the agent policy saved object.