Open zepumph opened 1 month 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).
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:
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.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)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.
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
If the above bash script is called sh.sh
, here is a js script that can be used to update the development branches to point to main:
import child_process from 'child_process';
( async () => {
const branch = 'development';
const results = child_process.execSync( `git branch --list ${branch}`, { shell: true } );
const hasDevBranch = results.toString().trim().length > 0;
hasDevBranch && child_process.execSync( 'bash ../sandbox/sh.sh', { shell: true, stdio: 'inherit' } )
} )();
An alternate approach to keep main more stable:
Some other thoughts about working in branches in https://github.com/phetsims/phet-info/issues/222.
Other ideas written in https://github.com/phetsims/chipper/issues/1345
@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: