-
Notifications
You must be signed in to change notification settings - Fork 7
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
Automate parameter sync across configs #119
Comments
I think that's doable. The only thing I would be careful about is that anything generated by a such a script needs to be reviewed by a human before being added to the configurations. Regarding 1., it might be worth using the IO routines from OM3-Utils to parse the different configurations. |
Of course if we keep the parameter file layouts very consistent (and I think we should!), we can get away with diff for 1, at least for comparisons between our own configs rather than others. |
Could this be automated too? I think it gets hard to automate with a github action because there are multiple repositories (i.e. MOM6-CICE6 and MOM6-CICE6-WW3) and branches but will only be one set of docs? |
I guess we could start with a script to run after the first PR is merged, which then cherry-picks the changes to the other relevant repos + branches ? I think the script would need to be triggered manually and need input for which branches to make PRs for? |
I'm not sure of the technical limitations of GH Actions being triggered across repos, but the actual submodule updating and table regeneration are already scripted with |
That's what I was thinking. There could be a file supplying the repos and branches to sync. A |
Oh yes - but also some way to specify it on a PR only basis - e.g. to copy only IAF changes to IAF configs, or BGC changes only to BGC etc ... |
Would it be simpler to make draft PRs for all configs, and then cancel the inapplicable ones and manually tweak the rest as needed before merging? |
We may face a similar problem with documentation #120 (comment) |
After some thinking and some further discussions with @aekiss, here is a new proposal about how to automate the parameter synchronisation across repos. The idea would be following. When a developer opens a PR in one of the config repos, they would have the option to specify in a comment a list of commits to be cherry-picked and a target repo/branch. The comment would look like this (exact syntax to be determined later):
Each line in such comment would in turn trigger a github actions pipeline that would perform the following actions:
There are a few advantages of this approach:
|
Could also have a bot provide this list for all possibly relevant repos and branches so we don't miss any. |
This sounds very promising :)
Maybe this could be a checklist with on/off tickboxes?
Also, Dougie at some point suggested we could use the "Labels" feature on github to mark which branches to cherry-pick across to, instead of using the comment? |
This might be possible. We just need to figure out how to make that work in a github action.
That might also be possible, but I suspect the comment will be easier to implement. But worth exploring if people think this would be a good alternative. Note however that one would still need a way of providing a list of commit to cherry-pick, because sometimes it might be desirable to only pick a few selected commits from a branch. |
This would require creating a branch and commit a modification (or an empty commit) to be able to kick-start the GitHub PR process.
It's a neat idea. I'd definitely ask @CodeGat for advice, as he's already done some comment bot workflows so would likely have some wisdom in this area. I'm not sure you're saving a lot doing this through CI though. I think scripting it and using Or get CI to create a first tranche of PRs and require approval to create more. It's something I'm very interesting in as we'd like to implement something like this to trigger PRs when new model versions are deployed. |
I like that idea, if the CI would auto-create a PR for all relevant branches automatically to ensure nothing gets overlooked (which may become important as branches become more numerous). But the auto-generated PRs should be tagged as such (and ideally be made drafts) so it is clear that they need a human to confirm that they should actually go ahead. |
I think having the ability to only cherry-pick to specified branches will be useful. E.g. if we make a change that's only relevant to one resolution, it will be annoying to have to go and close the PRs that were automatically opened for other branches. A middle ground might be to allow pattern-matching repo/branches: # Open PR for all configs
cherry-pick <commit_hash_1> *
# Open PR for all 1 deg configs
cherry-pick <commit_hash_1> */1deg*
# Open PR for all MOM6-CICE6 configs
cherry-pick <commit_hash_1> MOM6-CICE6/* Ofc, we'd then have to keep a list of our configuration branches somewhere. |
@micaeljtoliveira the requirement to cherry-pick across repos would disappear if we have one repo for all configs - see #197 |
It would be good to have cherry-pick instructions here. I'd added a quick mention but it could do with more detail. https://github.com/COSIMA/access-om3/wiki/Git-practices#branch-synchronisation-for-releases |
Also (a trivial thing) we're missing |
We're retaining separate repos for configs with different executables (#197) so it would be good to be able to cherry-pick between configs. It would also be good to be able to cherry-pick to @kieranricardo's CM3 configs to help keep them in sync. |
Just to note: the comparison table can be useful for spotting any forgotten cherry-picks. #211 |
As the number of config branches and repos increases we will need easy ways to
I've made a small foray into 1. with https://github.com/COSIMA/access-om3-doc which has all the config branches as separate submodules in https://github.com/COSIMA/access-om3-doc/tree/main/configs and then auto-generates comparison tables in https://github.com/COSIMA/access-om3-doc/tree/main/tables, e.g.
tables/*/*diff.md
show differences between particular configs. Not sure if this is the best way to go, and it would need modification to work with non-namelist files.Item 2. might be implementable via a cherry-pick script from one config to all the rest for improvements that all configs should have (e.g. bug fixes).
Thoughts, anyone?
The text was updated successfully, but these errors were encountered: