Gatsby: Move official starters into monorepo

Created on 19 Jul 2017  Â·  11Comments  Â·  Source: gatsbyjs/gatsby

That way we can consolidate tooling + issues + PRs here.

We still want the code to be published to the individual repos however to make it easy to install. So we should have a hook which pushes changes to their folders in the monorepo to the starter repos.

help wanted

Most helpful comment

NOT STALE!

All 11 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

NOT STALE!

Automating the synchronization between the monorepo and the starter repos is not trivial but I think it could be done if you're open to setting up a peril instance for the Gatsby org.

Peril allows you to route different GitHub event hooks to a file with some work to be done using the GitHub API. Here is an example of a script we use at Moya to attempt to automatically label issues using keywords in the issue title.

I think it could be achieved with the following workflow:

  1. Listening for a PR closed webhook where the status is merged
  2. Checking if the PR's modified files contain any starter repo files
  3. Create a new branch at the specific starter repo to do work on
    (the parent directory for the modified files would indicate which repo we need to modify)
  4. Download the contents of each of the modified files at the monorepo
  5. Create a commit for the contents of each modified file
  6. Push the commits
  7. Open a PR against the respective starter repo and wait for maintainer to approve/merge

If you are open to using Peril at Gatsby, then this is something I could potentially hack on. And of course, I'm open to simpler workflows if anyone has a better idea.

Sounds great! And is pretty much the algorithm I was thinking of. Except we don't need to open a PR against the starters — they would be read-only copies of the main repo so we should just commit the updates and push them.

@KyleAMathews My reasoning for opening a PR was to make sure none of the intermediate commits failed and that the changes are not corrupt. I guess the bot could open an issue on the starter repo for any failures, as part of an error handling mechanism.

So all of this would require a Gatsby organization owner to set up the peril server on Heroku whenever someone has the free time to do so.

It does take a little bit of time to setup but IMO is a worthwhile investment for Gatsby because it would allow you to automate other things as well:

  • Automatically commenting/redirecting users who open PR's against a starter repo
  • Automatically labeling PRs with the documentation label if they only contain changes to .md files
  • Anything else your creative mind thinks of 😆

@SD10 Hey! I've just created a Heroku app and configured it according to the doc you sent over. I'd love to get you up and running with whatever you need to get peril going on the Gatsby org. Please let me know what you need and how I can help. I'll do my best to find resources, etc. quickly.

Do you still have time/interest in tackling this?

Thanks!

Hey @jlengstorf,

In addition to the Heroku app, Gatsby would also need a GitHub App and a settings repo to store the scripts. Were you able to set those up? These tasks require Gatsby organization owner permissions.

Aside from getting peril setup, I would probably be ~2 weeks out from being able to build this specific feature as I'm adjusting to a new job. Simpler features could be done before then of course.

I'm open to a Google Hangout or some kind of meeting if you would like to talk in greater detail about the setup process or other specifics. Can also DM me on Twitter @_SD10_

Great! I set up the app, but didn't set up a repo. I'll get that done
shortly. Let's do a call to make sure you've got everything you need — I'll
DM you on Twitter to coordinate.

Thanks so much for your help with this!

--

Jason Lengstorf
Find me online: Twitter https://twitter.com/jlengstorf · GitHub
https://github.com/jlengstorf · LinkedIn
https://linkedin.com/in/jlengstorf/

Oversharing at lengstorf.com https://lengstorf.com/

@DSchau ok to close this now that your work in https://github.com/gatsbyjs/gatsby/pull/10310 has been merged?

✅

(closing!)

🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benstr picture benstr  Â·  3Comments

dustinhorton picture dustinhorton  Â·  3Comments

Oppenheimer1 picture Oppenheimer1  Â·  3Comments

3CordGuy picture 3CordGuy  Â·  3Comments

rossPatton picture rossPatton  Â·  3Comments