Skip to content

Commit 66c7f79

Browse files
authored
Merge pull request #1406 from OpenFn/schema-version-4
CLI 1.35.3 Schema version 4 & supporting fies
2 parents c5b4b33 + 9fa61f8 commit 66c7f79

28 files changed

Lines changed: 170 additions & 90 deletions

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 24.14.0
1+
nodejs 24.15.0

integration-tests/cli/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# @openfn/integration-tests-cli
22

3+
## 1.0.22
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @openfn/project@0.15.2
9+
- @openfn/lightning-mock@2.4.17
10+
311
## 1.0.21
412

513
### Patch Changes

integration-tests/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@openfn/integration-tests-cli",
33
"private": true,
4-
"version": "1.0.21",
4+
"version": "1.0.22",
55
"description": "CLI integration tests",
66
"author": "Open Function Group <admin@openfn.org>",
77
"license": "ISC",

integration-tests/cli/test/project-v1.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ test.serial('Checkout a project', async (t) => {
142142
`id: my-workflow
143143
name: my workflow
144144
start: webhook
145-
options: {}
146145
steps:
147146
- id: webhook
148147
type: webhook
@@ -153,7 +152,7 @@ steps:
153152
condition: always
154153
- id: transform-data
155154
name: Transform data
156-
adaptor: "@openfn/language-common@latest"
155+
adaptor: '@openfn/language-common@latest'
157156
expression: ./transform-data.js
158157
`
159158
);

integration-tests/cli/test/project-v2.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ test.serial('Checkout a project', async (t) => {
151151
`id: hello-workflow
152152
name: Hello Workflow
153153
start: trigger
154-
options: {}
155154
steps:
156155
- id: trigger
157156
type: webhook
@@ -161,7 +160,7 @@ steps:
161160
condition: true
162161
- id: transform-data
163162
name: Transform data
164-
adaptor: "@openfn/language-dhis2@8.0.4"
163+
adaptor: '@openfn/language-dhis2@8.0.4'
165164
expression: ./transform-data.js
166165
`
167166
);

packages/cli/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# @openfn/cli
22

3+
## 1.35.3
4+
5+
### Patch Changes
6+
7+
- Include version number in serialized project files
8+
- Don't validate workflows on execution unless `--validate` is explicitly passed
9+
- Allow setting `PREFER_LEGACY_SYNC=1` to strictly disable v2 sync when calling the v1 API
10+
- Updated dependencies
11+
- @openfn/project@0.15.2
12+
313
## 1.35.2
414

515
### Patch Changes

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openfn/cli",
3-
"version": "1.35.2",
3+
"version": "1.35.3",
44
"description": "CLI devtools for the OpenFn toolchain",
55
"engines": {
66
"node": ">=18",

packages/cli/src/deploy/handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ async function deployHandler(
4040
options.workspace || process.cwd(),
4141
'openfn.yaml'
4242
);
43-
if (await fileExists(v2ConfigPath)) {
43+
if (!process.env.PREFER_LEGACY_SYNC && (await fileExists(v2ConfigPath))) {
4444
// override endpoint with one from openfn.yaml
4545
const config = yamlToJson(await fs.readFile(v2ConfigPath, 'utf-8'));
4646
if (config?.project?.endpoint) {
4747
config.endpoint = config.project.endpoint;
4848
}
4949

5050
logger.always(
51-
'Detected openfn.yaml file - switching to v2 deploy (openfn project deploy)'
51+
'Detected openfn.yaml file - switching to v2 deploy (openfn project deploy). Set PREFER_LEGACY_SYNC to disable this.'
5252
);
5353
return beta.handler(
5454
{

packages/cli/src/execute/command.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,40 @@ import type { Opts } from '../options';
88
export type ExecuteOptions = { workspace?: string } & Required<
99
Pick<
1010
Opts,
11-
| 'apiKey'
1211
| 'adaptors'
12+
| 'apiKey'
1313
| 'autoinstall'
1414
| 'baseDir'
1515
| 'cacheSteps'
16+
| 'collectionsEndpoint'
17+
| 'collectionsVersion'
1618
| 'command'
1719
| 'compile'
1820
| 'credentials'
19-
| 'collectionsEndpoint'
20-
| 'collectionsVersion'
21-
| 'expandAdaptors'
2221
| 'end'
23-
| 'immutable'
24-
| 'ignoreImports'
22+
| 'expandAdaptors'
2523
| 'expressionPath'
24+
| 'globals'
25+
| 'ignoreImports'
26+
| 'immutable'
2627
| 'log'
2728
| 'logJson'
29+
| 'only'
2830
| 'outputPath'
2931
| 'outputStdout'
30-
| 'only'
3132
| 'path'
3233
| 'repoDir'
34+
| 'sanitize'
3335
| 'skipAdaptorValidation'
3436
| 'start'
3537
| 'statePath'
3638
| 'stateStdin'
37-
| 'sanitize'
3839
| 'timeout'
3940
| 'trace'
4041
| 'useAdaptorsMonorepo'
41-
| 'workflowPath'
42+
| 'validate'
4243
| 'workflowName'
43-
| 'globals'
44+
| 'workflowPath'
4445
>
4546
> &
4647
Pick<Opts, 'monorepoPath' | 'repoDir'>;
@@ -77,6 +78,7 @@ const options = [
7778
o.timeout,
7879
o.trace,
7980
o.useAdaptorsMonorepo,
81+
o.validate,
8082

8183
po.workspace,
8284
];

packages/cli/src/execute/handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ const executeHandler = async (options: ExecuteOptions, logger: Logger) => {
8787
await validateAdaptors(options, logger);
8888

8989
let plan = await loadPlan(options, logger);
90-
validatePlan(plan, logger);
90+
if (options.validate) {
91+
validatePlan(plan, logger);
92+
}
9193
await loadAndApplyCredentialMap(plan, options, logger);
9294
if (options.cacheSteps) {
9395
await clearCache(plan, options, logger);

0 commit comments

Comments
 (0)