phetsims / perennial

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

Support lint in all release branches #347

Closed zepumph closed 7 months ago

zepumph commented 7 months ago

From conversation with @jonathanolson in https://github.com/phetsims/phetcommon/issues/63. We know that lint is working on all release branches as of 2 months ago because of an MR on all sims. The Maintenance tooling runs perennial's grunt rc task, which lints. But what we don't know if we support is linting with only dependencies checked out. We found one error in my PhET-iO Hydrogen MR in https://github.com/phetsims/phetcommon/issues/63. There may be more, the path to test is is:

grunt maintenance
-> maintenance.reset()
-> maintenance.updateCheckouts()

That will hit everything, check it out, built it, and lint it.

Good luck us!

zepumph commented 7 months ago

On hold until https://github.com/phetsims/phetcommon/issues/63 is MR'd.

zepumph commented 7 months ago

I found one to work on:


C:\Users\mjkauzmann\PHET\2git\release-branches\number-line-integers-1.2\number-line-common\js\view\FillableBackgroundNode.ts
  0:0  error  Parsing error: ESLint was configured to run on `C:\Users\mjkauzmann\PHET\2git\release-branches\number-line-integers-1.2\number-line-common\js\view\FillableBackgroundNode.ts` using `parserOptions.project`: <tsconfigRootDir>/tsconfig\all\tsconfig.json
However, that TSConfig does not include this file. Either:
- Change ESLint's list of included files to not include this file
- Change that TSConfig to include this file
- Create a new TSConfig that includes this file and include it in your parserOptions.project
See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file

✖ 1 problem (1 error, 0 warnings)

This is because all/tsconfig doesn't include number-line-common.

zepumph commented 7 months ago

The above problem was the only other one discovered:

``` maintenance> m.updateCheckouts() Updating checkouts (running in parallel with 5 threads) Filter applied. Updating 131: [ 'acid-base-solutions 1.3 phet,phet-io', 'area-builder 1.1 phet', 'area-model-algebra 1.2 phet', 'area-model-decimals 1.2 phet', 'area-model-introduction 1.2 phet', 'area-model-multiplication 1.2 phet', 'arithmetic 1.0 phet', 'atomic-interactions 1.2 phet', 'balancing-act 1.1 phet', 'balancing-chemical-equations 1.2 phet', 'balloons-and-static-electricity 1.3-phetio phet-io', 'balloons-and-static-electricity 1.5 phet', 'beers-law-lab 1.7 phet,phet-io', 'bending-light 1.1 phet', 'blackbody-spectrum 1.0 phet', 'build-a-fraction 1.0 phet', 'build-a-molecule 1.0 phet', 'build-a-nucleus 1.1 phet', 'build-an-atom 1.5-phetio phet-io', 'build-an-atom 1.6 phet', 'calculus-grapher 1.0 phet,phet-io', 'capacitor-lab-basics 1.6 phet,phet-io', 'center-and-variability 1.1 phet,phet-io', 'charges-and-fields 1.0 phet', 'charges-and-fields 1.0-phetio phet-io', 'circuit-construction-kit-ac 1.0 phet', 'circuit-construction-kit-ac-virtual-lab 1.0 phet', 'circuit-construction-kit-dc 1.3 phet,phet-io', 'circuit-construction-kit-dc-virtual-lab 1.3 phet,phet-io', 'collision-lab 1.1 phet', 'color-vision 1.1 phet', 'color-vision 1.2-phetio phet-io', 'concentration 1.5-phetio phet-io', 'concentration 1.7 phet,phet-io', 'coulombs-law 1.0 phet', 'curve-fitting 1.0 phet', 'density 1.1 phet,phet-io', 'diffusion 1.0 phet', 'energy-forms-and-changes 1.4 phet,phet-io', 'energy-skate-park 1.2 phet', 'energy-skate-park 1.3 phet (unpublished)', 'energy-skate-park-basics 1.1 phet', 'energy-skate-park-basics 1.3-phetio phet-io', 'equality-explorer 1.1 phet', 'equality-explorer-basics 1.0 phet', 'equality-explorer-two-variables 1.0 phet', 'expression-exchange 1.1 phet', 'faradays-law 1.3-phetio phet-io', 'faradays-law 1.4 phet', 'forces-and-motion-basics 2.1-phetio phet-io', 'forces-and-motion-basics 2.2-phetio phet-io', 'forces-and-motion-basics 2.3 phet', 'forces-and-motion-basics 2.3-phetio phet-io', 'fourier-making-waves 1.0 phet', 'fraction-matcher 1.2 phet', 'fractions-equality 1.1 phet', 'fractions-intro 1.0 phet', 'fractions-mixed-numbers 1.0 phet', 'friction 1.6 phet,phet-io', 'function-builder 1.2 phet', 'function-builder-basics 1.2 phet', 'gas-properties 1.0 phet', 'gases-intro 1.0 phet', 'gene-expression-essentials 1.0 phet', 'geometric-optics 1.3 phet,phet-io', 'geometric-optics-basics 1.3 phet,phet-io', 'graphing-lines 1.3 phet', 'graphing-quadratics 1.3 phet,phet-io', 'graphing-slope-intercept 1.1 phet', 'gravity-and-orbits 1.5 phet-io', 'gravity-and-orbits 1.6 phet,phet-io', 'gravity-force-lab 2.2 phet,phet-io', 'gravity-force-lab-basics 1.1 phet', 'greenhouse-effect 1.0 phet-io', 'greenhouse-effect 1.2 phet,phet-io', 'hookes-law 1.0 phet', 'isotopes-and-atomic-mass 1.1 phet', 'john-travoltage 1.4-phetio phet-io', 'john-travoltage 1.6 phet', 'keplers-laws 1.1 phet', 'least-squares-regression 1.1 phet', 'make-a-ten 1.0 phet', 'masses-and-springs 1.0 phet', 'masses-and-springs-basics 1.0 phet', 'mean-share-and-balance 1.0 phet', 'molarity 1.4 phet-io', 'molarity 1.5 phet', 'molecule-polarity 1.3 phet,phet-io', 'molecule-shapes 1.6 phet,phet-io', 'molecule-shapes-basics 1.6 phet,phet-io', 'molecules-and-light 1.3-phetio phet-io', 'molecules-and-light 1.5 phet', 'my-solar-system 1.2 phet', 'my-solar-system 1.3 phet,phet-io (unpublished)', 'natural-selection 1.2 phet-io', 'natural-selection 1.3 phet-io', 'natural-selection 1.4 phet-io', 'natural-selection 1.5 phet,phet-io', 'neuron 1.1 phet', 'normal-modes 1.0 phet', ... 31 more items ] Beginning: acid-base-solutions 1.3 phet,phet-io Beginning: area-builder 1.1 phet Beginning: area-model-algebra 1.2 phet Beginning: area-model-decimals 1.2 phet Beginning: area-model-introduction 1.2 phet Beginning: area-model-multiplication 1.2 phet Beginning: arithmetic 1.0 phet Beginning: atomic-interactions 1.2 phet Beginning: balancing-act 1.1 phet Beginning: balancing-chemical-equations 1.2 phet Beginning: balloons-and-static-electricity 1.3-phetio phet-io Beginning: balloons-and-static-electricity 1.5 phet Beginning: beers-law-lab 1.7 phet,phet-io Beginning: bending-light 1.1 phet Beginning: blackbody-spectrum 1.0 phet Beginning: build-a-fraction 1.0 phet Beginning: build-a-molecule 1.0 phet Beginning: build-a-nucleus 1.1 phet Beginning: build-an-atom 1.5-phetio phet-io Beginning: build-an-atom 1.6 phet Beginning: calculus-grapher 1.0 phet,phet-io Beginning: capacitor-lab-basics 1.6 phet,phet-io Beginning: center-and-variability 1.1 phet,phet-io Beginning: charges-and-fields 1.0 phet Beginning: charges-and-fields 1.0-phetio phet-io Beginning: circuit-construction-kit-ac 1.0 phet Beginning: circuit-construction-kit-ac-virtual-lab 1.0 phet Beginning: circuit-construction-kit-dc 1.3 phet,phet-io Beginning: circuit-construction-kit-dc-virtual-lab 1.3 phet,phet-io Beginning: collision-lab 1.1 phet Beginning: color-vision 1.1 phet Beginning: color-vision 1.2-phetio phet-io Beginning: concentration 1.5-phetio phet-io Beginning: concentration 1.7 phet,phet-io Beginning: coulombs-law 1.0 phet Beginning: curve-fitting 1.0 phet Beginning: density 1.1 phet,phet-io Beginning: diffusion 1.0 phet Beginning: energy-forms-and-changes 1.4 phet,phet-io Beginning: energy-skate-park 1.2 phet Beginning: energy-skate-park 1.3 phet (unpublished) Beginning: energy-skate-park-basics 1.1 phet Beginning: energy-skate-park-basics 1.3-phetio phet-io Beginning: equality-explorer 1.1 phet Beginning: equality-explorer-basics 1.0 phet Beginning: equality-explorer-two-variables 1.0 phet Beginning: expression-exchange 1.1 phet Beginning: faradays-law 1.3-phetio phet-io Beginning: faradays-law 1.4 phet Beginning: forces-and-motion-basics 2.1-phetio phet-io Beginning: forces-and-motion-basics 2.2-phetio phet-io Beginning: forces-and-motion-basics 2.3 phet Beginning: forces-and-motion-basics 2.3-phetio phet-io Beginning: fourier-making-waves 1.0 phet Beginning: fraction-matcher 1.2 phet Beginning: fractions-equality 1.1 phet Beginning: fractions-intro 1.0 phet Beginning: fractions-mixed-numbers 1.0 phet Beginning: friction 1.6 phet,phet-io Beginning: function-builder 1.2 phet Beginning: function-builder-basics 1.2 phet Beginning: gas-properties 1.0 phet Beginning: gases-intro 1.0 phet Beginning: gene-expression-essentials 1.0 phet Beginning: geometric-optics 1.3 phet,phet-io Beginning: geometric-optics-basics 1.3 phet,phet-io Beginning: graphing-lines 1.3 phet Beginning: graphing-quadratics 1.3 phet,phet-io Beginning: graphing-slope-intercept 1.1 phet Beginning: gravity-and-orbits 1.5 phet-io Beginning: gravity-and-orbits 1.6 phet,phet-io Beginning: gravity-force-lab 2.2 phet,phet-io Beginning: gravity-force-lab-basics 1.1 phet Beginning: greenhouse-effect 1.0 phet-io Beginning: greenhouse-effect 1.2 phet,phet-io Beginning: hookes-law 1.0 phet Beginning: isotopes-and-atomic-mass 1.1 phet Beginning: john-travoltage 1.4-phetio phet-io Beginning: john-travoltage 1.6 phet Beginning: keplers-laws 1.1 phet Beginning: least-squares-regression 1.1 phet Beginning: make-a-ten 1.0 phet Beginning: masses-and-springs 1.0 phet Beginning: masses-and-springs-basics 1.0 phet Beginning: mean-share-and-balance 1.0 phet Beginning: molarity 1.4 phet-io Beginning: molarity 1.5 phet Beginning: molecule-polarity 1.3 phet,phet-io Beginning: molecule-shapes 1.6 phet,phet-io Beginning: molecule-shapes-basics 1.6 phet,phet-io Beginning: molecules-and-light 1.3-phetio phet-io Beginning: molecules-and-light 1.5 phet Beginning: my-solar-system 1.2 phet Beginning: my-solar-system 1.3 phet,phet-io (unpublished) Beginning: natural-selection 1.2 phet-io Beginning: natural-selection 1.3 phet-io Beginning: natural-selection 1.4 phet-io Beginning: natural-selection 1.5 phet,phet-io Beginning: neuron 1.1 phet Beginning: normal-modes 1.0 phet Beginning: number-compare 1.0 phet Beginning: number-line-distance 1.1 phet Beginning: number-line-integers 1.2 phet Beginning: number-line-operations 1.0 phet Beginning: number-line-operations 1.1 phet (unpublished) Beginning: number-play 1.1 phet Beginning: ohms-law 1.4 phet Beginning: pendulum-lab 1.0 phet failed to build number-line-integers 1.2 phet: Error: grunt.cmd --brands=phet --locales=en --allHTML --debugHTML in ../release-branches/number-line-integers-1.2/number-line-integers failed with exit code 1 stdout: Running "lint-all" task [.............. ] 34.78% number-line-common: C:\Users\mjkauzmann\PHET\3git\release-branches\number-line-integers-1.2\number-line-common\js\view\FillableBackgroundNode.ts 0:0 error Parsing error: ESLint was configured to run on `C:\Users\mjkauzmann\PHET\3git\release-branches\number-line-integers-1.2\number-line-common\js\view\FillableBackgroundNode.ts` using `parserOptions.project`: /tsconfig\all\tsconfig.json However, that TSConfig does not include this file. Either: - Change ESLint's list of included files to not include this file - Change that TSConfig to include this file - Create a new TSConfig that includes this file and include it in your parserOptions.project See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file ✖ 1 problem (1 error, 0 warnings) [........................................] 100.00% All results (repeated from above) C:\Users\mjkauzmann\PHET\3git\release-branches\number-line-integers-1.2\number-line-common\js\view\FillableBackgroundNode.ts 0:0 error Parsing error: ESLint was configured to run on `C:\Users\mjkauzmann\PHET\3git\release-branches\number-line-integers-1.2\number-line-common\js\view\FillableBackgroundNode.ts` using `parserOptions.project`: /tsconfig\all\tsconfig.json However, that TSConfig does not include this file. Either: - Change ESLint's list of included files to not include this file - Change that TSConfig to include this file - Create a new TSConfig that includes this file and include it in your parserOptions.project See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file ✖ 1 problem (1 error, 0 warnings) Fatal error: Lint failed Beginning: ph-scale 1.6 phet,phet-io Beginning: ph-scale-basics 1.5 phet-io Beginning: ph-scale-basics 1.6 phet,phet-io Beginning: plinko-probability 1.1 phet Beginning: projectile-motion 1.0 phet Beginning: proportion-playground 1.0 phet Beginning: quadrilateral 1.1 phet Beginning: ratio-and-proportion 1.2 phet Beginning: reactants-products-and-leftovers 1.2 phet Beginning: resistance-in-a-wire 1.3-phetio phet-io Beginning: resistance-in-a-wire 1.6 phet Beginning: rutherford-scattering 1.1 phet Beginning: sound-waves 1.1 phet Beginning: states-of-matter 1.2 phet,phet-io Beginning: states-of-matter-basics 1.2 phet,phet-io Beginning: trig-tour 1.0 phet Beginning: under-pressure 1.1 phet Beginning: unit-rates 1.0 phet Beginning: vector-addition 1.0 phet Beginning: vector-addition-equations 1.0 phet Beginning: wave-interference 2.0 phet Beginning: wave-on-a-string 1.1 phet Beginning: waves-intro 1.1 phet Done maintenance> ```
zepumph commented 7 months ago

Ok, the number-line-integers lint fix was pushed and deployed over in https://github.com/phetsims/number-line-integers/issues/132.

I'm tempted to use ReleaseBranch which is already doing something quite similar to this, but outfitting it for main, and to use phetLibs instead of what is in the checked in dependencies.json. I'll see how it goes.

zepumph commented 7 months ago
```diff Subject: [PATCH] add author annotations (lint fix), https://github.com/phetsims/chipper/issues/1414 --- Index: js/common/ReleaseBranch.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/js/common/ReleaseBranch.js b/js/common/ReleaseBranch.js --- a/js/common/ReleaseBranch.js (revision 78025b7ae6064e9ab5260cea5e532f3bf24c3ec8) +++ b/js/common/ReleaseBranch.js (date 1704483548021) @@ -46,6 +46,7 @@ module.exports = ( function() { const MAINTENANCE_DIRECTORY = '../release-branches'; + const MAIN_RELEASE_BRANCHES_DIRECTORY = '../release-branches-main'; class ReleaseBranch { /** @@ -192,16 +193,34 @@ ); } + /** + * @public + */ + static async updateCheckoutFromMain( repo ) { + // get phetlibs + // implementation( dependencies); + await ReleaseBranch.ensureDirectory( MAIN_RELEASE_BRANCHES_DIRECTORY ); + + } + + /** + * @private + */ + static async ensureDirectory( directory = MAINTENANCE_DIRECTORY ) { + if ( !fs.existsSync( directory ) ) { + winston.info( `creating directory ${directory}` ); + await createDirectory( directory ); + } + } + /** * @public */ async updateCheckout( overrideDependencies = {} ) { winston.info( `updating checkout for ${this.toString()}` ); - if ( !fs.existsSync( MAINTENANCE_DIRECTORY ) ) { - winston.info( `creating directory ${MAINTENANCE_DIRECTORY}` ); - await createDirectory( MAINTENANCE_DIRECTORY ); - } + await ReleaseBranch.ensureDirectory(); + const checkoutDirectory = ReleaseBranch.getCheckoutDirectory( this.repo, this.branch ); if ( !fs.existsSync( checkoutDirectory ) ) { winston.info( `creating directory ${checkoutDirectory}` );
zepumph commented 7 months ago
  • [ ] All that is left here is to come up with a way to test this from main so we know when this problem occurs eagerly.

To be done in https://github.com/phetsims/aqua/issues/202.