citgm icon indicating copy to clipboard operation
citgm copied to clipboard

lookup: add next

Open styfle opened this issue 1 year ago • 24 comments

Checklist
  • [x] npm test passes
  • [x] contribution guidelines followed here
Related
  • Closes https://github.com/nodejs/citgm/issues/1017

Co-authored-by: Ethan Arrowood [email protected]

styfle avatar Jan 09 '24 19:01 styfle

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (419202a) 96.33% compared to head (a693d85) 95.04%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1044      +/-   ##
==========================================
- Coverage   96.33%   95.04%   -1.29%     
==========================================
  Files          28       28              
  Lines        2181     2181              
==========================================
- Hits         2101     2073      -28     
- Misses         80      108      +28     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jan 09 '24 19:01 codecov-commenter

@GeoffreyBooth It looks like windows has been failing on main for awhile https://github.com/nodejs/citgm/commits/main

Furthermore, I'm not sure if citgm actually runs any tests against the lookup.json file that I modified.

styfle avatar Jan 09 '24 20:01 styfle

@GeoffreyBooth does the CI run citgm-all ? I think that's the only way lookup.json is used, right?

Ethan-Arrowood avatar Jan 09 '24 20:01 Ethan-Arrowood

I’m not very knowledgeable of how CITGM works. Perhaps @targos knows?

GeoffreyBooth avatar Jan 09 '24 20:01 GeoffreyBooth

Here's a first test run: https://github.com/nodejs/citgm/actions/runs/7466807218

targos avatar Jan 09 '24 20:01 targos

CI doesn't run citgm-all. It takes too long and must be run manually.

targos avatar Jan 09 '24 20:01 targos

Looks like it didn't install correctly: https://github.com/nodejs/citgm/actions/runs/7466807218/job/20319001003#step:5:12

Ethan-Arrowood avatar Jan 09 '24 21:01 Ethan-Arrowood

This should fix it: https://github.com/vercel/next.js/pull/60443

styfle avatar Jan 09 '24 22:01 styfle

@targos Can you try once more now that its fixed?

styfle avatar Jan 09 '24 22:01 styfle

https://github.com/nodejs/citgm/actions/runs/7466807218

targos avatar Jan 10 '24 07:01 targos

Looks like we may need to skip on windows.

Otherwise it seems to have passed on mac and linux 🎉

Ethan-Arrowood avatar Jan 10 '24 15:01 Ethan-Arrowood

@targos I added skip win32. Please run once more (Third time's the charm ☘️ )

styfle avatar Jan 10 '24 15:01 styfle

OK, let's do a full run in Jenkins.

targos avatar Jan 10 '24 15:01 targos

v18: https://ci.nodejs.org/job/citgm-smoker-nobuild/1579/ v20: https://ci.nodejs.org/job/citgm-smoker-nobuild/1580/ v21: https://ci.nodejs.org/job/citgm-smoker-nobuild/1581/

targos avatar Jan 10 '24 15:01 targos

@targos Looks like pnpm support isn't quite working. Its not selecting the correct version of pnpm

https://ci.nodejs.org/job/citgm-smoker-nobuild/nodes=rhel8-x64/1580/testReport/(root)/citgm/next_v14_0_4/

ERR_PNPM_UNSUPPORTED_ENGINE Unsupported environment (bad pnpm and/or Node.js version)
 Your pnpm version is incompatible with "/home/iojs/tmp/citgm_tmp/12755dbb-db09-4e8a-975e-85e8c56c01ad/next".
 Expected version: 8.14.0
 Got: 8.14.1

I think we need to make sure corepack enable pnpm is run as the first step so the correct version is selected from package.json https://nodejs.org/api/corepack.html

styfle avatar Jan 10 '24 16:01 styfle

pnpm is not installed on CI hosts. It's a dependency of the citgm package: https://github.com/nodejs/citgm/commit/46d35aef9057c081c8a04cbe9f01cdf1df72112f

targos avatar Jan 11 '24 12:01 targos

@targos Interesting. Then perhaps citgm should utilize corepack. Or at least manually read the packageManger field in package.json to select the correct version of the package manger.

styfle avatar Jan 11 '24 14:01 styfle

@targos Interesting. Then perhaps citgm should utilize corepack. Or at least manually read the packageManger field in package.json to select the correct version of the package manger.

Why does it need to use a precise version of pnpm? Surely 8.14.0 and 8.14.1 aren’t that different?

GeoffreyBooth avatar Jan 11 '24 16:01 GeoffreyBooth

@GeoffreyBooth Next.js is a highly visible project that receives many PRs. We lock down the package manager version so that contributors fail fast when they have the wrong pnpm installed rather than then submitting an issue saying it doesn't work and we have to ask for system details, etc.

In theory, a patch version should't matter, but in practice it can and there is no reason to leave it open for interpretation. Thats probably the same reason why the packageManager field doesn't allow ranges - it has to be exact.

Thankfully, there is a tool to solve this now: corepack. So most of the citgm logic for package manager selection could probably be deferred to corepack.

styfle avatar Jan 11 '24 19:01 styfle

Okay, do you want to update CITGM accordingly?

GeoffreyBooth avatar Jan 11 '24 22:01 GeoffreyBooth

Would that be this workflow file? https://github.com/nodejs/citgm/blob/44548b7226aa3d513f745834543f1342a6b79d10/.github/workflows/test-module.yml#L59 Where is the one that Node.js uses?

Ethan-Arrowood avatar Jan 11 '24 23:01 Ethan-Arrowood

I can’t seem to find the place where package managers are installed? Can you share the line of code?

styfle avatar Jan 11 '24 23:01 styfle

They're just dependencies of CITGM, so they'd get installed via that.

GeoffreyBooth avatar Jan 12 '24 01:01 GeoffreyBooth

Should I add corepack support to citgm?

Perhaps right before install here?

https://github.com/nodejs/citgm/blob/12e6902b7a90c42edf60a1f4aa0ef9c19efdfddc/lib/package-manager/install.js#L99

styfle avatar Mar 09 '24 21:03 styfle