Generating project.yaml fails on certain projects
We have at least two edge cases that are creating failures on the exporter/cli openfn pull:
Duplicate Keys
This one was a known issue before, and we should likely solve it in the short term by enforcing unique names for all jobs in a project. I thought that this was done (maybe @elias-ba ?) a while ago, but apparently not.
Not a map when no workflows exist.
When a user first sets up github sync (or runs openfn pull) on a newly created project (which is a part of the migration path) this error will occur because there are no workflows in the project.
Checking https://app.openfn.org/api/provision/*** for existing project.
Project found.
[CLI] ♦ Downloading the project spec (as YAML) from the server.
[CLI] ✘ ERROR: invalid spec
[CLI] ✘ [
{
"message": "workflows: must be a map",
"path": [
"workflows"
]
}
]
update here @stuartc , looks like this is not a bug with the exporter. (see test below) @josephjclark , we will need to update the CLI to accept cases where we try to import a project that does not yet contain any workflows. i'll investigate that side and open an issue
Closing this and opening #2494 to track the pending issue here.