Skip to content
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

Automation for Cookbook repos #86

Open
brian-rose opened this issue Aug 11, 2022 · 4 comments
Open

Automation for Cookbook repos #86

brian-rose opened this issue Aug 11, 2022 · 4 comments
Labels
infrastructure Infrastructure related issue

Comments

@brian-rose
Copy link
Member

We frequently have a need to push identical (or very similar) changes out simultaneously to all Cookbook source repos. One example is changing the URL for the binder link in the _config.yml in each repo as discussed in #85

Currently we have no better option than manually edit and opening identical PRs in each repo.

Two possible alternatives for keeping the infrastructure updated across all repos:

  1. Some kind of bot service (like dependabot) that can automatically open PRs across all repos (e.g. when we make a change in the template repo). This still requires people to inspect and approve the PRs for each repo, but would speed things up and help ensure consistency while still allowing individual Cookbook authors to customize their own infrastructure as necessary
  2. Migrating more of the Cookbook infrastructure out of individual repos and into some centralized repository. For example, instead of hard-coding the Binder URL in each repo's _config.yml, there could be a lookup step. This would mean only opening a single PR to change any of the centralized infrastructure across all Cookbooks.
@jukent jukent added infrastructure Infrastructure related issue needs triage This can be kept if the triager is unsure which next steps to take labels Oct 5, 2022
@clyne
Copy link
Contributor

clyne commented Apr 17, 2023

Labeling this medium priority for now, but this will become high priority as gallery grows.

@clyne clyne added medium priority and removed needs triage This can be kept if the triager is unsure which next steps to take labels Apr 17, 2023
@brian-rose
Copy link
Member Author

Parallel discussion happening in this discourse post

@ahuang11 suggested actions-template-sync as a possible solution. Looks promising!

@brian-rose
Copy link
Member Author

Noting here that I experimented a bit with actions-template-sync in a few different repos (see e.g. this workflow in the XGCM Cookbook and this example PR generated by the workflow).

My conclusion for now is that this is not the right tool for us.

The basic reason is that there are too many merge conflicts between an individual cookbook repo and the template repo -- like any line of code in the template where a generic line like

title: Project Pythia Cookbook Template

is replaced with a more meaningful line.

actions-template-sync by default uses a merge strategy that favors the template in any merge conflict situation.

The result (as can be seen in this example) is a PR that tries to replace a lot of useful content in the cookbook with generic boilerplate from the template -- not what we want!

I played around with different git merge strategy flags but wasn't able to get anything working that applies an intelligent auto-merge-conflict resolution.

@brian-rose
Copy link
Member Author

Of course it is possible to use actions-template-sync to auto-generate a PR, and then manually push changes to that PR before merging. But that seems like more trouble than it's worth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Infrastructure related issue
Projects
Status: Backlog
Development

No branches or pull requests

4 participants