Skip to content
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

CLI Deploy: bad error message if project yaml has a workflow not in state json #713

Closed
josephjclark opened this issue Jun 10, 2024 · 0 comments · Fixed by #714
Closed

CLI Deploy: bad error message if project yaml has a workflow not in state json #713

josephjclark opened this issue Jun 10, 2024 · 0 comments · Fixed by #714
Labels
bug Something isn't working user reported

Comments

@josephjclark
Copy link
Collaborator

josephjclark commented Jun 10, 2024

I don't really know how this state occurs, but if state.json and project.yaml lose sync, and a workflow exists in the project but not the state, you get an unhelpful error message:

Workflow found in project state but not spec. Spec: undefined State: [object Object]

[CLI] ✘ Command failed!
[CLI] ✘ Error: Cannot continue: workflow from state not found in spec.
 at file:///d/repo/openfn/kit/packages/deploy/dist/index.js:344:17
    at Array.map (<anonymous>)
    at mergeSpecIntoState (file:///d/repo/openfn/kit/packages/deploy/dist/index.js:311:50)
    at deploy (file:///d/repo/openfn/kit/packages/deploy/dist/index.js:636:21)
    at async deployHandler (file:///d/repo/openfn/kit/packages/cli/dist/process/runner.js:1177:18)

I would also love stack traces to be removed from these errors, unless perhaps logging in debug mode. It's not helpful and looks like the CLI is broken

Repro Steps

  • Pull a project from lightning (I like to use demo but you can use local or app or whatever you want)
  • rename one of the workflows in your project.yaml (do not remove it, just rename it)
  • Run pull on the same project

Note that straight deleting a workflow from state.json seems to cause a different problem which also needs investigating. All the step/trigger ids seem to change, like it's confusing workflows (like it's applying the ids from the removed workflow to the remaining workflow).

@github-project-automation github-project-automation bot moved this to New Issues in v2 Jun 10, 2024
@christad92 christad92 added bug Something isn't working user reported labels Jun 10, 2024
@github-project-automation github-project-automation bot moved this from New Issues to Done in v2 Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user reported
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants