Get Toolhub setup so that https://www.mediawiki.org/wiki/Libraryupgrader will send us patches for library version bumps so nobody has to have a recurring calendar task to do that kind of work manually.
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T288685 Establish active/active multi-dc support for Toolhub | |||
Resolved | bd808 | T115650 Create an authoritative and well promoted catalog of Wikimedia tools | |||
Resolved | bd808 | T271483 Complete and announce initial production deployment of Toolhub | |||
Resolved | Legoktm | T279741 Integrate with LibUp | |||
Resolved | Legoktm | T273237 LibUp needs to handle "main" branches nicely |
Event Timeline
Change 690803 had a related patch set uploaded (by Legoktm; author: Jforrester):
[labs/libraryupgrader/config@master] Run on wikimedia/toolhub
Change 690803 merged by jenkins-bot:
[labs/libraryupgrader/config@master] Run on wikimedia/toolhub
LibUp hit an error: https://libraryupgrader2.wmcloud.org/logs2/272265
$ ./node_modules/.bin/eslint . -f json Oops! Something went wrong! :( ESLint: 7.26.0 ESLint couldn't find the config "plugin:es/restrict-to-es5" to extend from. Please check that the name of the config is correct. The config "plugin:es/restrict-to-es5" was referenced from the config file in "/src/repo/node_modules/eslint-config-wikimedia/vue-es5.js".
To reproduce:
- Fresh clone of wikimedia/toolhub
- Run npm ci
- Edit package.json to switch eslint-config-wikimedia to 0.20.0
- Run npm install && npm update eslint -depth 10
- Then run ./node_modules/.bin/eslint . and hit the error.
Other things I noticed:
- Running npm test doesn't seem to run the various linters, why not?
- LibUp will work better if the eslint config is in .eslintrc.json rather than package.json, it'll be able to auto-disable failing rules by turning them into warnings so the upgrade happens and humans can re-enable the failing rules at their convenience.
Funny enough when I documented this in T279471: Upgrade to eslint-config-wikimedia 0.20.0, you replied implying that LibUp would magically fix everything. :)
Other things I noticed:
- Running npm test doesn't seem to run the various linters, why not?
Because that's not how I wrote the package.json I guess. The test target runs unit tests and the lint target runs linters. Is there documentation somewhere of expected entrypoints for Wikimedia nodejs projects?
- LibUp will work better if the eslint config is in .eslintrc.json rather than package.json, it'll be able to auto-disable failing rules by turning them into warnings so the upgrade happens and humans can re-enable the failing rules at their convenience.
I think the formats of the package.json eslintConfig section and a .eslintrc.json config file are the same. Would you be just as happy with a patch for LibUp that taught it how to check for the combined config like toolhub uses so that it would work with either setup?
Hah :D Let me look into it further...
Other things I noticed:
- Running npm test doesn't seem to run the various linters, why not?
Because that's not how I wrote the package.json I guess. The test target runs unit tests and the lint target runs linters. Is there documentation somewhere of expected entrypoints for Wikimedia nodejs projects?
See https://www.mediawiki.org/wiki/Continuous_integration/Entry_points and https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Linting
- LibUp will work better if the eslint config is in .eslintrc.json rather than package.json, it'll be able to auto-disable failing rules by turning them into warnings so the upgrade happens and humans can re-enable the failing rules at their convenience.
I think the formats of the package.json eslintConfig section and a .eslintrc.json config file are the same. Would you be just as happy with a patch for LibUp that taught it how to check for the combined config like toolhub uses so that it would work with either setup?
Yep, that would be fine too.
Change 692349 had a related patch set uploaded (by Legoktm; author: Legoktm):
[labs/libraryupgrader@master] Support reading ESLint config from package.json
Change 692349 merged by jenkins-bot:
[labs/libraryupgrader@master] Support reading ESLint config from package.json
Change 692673 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):
[wikimedia/toolhub@main] npm: Use `npm test` as entrypoint for both lint and test
Change 692673 merged by jenkins-bot:
[wikimedia/toolhub@main] npm: Use `npm test` as entrypoint for both lint and test
It's alive! https://gerrit.wikimedia.org/r/c/wikimedia/toolhub/+/692689
Thanks for your help in a) hacking your project to support us and b) sorting out our nodejs deps @Legoktm!