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

[Security Solution][Endpoint] changes to Endpoint metadata API in support of space awareness #193490

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

paul-tavares
Copy link
Contributor

@paul-tavares paul-tavares commented Sep 19, 2024

Summary

Fleet Plugin

  • Added some mocks and updates others

Security Solution

The following refactoring changes were done in preparation for forthcoming work for supporting kibana spaces:

  • A new saved objects client factory service was introduced for use in EndpointAppContextServices
  • Deleted older saved objects client utilities
  • Simplified the list of options passed to EndpointAppContextService#start() method
  • Updated EndpiontFleetServicesFactory with:
    • simpler list of constructor arguments
    • changed members of object return by asInternalUser()
  • Refactored the EndpintMetadataService to:
    • take in simplified constructor arguments
    • Simplified most methods of the class with removal all ES Client, SO Client or Fleet services arguments from class method calling signatures. These are not provided to the service class upon initialization and can be accessed internally by the methods
  • Updates to Mocks and tests to reflect the above changes

Checklist

@paul-tavares paul-tavares added release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution backport:prev-minor Backport to the previous minor version (i.e. one version back from main) v8.16.0 labels Sep 19, 2024
@paul-tavares paul-tavares self-assigned this Sep 19, 2024
@paul-tavares
Copy link
Contributor Author

/ci

@paul-tavares
Copy link
Contributor Author

/ci

@paul-tavares
Copy link
Contributor Author

/ci

@paul-tavares paul-tavares marked this pull request as ready for review September 25, 2024 12:52
@paul-tavares paul-tavares requested review from a team as code owners September 25, 2024 12:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-defend-workflows (Team:Defend Workflows)

@paul-tavares paul-tavares requested review from jpdjere and szwarckonrad and removed request for parkiino September 25, 2024 12:52
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 25, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@paul-tavares paul-tavares requested review from a team as code owners September 25, 2024 16:01
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Sep 25, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

packageService: createMockPackageService(),
agentPolicyService: createMockAgentPolicyService(),
registerExternalCallback: jest.fn((..._: ExternalCallback) => {}),
packagePolicyService: createPackagePolicyServiceMock(),
createArtifactsClient: jest.fn().mockReturnValue(createArtifactsClientMock()),
};
} as unknown as DeeplyMockedKeys<FleetStartContract>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we replace this createMockFleetStartContract with the newly created createFleetStartContractMock imported from fleet/server/mocks?

packageService: createMockPackageService(),
agentPolicyService: createMockAgentPolicyService(),
registerExternalCallback: jest.fn((..._: ExternalCallback) => {}),
packagePolicyService: createPackagePolicyServiceMock(),
createArtifactsClient: jest.fn().mockReturnValue(createArtifactsClientMock()),
};
} as unknown as DeeplyMockedKeys<FleetStartContract>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question about importing the mock from the fleet

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 25, 2024

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #75 / console app text input console history should load a request from history

Metrics [docs]

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
fleet 74 73 -1
Unknown metric groups

ESLint disabled in files

id before after diff
securitySolution 84 85 +1

Total ESLint disabled count

id before after diff
securitySolution 626 627 +1

History

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

cc @paul-tavares

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review backport:prev-minor Backport to the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution Team:Fleet Team label for Observability Data Collection Fleet team Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants