phetsims / perennial

Maintenance tools that won't change with different versions of chipper checked out
MIT License
2 stars 5 forks source link

Deployments can have unclean dependencies #310

Open chrisklus opened 1 year ago

chrisklus commented 1 year ago

While creating a new dev version, I accidentally forgot to revert some changes in a dependency repo, and so they were incorrectly included in the dev version. This was not caught because the deployment process only checks if the repo being deployed has a clean git status, not its dependencies, as @zepumph discovered when looking at gitIsClean. It was expressed on Slack that it seems incorrect to be able to create a dependencies.json without valid shas. The same check is used in rc.js and production.js, so the problem could be happening there too but it's unclear to me if those are verifying shas some other way.

Slack thread:

Chris Klusendorf [14 hours ago](https://phetsims.slack.com/archives/C6HPE0J91/p1678843782172079) i was just able to create a dev version with working copy changes (that i meant to revert). i think this used to be be caught by the grunt dev process. anyone know if that was an intentional change? 7 replies Chris Klusendorf [14 hours ago](https://phetsims.slack.com/archives/C6HPE0J91/p1678843821255609?thread_ts=1678843782.172079&cid=C6HPE0J91) or maybe i’m making that memory up? Sam Reid [14 hours ago](https://phetsims.slack.com/archives/C6HPE0J91/p1678843855499799?thread_ts=1678843782.172079&cid=C6HPE0J91) I don’t recall for certain, but perhaps it was always “best practice” but not enforced? Chris Malley [14 hours ago](https://phetsims.slack.com/archives/C6HPE0J91/p1678843907232549?thread_ts=1678843782.172079&cid=C6HPE0J91) It seems wrong that you can create a dependencies.json without valid shas. :+1::+1::skin-tone-2: 2 Chris Klusendorf [14 hours ago](https://phetsims.slack.com/archives/C6HPE0J91/p1678844533430899?thread_ts=1678843782.172079&cid=C6HPE0J91) I’ll create an issue when back at my computer Michael Kauzmann :octopus: [13 hours ago](https://phetsims.slack.com/archives/C6HPE0J91/p1678846440702749?thread_ts=1678843782.172079&cid=C6HPE0J91) These lines are in the dev process, so perhaps a bug in gitIsClean? const isClean = await gitIsClean( repo ); if ( !isClean ) { throw new Error( `Unclean status in ${repo}, cannot deploy` ); } Michael Kauzmann :octopus: [13 hours ago](https://phetsims.slack.com/archives/C6HPE0J91/p1678846460646339?thread_ts=1678843782.172079&cid=C6HPE0J91) Oh. Only for that repo, not dependencies. Perhaps make an issue for dependencies! Chris Klusendorf [13 hours ago](https://phetsims.slack.com/archives/C6HPE0J91/p1678847690738309?thread_ts=1678843782.172079&cid=C6HPE0J91) ooh that makes sense, thanks! will do
chrisklus commented 1 year ago

May be related to or a duplicate of https://github.com/phetsims/perennial/issues/223

zepumph commented 1 year ago

After the above commit, when I add a working copy change to utterance-queue and grunt grunt dev, I get this error:


 mjkauzmann ~/PHET/git/my-solar-system (master)
 $ grunt dev --brands=phet
Running "dev" task
(Forwarding task to perennial)
Running "dev" task
info: getting dependencies.json for my-solar-system
Fatal error: Perennial task failed:
Error: Unclean status in utterance-queue, cannot deploy
    at module.exports (C:\Users\mjkauzmann\PHET\git\perennial\js\grunt\dev.js:78:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C:\Users\mjkauzmann\PHET\git\perennial\js\grunt\Gruntfile.js:380:7
    at async wrap (C:\Users\mjkauzmann\PHET\git\perennial\js\grunt\Gruntfile.js:44:7)
Full Error details:
Error: Unclean status in utterance-queue, cannot deploy
Fatal error: perennial grunt "--repo=my-solar-system" "dev" "--brands=phet" failed with code 1

@chrisklus please take a look and see what you think. Is there any worry that this is overstepping?