Skip to content

lookup: add yargs#1106

Open
wesleytodd wants to merge 1 commit into
nodejs:mainfrom
wesleytodd:add-yargs
Open

lookup: add yargs#1106
wesleytodd wants to merge 1 commit into
nodejs:mainfrom
wesleytodd:add-yargs

Conversation

@wesleytodd
Copy link
Copy Markdown
Member

Due to yargs/yargs#2509 I believe yargs should be in CITM.

Currently it is failing because yargs does not ship a lockfile and uses prettier so it pulls in prettier breaking formatting changes into lint. I can open a PR to address this in yargs or we can exclude lint here whatever folks prefer (obviously easier to fix here).

Additionally, I think the issue that occurred was on yargs@17 not 18. Do we have precedent for testing multiple majors? I coudln't find any, but honestly express should have this as well until we can EOL v4. So any pointers on that would be great and I can open PRs for that.

Output from `citgm yargs`
./bin/citgm.js yargs
info: starting            | yargs
info: lookup              | yargs
info: lookup-found        | yargs
info: yargs lookup-replace| https://github.com/yargs/yargs/archive/3495aa675d57794a05e84429f3e62fd993009122.tar.gz
info: yargs npm:          | Downloading project: https://github.com/yargs/yargs/archive/3495aa675d57794a05e84429f3e62fd993009122.tar.gz
info: yargs npm:          | Project downloaded 3495aa675d57794a05e84429f3e62fd993009122.tar.gz
info: yargs npm:          | npm install started
info: yargs npm:          | npm install successfully completed
info: yargs npm:          | test suite started
error: failure             | The canary is dead:
error: failing module(s)   |
error: module name:        | yargs
error: version:            | 18.0.0
error: error:              | The canary is dead:
error: error:              | undefined
error:                     | > yargs@18.0.0 prepare
error:                     | > npm run compile
error:                     |
error:                     |
error:                     | > yargs@18.0.0 compile
error:                     | > rimraf build && tsc
error:                     |
error:                     |
error:                     | added 547 packages in 27s
error:                     |
error:                     | > yargs@18.0.0 pretest
error:                     | > npm run compile -- -p tsconfig.test.json
error:                     |
error:                     |
error:                     | > yargs@18.0.0 compile
error:                     | > rimraf build && tsc -p tsconfig.test.json
error:                     |
error:                     |
error:                     | > yargs@18.0.0 test
error:                     | > c8 mocha --enable-source-maps ./test/*.mjs --require ./test/before.mjs --timeout=24000 --check-leaks
error:                     |
error:                     |
error:                     |
error:                     | ✔ should expose yargs-parser as Parser
... <truncated for PR body limit> ...
error:                     | ✔ throws if any async method is used
error:                     |
error:                     |
error:                     | 826 passing (6s)
error:                     | 1 pending
error:                     |
error:                     | --------------------------|---------|----------|---------|---------|--------------------------------
error:                     | File                      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
error:                     | --------------------------|---------|----------|---------|---------|--------------------------------
error:                     | All files                 |     100 |    96.43 |     100 |     100 |
error:                     | yargs                    |     100 |      100 |     100 |     100 |
error:                     | index.mjs               |     100 |      100 |     100 |     100 |
error:                     | yargs/helpers            |     100 |      100 |     100 |     100 |
error:                     | helpers.mjs             |     100 |      100 |     100 |     100 |
error:                     | yargs/lib                |     100 |    96.59 |     100 |     100 |
error:                     | argsert.ts              |     100 |      100 |     100 |     100 |
error:                     | command.ts              |     100 |      100 |     100 |     100 |
error:                     | completion-templates.ts |     100 |      100 |     100 |     100 |
error:                     | completion.ts           |     100 |    93.84 |     100 |     100 | 45-46,98,260,265,343
error:                     | middleware.ts           |     100 |    97.22 |     100 |     100 | 54
error:                     | parse-command.ts        |     100 |      100 |     100 |     100 |
error:                     | usage.ts                |     100 |    95.85 |     100 |     100 | ...304,554,563,565,638,730,826
error:                     | validation.ts           |     100 |    98.42 |     100 |     100 | 69,355
error:                     | yargs-factory.ts        |     100 |    95.72 |     100 |     100 | ...64-2065,2069,2162,2218,2251
error:                     | yerror.ts               |     100 |      100 |     100 |     100 |
error:                     | yargs/lib/platform-shims |     100 |       90 |     100 |     100 |
error:                     | esm.mjs                 |     100 |       90 |     100 |     100 | 53
error:                     | yargs/lib/typings        |     100 |      100 |     100 |     100 |
error:                     | common-types.ts         |     100 |      100 |     100 |     100 |
error:                     | yargs/lib/utils          |     100 |    93.93 |     100 |     100 |
error:                     | apply-extends.ts        |     100 |    95.65 |     100 |     100 | 16
error:                     | is-promise.ts           |     100 |      100 |     100 |     100 |
error:                     | levenshtein.ts          |     100 |    85.71 |     100 |     100 | 28-29
error:                     | maybe-async-result.ts   |     100 |      100 |     100 |     100 |
error:                     | obj-filter.ts           |     100 |      100 |     100 |     100 |
error:                     | process-argv.ts         |     100 |      100 |     100 |     100 |
error:                     | set-blocking.ts         |     100 |       80 |     100 |     100 | 10
error:                     | --------------------------|---------|----------|---------|---------|--------------------------------
error:                     |
error:                     | > yargs@18.0.0 posttest
error:                     | > npm run check
error:                     |
error:                     |
error:                     | > yargs@18.0.0 check
error:                     | > gts lint && npm run check:js
error:                     |
error:                     | version: 24
error:                     |
error:                     | /private/var/folders/k6/4f4fv9855cl79n44vnt6bnxr0000gn/T/de027c5d/yargs/lib/command.ts
error:                     | 794:42  error  Delete `⏎·`                                                                                                                                                                                       prettier/pr
error:                     | 796:3   error  Replace `··Pick<⏎······CommandHandler,⏎······'deprecated'·|·'description'·|·'handler'·|·'middlewares'⏎····` with `Pick<CommandHandler,·'deprecated'·|·'description'·|·'handler'·|·'middlewares'`  prettier/pr
error:                     | 800:1   error  Delete `··`                                                                                                                                                                                       prettier/pr
error:                     |
error:                     | /private/var/folders/k6/4f4fv9855cl79n44vnt6bnxr0000gn/T/de027c5d/yargs/lib/yargs-factory.ts
error:                     | 2378:31  error  Delete `⏎·`  prettier/prettier
error:                     | 2380:1   error  Delete `··`  prettier/prettier
error:                     | 2381:3   error  Delete `··`  prettier/prettier
error:                     | 2382:1   error  Delete `··`  prettier/prettier
error:                     | 2383:3   error  Delete `··`  prettier/prettier
error:                     | 2384:1   error  Delete `··`  prettier/prettier
error:                     | 2385:3   error  Delete `··`  prettier/prettier
error:                     | 2386:1   error  Delete `··`  prettier/prettier
error:                     | 2387:3   error  Delete `··`  prettier/prettier
error:                     | 2388:1   error  Delete `··`  prettier/prettier
error:                     | 2389:3   error  Delete `··`  prettier/prettier
error:                     | 2390:1   error  Delete `··`  prettier/prettier
error:                     | 2391:3   error  Delete `··`  prettier/prettier
error: error:              | 2392:1   error  Delete `··`  prettier/prettier
error:                     | 2393:3   error  Delete `··`  prettier/prettier
error:                     | 2394:1   error  Delete `··`  prettier/prettier
error:                     |
error:                     | ✖ 19 problems (19 errors, 0 warnings)
error:                     | 19 errors and 0 warnings potentially fixable with the `--fix` option.
error:                     |
error:                     |
error:                     | (node:99625) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
error:                     | (Use `node --trace-deprecation ...` to show where the warning was created)
error: done                | The smoke test has failed.
info: duration            | test duration: 41149ms

cc @bcoe @shadowspawn @nicolo-ribaudo

Checklist
  • npm test passes
  • contribution guidelines followed
    here

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.36%. Comparing base (1cbcf4c) to head (f6408f4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1106   +/-   ##
=======================================
  Coverage   96.36%   96.36%           
=======================================
  Files          29       29           
  Lines        2203     2203           
=======================================
  Hits         2123     2123           
  Misses         80       80           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good start; we should absolutely be testing yargs 16, 17, and 18 (any major that supports non-EOL nodes)

@shadowspawn
Copy link
Copy Markdown
Member

Realistically, I do not think Yargs 18 is currently a good candidate for CITGM. The combination of no lockfile and low activity means builds can be broken for long periods: yargs/yargs#2393

Hard Requirements

  • The tests pass on supported major release lines
  • The maintainers of the module remain responsive when there are problems

@ljharb
Copy link
Copy Markdown
Member

ljharb commented May 23, 2026

It's still pretty important to know when a new node release will break it - node 26 breaking yargs 16 and 17 should have delayed the release imo.

@joyeecheung
Copy link
Copy Markdown
Member

joyeecheung commented May 23, 2026

FWIW yargs is already covered in citgm through babel https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/3724/nodes=ubuntu2404-x64/testReport/junit/(root)/citgm/_babel_core_v7_29_0/

node 26 breaking yargs 16 and 17 should have delayed the release imo.

I think there's a misunderstanding about what CITGM does. Failures in the CITGM wouldn't stop an intentional breaking change from landing on semver-major release, given that:

  1. Semver-major releases are meant to ship intentional breaking changes. CITGM for semver-major is only meant for communicating that early to package maintainers to fix them sooner, not for unresponsive packages to block a release that is meant to....break things.
  2. Releasers may or may not pay attention to all the breakages in CITGM output, depending on whether they have time for it, also because CITGM has not been green for years and is always full of noise. The last time any breakages in CITGM delay a release was probably quite a long time ago.

It has the potential of stopping non-semver-major changes from landing on an existing release, or notifying package authors about the breakages in an upcoming semver-major release, though again these still depend on whether anyone volunteers to look at the CITGM results and follows up on it, and whether package maintainers are on top of maintenance.

If the maintenance of of a package is not responsive, then adding it to CITGM only makes CITGM even more red, and make it even less likely for volunteers to look at the failures carefully. Given the stalling of yargs/yargs#2514 , yargs currently fails this hard requirement of adding it to CITGM

The maintainers of the module remain responsive when there are problems

The reason why CITGM wasn't being looked at carefully is also due to having too many broken packages for a long time since the last bankruptcy: #959. Merging this PR is unlikely to change anything, considering the breakages is already in CITGM. For CITGM breakages to realistically block any release again, a volunteer would likely need to do another bankruptcy to restore the trust in CITGM, during which unresponsive packages need to go.

@wesleytodd
Copy link
Copy Markdown
Member Author

I think there's a misunderstanding about what CITGM does.

I don't think it is a misunderstanding, it is aspirational that it does help avoid what happened when this change was released in a minor then reverted.

FWIW yargs is already covered in citgm through babel

I do not believe it is good to rely on transitive usage. If babel decides to switch away from yargs it would not be covered, and it is independently depended on across the ecosystem.

Realistically, I do not think Yargs 18 is currently a good candidate for CITGM. The combination of no lockfile and low activity means builds can be broken for long periods:

Right, this is what I offered to fix. I depend on yargs in too many projects to switch from, and some are not ready to move past 18. Until 18 is not the most depended on major, I think CITGM should test it. Whichever way we want to go about doing that, I am alright with doing.

The reason why CITGM wasn't being looked at carefully is also due to having too many broken packages for a long time since the last bankruptcy

I can't speak to this, but many of the packages which were removed in the bankruptcy were added back. So I think those kind of wake up moments are when folks show up to do this work. Hence me being here asking for yargs to be added back (notice it did make it through the last bankruptcy).

If y'all want to close this because of the problems, that's fine but it does mean less test coverage over critical use cases leading to more breakage in minors (like happened with this).

@joyeecheung
Copy link
Copy Markdown
Member

joyeecheung commented May 26, 2026

it does help avoid what happened when this change was released in a minor then reverted.

Not sure if I am following - it didn't help in 25.7.0, otherwise it would not have gotten released in 25 at all (as it should've shown in the CI through babel before the release)

I do not believe it is good to rely on transitive usage.

While I agree, I meant that if transitive coverage was already not functional, direct coverage would not have made a difference either.

  1. CITGM wasn't run for 26.0.0 at all (probably because it's semver major)
  2. The breakage had been showing up since and there wasn't even a reference about it until the last comment.
  3. It probably was in 25.7.0's CITGM but was neglected (babel had been in CITGM since 2024, 25.7.0 did run CITGM before release, yet the breakage was only caught after 25.7.0 was out by Babel's own CI Do not use the latest Node.js version in CI babel/babel#17826)

So I think those kind of wake up moments are when folks show up to do this work. Hence me being here asking for yargs to be added back (notice it did make it through the last bankruptcy).

To make CITGM trust-worthy again, what we need is to remove broken packages, not adding more broken packages. yargs survived the last bankruptcy because it wasn't broken back then. Adding two more broken versions of an unresponsive package on top of the existing 20+ is not going to help restore the trust in CITGM. I think to actually make this PR work as intended, two things needed to happen

  1. There needs to be some evidence that yargs is still responsive. To add yargs 16 & 17, first these two must be fixed, for example by landing fix: copy yargs/yargs entrypoint file yargs to yargs.cjs yargs/yargs#2514. Having another unresponsive broken package just means CITGM would be neglected even more. There is a reason why responsiveness is a hard requirement in the documented process.
  2. There needs to be some volunteer to remove all the 20+ broken packages from the current CITGM so that it's green again before any more packages are added. The current signal-to-noise ratio is too low. Breakages in CITGM will only serve as good signal if it turns a green CI red, instead of just being buried in 20+ breakages in a CI that had been red for years.

Without those, this PR would be mostly a placebo. The (transitive) coverage of yargs was already neglected in practice. Increase of coverage does not guarantee voluntary attention to the breakages, or on the contrary, coverage of unresponsive packages is likely to warrant further lack of attention.

@ljharb
Copy link
Copy Markdown
Member

ljharb commented May 26, 2026

I would expect CITGM to always be run, especially in a semver-major - it's just that breakage may be expected.

@joyeecheung
Copy link
Copy Markdown
Member

joyeecheung commented May 26, 2026

I think to ensure CITGM is run and properly inspected, there needs to be more volunteer that run CITGM (e.g. using rcs or nightlies) and analyze the results themselves during the releases, and take on the work to notify and coordinate with package maintainers, since the current volunteers helping out don't necessarily have capacity to take care of CITGM carefully, especially for major releases that are already difficult and keep getting postponed due to various build issues (the April releases were already postponed to May two years in a row ultimately due to lack of hands, for example). There also needs to be more volunteers who take on active maintenance to keep CITGM green and produce trust-worthy results without diverting efforts consumed by other issues during releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants