OpenFn / OpenFn/kit

Deploy: pulling with an invalid project id returns a bad error

Open
#883 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DevX
Dominant language
TypeScript
Stars
21
Forks
23
Avg merge
1d 22h
Merged PRs (30d)
17

Description

openfn pull abc

abc is not a valid project id (it's not a UUID). So I get error output like this:

[CLI] ♦ Downloading existing project state (as JSON) from the server.
Checking https://app.staging.openfn.org/api/provision/abc? for existing project.

[CLI] ✘ Command failed!
[CLI] ✘ Error: Failed to fetch project abc: Bad Request
    at getProject (file:///home/joe/.asdf/installs/nodejs/18.12.1/lib/node_modules/@openfn/cli/node_modules/@openfn/deploy/dist/index.js:694:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async pullHandler (file:///home/joe/.asdf/installs/nodejs/18.12.1/lib/node_modules/@openfn/cli/dist/process/runner.js:1554:31)
    at async parse (file:///home/joe/.asdf/installs/nodejs/18.12.1/lib/node_modules/@openfn/cli/dist/process/runner.js:1778:12)

This is not a useful error message. We should do better in the CLI at helping the user understand the actual problem. I think Lightning could probably be more helpful about this too (although I can't see the error body so I don't know, maybe there's a good message attached).

We also shouldn't be logging a stack trace for an error like this. It doesn't help the user.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing openfn pull abc and trace the pullHandler path in @openfn/cli through the getProject call in @openfn/deploy. Done means an invalid project ID produces a clear explanation of the validation problem and does not print a stack trace.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.