-
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] Support migrating from integration type package to input type package #141472
Conversation
@@ -106,4 +106,4 @@ const addDatasetVarIfNotPresent = (vars?: RegistryVarsEntry[]): RegistryVarsEntr | |||
const createDefaultDatasetName = ( | |||
packageInfo: PackageInfo, | |||
policyTemplate: RegistryPolicyInputOnlyTemplate | |||
): string => packageInfo.name + '.' + policyTemplate.type; | |||
): string => packageInfo.name + '.' + policyTemplate.name; |
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.
During testing I found name to be a lot more descriptive here than type, and matches how integration packages tend to work
if (cache) setPackageInfo({ name, version, packageInfo }); | ||
// only cache registry pkg info for integration pkgs because | ||
// input type packages must get their pkg info from the archive | ||
if (packageInfo.type === 'integration') setPackageInfo({ name, version, packageInfo }); |
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.
While investigating a bug where the cache parameter wasn't passed, I decided it was more explicit to have this function know that we never cache registry info for input packages (because we have to get the info from the archive)
Pinging @elastic/fleet (Team:Fleet) |
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.
Changes make sense to me and I greatly appreciate the added API tests here 🚀
0d39c5f
to
4292597
Compare
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @hop-dev |
… package (elastic#141472) * it works * neaten * test failing * fix test pkgs * fix input to policy template matching * move to zip packages * never cache registry info for input packages * remove .only * fix dataset name in unit test (cherry picked from commit a61506b)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… package (#141472) (#141578) * it works * neaten * test failing * fix test pkgs * fix input to policy template matching * move to zip packages * never cache registry info for input packages * remove .only * fix dataset name in unit test (cherry picked from commit a61506b) Co-authored-by: Mark Hopkin <[email protected]>
Summary
Closes #137751
Minor fixes and api tests to support migrating a package from type "integration" to type "input".
How to test:
Checklist
Delete any items that are not applicable to this PR.