Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a linter/fix script for mdn_urls #23431

Merged
merged 8 commits into from
Jun 26, 2024
Merged

Conversation

Elchi3
Copy link
Member

@Elchi3 Elchi3 commented Jun 18, 2024

This PR uses the mdn/content inventory and mdn/content's _redirect.txt file to update mdn_urls automatically.

  • It removes 404 mdn_urls
  • It replace redirect urls with the new url per the redirect file
  • It replaces wrong casing
  • It adds new mdn_urls when pages have been found existing at conventional places.

It works with the https://www.npmjs.com/package/@ddbeck/mdn-content-inventory package. Whenever dependabot updates this dependency it might be that this lint fails, maintainers can then look at the failures and run npm run fix to update mdn_urls automatically and, if needed, make manual changes.

The initial update to mdn_urls (that will make this PR pass CI) is #23481 and so this PR is blocked by having #23481 merged.

@github-actions github-actions bot added infra 🏗️ Infrastructure issues (npm, GitHub Actions, releases) of this project linter 🏡 Issues or pull requests regarding the tests / linter of the JSON files. dependencies ⛓️ Pull requests that update a dependency package or file. labels Jun 18, 2024
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
lint/linter/test-mdn-urls.ts Outdated Show resolved Hide resolved
@Elchi3 Elchi3 marked this pull request as ready for review June 21, 2024 08:06
@Elchi3 Elchi3 requested a review from queengooborg June 22, 2024 11:22
@Josh-Cena
Copy link
Member

See #23481 (review)

@Elchi3
Copy link
Member Author

Elchi3 commented Jun 24, 2024

@Josh-Cena

FWIW this seems slightly inconvenient in the context of fixing MDN gaps, since every new doc now also requires a BCD update, but I think it's generally an improvement, and it'll probably take us a long while to fix all MDN gaps...

Thanks for your feedback. What you describe is already happening and leads to lots of PRs and review work which IMO can be automated. My intent with this PR is to actually prevent PRs like #23499 (and see tons of them at: https://github.com/mdn/browser-compat-data/pulls?q=is%3Apr+mdn_url+is%3Aclosed). The idea is that we add mdn_urls automatically whenever dependabot updates the mdn-content-inventory package (which will release frequently).

@github-actions github-actions bot added data:webext 🎲 Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API data:webext 🎲 Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions dependencies ⛓️ Pull requests that update a dependency package or file. infra 🏗️ Infrastructure issues (npm, GitHub Actions, releases) of this project linter 🏡 Issues or pull requests regarding the tests / linter of the JSON files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants