phetsims / perennial

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

MR process: isFirstVersion is unexpectedly true #283

Closed samreid closed 1 year ago

samreid commented 1 year ago

During https://github.com/phetsims/chipper/issues/1337 @mattpen and I were surprised to see

maintenance> Maintenance.deployProduction()
Running production deploy for arithmetic 1.0
isFirstVersion true

This is on a sim that is not the first version. Also we were shocked that the following line didn't trigger:

    console.log( 'isFirstVersion', isFirstVersion );

    // Initial deployment nags
    if ( isFirstVersion ) {
      if ( !await booleanPrompt( 'Is the master checklist complete (e.g. are screenshots added to assets, etc.)', noninteractive ) ) {
        throw new Error( 'Aborted production deployment' );
      }
    }

What is going on?

UPDATE: In batch mode for maintenance, the booleanPrompt is suppressed. But we still need to know what is wrong with the metadata.

zepumph commented 1 year ago

This is on a sim that is not the first version.

Great catch! The promise that the simMetadata request returns will never have a projects field.

Here is script I used to test this:

```js ( async () => { const simMetadata = require( '../perennial/js/common/simMetadata' ); const repo = 'arithmetic'; const metadataResulst = await simMetadata( { simulation: repo } ); const isFirstVersion = !( await simMetadata( { simulation: repo } ).projects ); console.log( isFirstVersion, !metadataResulst.projects ); } )(); ```

Also we were shocked that the following line didn't trigger:

If noninteractive, then it will always answer yes, so it shouldn't have errored.

samreid commented 1 year ago

Looks great, thanks! Closing.