Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/floppy-cows-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openfn/cli': patch
---

Update undici version
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"json-diff": "^1.0.6",
"rimraf": "^6.1.3",
"treeify": "^1.1.0",
"undici": "6.24.1",
"undici": "8.5.0",
"ws": "^8.19.0",
"yargs": "^17.7.2"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/projects/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ export const getLightningUrl = (
}
const params = new URLSearchParams();
snapshots?.forEach((snapshot) => params.append('snapshots[]', snapshot));
return new URL(`/api/provision/${path}?${params.toString()}`, endpoint);
const query = params.toString();
return new URL(`/api/provision/${path}${query ? `?${query}` : ''}`, endpoint);
};

// TODO move to client.ts
Expand Down
10 changes: 10 additions & 0 deletions packages/cli/test/projects/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { writeFile } from 'node:fs/promises';
import test from 'ava';
import mock from 'mock-fs';
import path from 'node:path';
import { createRequire } from 'node:module';
import Project, { generateWorkflow } from '@openfn/project';
import { createMockLogger } from '@openfn/logger';
import createLightningServer from '@openfn/lightning-mock';
Expand Down Expand Up @@ -30,15 +31,24 @@ const ENDPOINT = `http://localhost:${port}`;
const projectYaml = myProject_yaml.replace('https://app.openfn.org', ENDPOINT);
const two_workflows_yaml = twowfs.replace('https://app.openfn.org', ENDPOINT);

const require = createRequire(import.meta.url);

const mockFs = (paths: Record<string, string>) => {
// ensure this path is available to pnpm (needed by deps for some reason??)
// Note: loading all of pnpm takes ~7 seconds per test
// this workaround cuts out that delay entirely
const iconv = path.resolve(
'../../node_modules/.pnpm/iconv-lite@0.4.24/node_modules/iconv-lite/encodings'
);
// undici v8 reads its llhttp WASM from disk on the first request, so keep
// that dir visible or fetches to the mock server fail with ENOENT
const undiciLlhttp = path.join(
path.dirname(require.resolve('undici')),
'lib/llhttp'
);
mock({
[iconv]: mock.load(iconv, {}),
[undiciLlhttp]: mock.load(undiciLlhttp, {}),
...paths,
});
};
Expand Down
36 changes: 18 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.