phetsims / tasks

General tasks for PhET that will be tracked on Github
MIT License
5 stars 2 forks source link

We need development branches! #1134

Open zepumph opened 1 week ago

zepumph commented 1 week ago

@samreid and I have been working on https://github.com/orgs/phetsims/projects/94/views/6 over the past few iterations and trying to make progress on main is totally untenable. Also creating N branches per repo is more boilerplate than needed. My vote is for a consistently named branch in every repo called "development".

Note that this also bit a use in our scenery stack community. We need to stop developing on main.

Steps:

  1. Do we like the name "development"? I do, but it is a bit long to type in the terminal.
  2. Note that currently there are a few one-off branches called development. Those should be renamed or deleted for clarity before doing anything here.
  3. Tool to checkout all development branches (and create/track if not created).
  4. Tool to merge all branches (probably just for-each.sh is fine for now).
  5. Process for knowing what devs are working on development branches so that we know when we can merge to main. Likely this isn't going to be too challenging, since few devs work in cross-repo scary changes for extended periods of time.
zepumph commented 3 days ago

Supporting dev branches on ct:

@samreid feel like it may not be too challenging to get the CT main server set up to run on branches called development. We potentially found only three spots that would need changing (searching for 'main' and cloning).

zepumph commented 2 days ago

We were in the process of trying to use the development branches from last week this morning and had an extensive investigation about how to sync main back into development branches. We found three potential ways forward:

  1. with development checked out, git merge main. This resulted in unexpected conflicts and did not successfully make development be "exactly" main. This strategy may be necessary though if multiple devs/projects were working on development branches.
  2. Forcively point the dev branch to the sha at main. Then force push to overwrite origin: git branch -f development SHA git push -f We found that another computer was able to seamlessly checkout and pull this change. Notes about this: 1. You CANNOT be on development branch when running this. Also, it is easier to type this instead of knowing the sha: git branch -f development main (still need to force push)
  3. Delete the branch locally and create it again from the tip of main. Again we needed to force push (while also setting up tracking with origin). Pretty equal to (2), it was equally as seemless on the other-dev side in pulling the changes.

It looked like this to pull after the force push:

 mjkauzmann ~/PHET/git/perennial (development)
 $ git pull
From https://github.com/phetsims/perennial
 + 92293a9...3feacdc development -> origin/development  (forced update)
Successfully rebased and updated refs/heads/development.
zepumph commented 1 day ago
zepumph commented 1 day ago

Running this script in chipper and perennial was a nice starting point for the next time I wanted to use development branches.

git checkout main
git pull
git branch -f development main
git checkout development
git push -f