OpenFn / OpenFn/kit

Sync: when fetching a file from a path, CLI will moan about id conflicts

Open
#1,541 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

If you try and fetch, and in particular if you try and fetch to a file, the CLI shouldn't get upset if there's ambiguity in aliases and things.

But that's not what I'm seeing. If you have local project files with id conflcits (same UUID maybe), the CLI wil throw an error.

This is related to #1119

here's a command I just ran

 pnpm openfn project fetch --endpoint localhost --apikey $LOCAL_LIGHTNING_SUPER_PAT 79988b36-80fb-493b-833a-8a6d9a5443f1 -o jam3.yaml

And the error:

[CLI] ✘ MultipleMatchingProjectsError: Failed to resolve unique identifier for "79988b36-80fb-493b-833a-8a6d9a5443f1", clashes with: jam3, jam3
    at matchProject (file:///home/joe/repo/openfn/kit/packages/project/dist/index.js:1982:11)
    at Workspace.get (file:///home/joe/repo/openfn/kit/packages/project/dist/index.js:2068:12)
    at fetchRemoteProject (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:3673:35)
    at fetchV2 (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:3590:31)
    at handler2 (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:3583:10)
    at parse (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:4509:18)
    at process.<anonymous> (file:///home/joe/repo/openfn/kit/packages/cli/dist/process/runner.js:4536:5)
    at process.emit (node:events:509:20)
    at emit (node:internal/child_process:973:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:91:21)

But nothing is ambiguous here. I even passed a UUID which matches and specified an explicit output. All I want is to pull that thing and write it.

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 with the fetch entry points named in the trace: packages/cli/dist/process/runner.js at fetchV2 and fetchRemoteProject, then inspect packages/project/dist/index.js at Workspace.get and matchProject. Reproduce the command with the UUID and explicit jam3.yaml output in a workspace containing duplicate local IDs. Done means the fetch succeeds and writes the requested file without MultipleMatchingProjectsError.

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
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.