-
Notifications
You must be signed in to change notification settings - Fork 14
Deploy: fixes to support version history properly #1237
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
base: main
Are you sure you want to change the base?
Conversation
|
So the deploy stuff seems to be working. Got a problem now where I'm getting conflicts every time I pull, even when tehre aren't conflicts (remote is ahead of local so we can just overwrite). This might be because I'm doing a generic merge - but like on deploy, the test is a little different to general merge test Also I've messed the tests up but that's kind of anticipated - will fix soon |
|
Bit of a revelation here after lunch. if the provisioner is sending correct version histories, and if the version algorithm is the same in CLI and app - then we don't need forked from. The So if you check out a workflow, and generate the version hash for it, you know if the workflow has changed since the last fetch because the local version is not in the workflow history. You also know if the remote version is ahead of unchanged local because the local version is in the remote history, just not at the head. If you check out locally and made an edit, the local version hash should be different to the head of history. So I think we have all the information we need to make good decisions here, and shouldn't need to use the fork_version metadata. Ah no that's not quite right:
Phew. Complex. We do still need forked_version. |
|
I've been thinking a lot about merge logic over the last couple of days and I'm worried I'm about to start building a lot into the CLI I think really the Project package needs to support the different kinds of merge: like syncing a local to a remote is a pariticular strategy (we detect locally changed ones, merge those into the remote, and throw if there's any remote divergence in fetched from). That's different a general "merge all these workflows into that", which I don't think does any history checking. I need to think about this more, but it's an extension of the merge |
version hash now matches Lightning
…kit into version-history-fix
We'll use this on deploy to ensure that only locally changed workflows get replaced in the merge
|
Struggled a bit with version history. Aside from a bug in lightning, I've discovered that checking for divergence on fetch is impossible in the CLI unless we always include the whole version history without squashing. Because if a version is squashed, the CLI can't compare it's local project with the remote one to decide if there's been a divergence. I panicked for minute but the answer here is: why is fetch checking for divergence? Fetch should just download the latest version and save it to the local project.yaml file. This works on the assumption that project.yaml is never edited by a human. Because that's what the project file is - just like the old state file, it's just as snapshot of the server we pulled from. It should never be modified by the user. Where we do need a divergence test is checkout. But here, local history is sufficient. On check out (whatever we're checking out from), if our active version has different to the I need to ensure there's a really good doc resource that details all this version and state theory. Because it's complex and subtle. It works great when you don't think about it - but any new user coming in to dev this stuff needs to really understand it. A good usecase for AI docs. |
|
So I think all that's left here is to update deploy to use the only-merge-new flag, plus whatever tests are needed. |
Several fixes to deploy to take version history into account
forked_frommap from each workflow into openfn.yamlNote that to work properly, this needs an update on the lighting side. I think I'm gonna sync releases.
Fixes #1231
So in short:
TODO:
Need to run a full checkout after the deploy step (so that new workflows and stuff are properly represented)
Testing notes:
AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy