-
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] Make upload and registry package info consistent #126915
Changes from 16 commits
cf96755
625f582
5ff6ee6
c564592
586c08c
6a9c1e9
62a45cc
cae823e
37f60f3
4212c27
0f779d9
000f3a1
6fdfd1f
8656915
29d903c
a316ab1
0ba1902
14e7b87
eadab35
1da1eba
a1254e7
dadfe20
5d97961
9122a63
bd2e6c2
bfffa79
f0e9da1
29a30e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,13 @@ import type { BundledPackage } from '../../../types'; | |
import { appContextService } from '../../app_context'; | ||
import { splitPkgKey } from '../registry'; | ||
|
||
const BUNDLED_PACKAGE_DIRECTORY = path.join(__dirname, '../../../../target/bundled_packages'); | ||
|
||
export async function getBundledPackages(): Promise<BundledPackage[]> { | ||
const config = appContextService.getConfig(); | ||
|
||
const BUNDLED_PACKAGE_DIRECTORY = config?.developer?.bundledPackageLocation | ||
? config.developer.bundledPackageLocation | ||
: path.join(__dirname, '../../../../target/bundled_packages'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd be ideal if we put this default in the config schema in bundledPackageLocation: schema.string({ defaultValue: '...' }), |
||
|
||
try { | ||
const dirContents = await fs.readdir(BUNDLED_PACKAGE_DIRECTORY); | ||
const zipFiles = dirContents.filter((file) => file.endsWith('.zip')); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ export default function (providerContext: FtrProviderContext) { | |
.type('application/gzip') | ||
.send(buf) | ||
.expect(200); | ||
expect(res.body.items.length).to.be(27); | ||
expect(res.body.items.length).to.be(29); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These responses have ingest pipelines, etc now, so they have additional elements. |
||
}); | ||
|
||
it('should install a zip archive correctly and package info should return correctly after validation', async function () { | ||
|
@@ -86,7 +86,7 @@ export default function (providerContext: FtrProviderContext) { | |
.type('application/zip') | ||
.send(buf) | ||
.expect(200); | ||
expect(res.body.items.length).to.be(27); | ||
expect(res.body.items.length).to.be(29); | ||
}); | ||
|
||
it('should throw an error if the archive is zip but content type is gzip', async function () { | ||
|
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 these comments 💯