CLI: checkout direct from project.yaml - #1533
Conversation
3e59c60 to
648746d
Compare
|
ok, this is merged and caught up. Just need the integration tests and a round of manual testing and I think we're good. |
Several things wrong
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…deploy Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
648746d to
d381c94
Compare
|
It looks like if a workflow is removed, and you try to deploy to a different project, we get a "nothing to deploy" error. That might need raising as a new bug because it's too far removed from this work Ie:
btw deleting a workflow on the OG project DID work, so not sure why this isn't stable |
This comment was marked as resolved.
This comment was marked as resolved.
|
Ok I think this might finally be done- it raised some really tricky questions which I hope I've navigated reasonably well. Tomorrow I'll re-do the manual test suite again before merging |
|
Just hit some drama trying to deploy an exported project.yaml:
The more changes I have to make on this PR the more nervous I get. It's been way, way more work than I antipicated. EDIT: Hang on hang on, that's because the exported project is using the v1 format. All bets are off. That's because the portability PR hasn't been merged in lightning. And is full of conflicts. Damn. Now I have a conundrum: do I fix support for v1 exports (which tbh shoulldn't be super hard) or do I merge and run? I think at this stage I'll raise an issue, merge and run. Opened as #1540. I'll skip the export testing for now. I might come back. |
|
Yet another problem. If you try and deploy a project file directly without We need to disable that extra fetch in load-from-file mode. |
* attempt to fix a deploy to an existing project * fix an issue where the wrong alias gets updated
* support deploying from a v1 spec yaml A v1 spec (as exported from the app) has no uuids and cross-references everything by key, so fromAppState's uuid matching silently mangled it: credentials were dropped and every edge collapsed onto the first job. Convert it to the v2 spec shape instead and let the v2 parser take it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * create to/from-app-spec serializers * tidy * new tests --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
Ok I think this is ready - I'm going to merge it to the release and give the release a test on Monday. I'm thinking about some quick fixes for credentials too, because if you have a credential this basically completely breaks |
Short Description
This PR enables users to run a deploy from a file: either an exported project.yaml (from the app) or from A single v2 state file (the thing created when fetching a project).
Note that if you try and deploy a project to the same instance and the same UUID, it'll just override. In this case you have to pass
--newor set a new name.A side-effect of this work is that you can now edit a local project.yaml file and deploy it directly to lightning - previously the CLI didn't allow this because a deploy would re-build the project.yaml from the local filesystem. Being able to modify the yaml directly is probably a useful escape hatch. But one I'll leave undocumented for now.
Fixes #1264
Bonus fix for #1523
QA Notes
To test this ( I recommend running against local or at least staging)
You can set
OPENFN_ENDPOINTandOPENFN_API_KEYenv vars to configure deploy targets and access and stuff..envfiles work.Scenario 1 - deploy an exported project
openfn project deploy downlaoded-project.yaml --name my-duplicateScenario 2 - re-deploy an existing project
openfn project fetch <uuid> --alias ogog@app.openfn.org.yamlopenfn project deploy ./projects/og@app.openfn.org.yaml --name my-duplicateTest Cases
This PR has crept into some sensitive areas so I want to run a really thorough suite of QA against staging:
export a project spec (v1 and v2?) and deploy as newexport a project spec (v1 and v2?) and deploy to existingAI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy