Skip to content

Commit

Permalink
better error message for state/spec mismatch on deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
taylordowns2000 committed Apr 15, 2024
1 parent 65e4031 commit adfb661
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-colts-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openfn/deploy': patch
---

Error message for when workflow found in 'state' but not 'spec' during deploy
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 adfb661

Please sign in to comment.