Skip to content

Commit

Permalink
Merge pull request #663 from OpenFn/error-msg-for-missing-wf
Browse files Browse the repository at this point in the history
better error message for state/spec mismatch on deploy
  • Loading branch information
josephjclark authored Apr 17, 2024
2 parents 94cec66 + 176dc39 commit fbfc86f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
7 changes: 7 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @openfn/cli

## 1.2.2

### Patch Changes

- Updated dependencies [adfb661]
- @openfn/deploy@0.4.5

## 1.2.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/cli",
"version": "1.2.1",
"version": "1.2.2",
"description": "CLI devtools for the openfn toolchain.",
"engines": {
"node": ">=18",
Expand Down
6 changes: 6 additions & 0 deletions packages/deploy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @openfn/deploy

## 0.4.5

### Patch Changes

- adfb661: Error message for when workflow found in 'state' but not 'spec' during deploy

## 0.4.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openfn/deploy",
"version": "0.4.4",
"version": "0.4.5",
"description": "Deploy projects to Lightning instances",
"type": "module",
"exports": {
Expand Down
11 changes: 11 additions & 0 deletions packages/deploy/src/stateTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ export function mergeSpecIntoState(
];
}

if (!specWorkflow && !isEmpty(stateWorkflow || {})) {
console.log(
'Workflow found in project state but not spec.',
`Spec: ${specWorkflow}`,
`State: ${stateWorkflow}`
);
throw new Error(
'Cannot continue: workflow from state not found in spec.'
);
}

return [
workflowKey,
{
Expand Down

0 comments on commit fbfc86f

Please sign in to comment.