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 script to cleanup redundant BCD overrides #2333

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

queengooborg
Copy link
Contributor

This PR adds a script that removes the compat_features overrides from web-features files when the overrides' data matches the data that comes from BCD tags.

@github-actions github-actions bot added the tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings label Nov 26, 2024
scripts/cleanup-bcd-overrides.ts Outdated Show resolved Hide resolved
scripts/cleanup-bcd-overrides.ts Outdated Show resolved Hide resolved
scripts/cleanup-bcd-overrides.ts Outdated Show resolved Hide resolved
scripts/cleanup-bcd-overrides.ts Show resolved Hide resolved
scripts/cleanup-bcd-overrides.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like to suggest renaming this. There are a few possible overrides in a .yml file: compat_features, compute_from, and complete status block and all of them involve BCD to some extent. And "clean" implies that overrides are necessarily "dirty" (some are not).

My naming ideas are:

  • dedupe-compat-tags
  • tidy-compat-features
  • remove-tagged-compat-features

scripts/cleanup-bcd-overrides.ts Outdated Show resolved Hide resolved
@ddbeck
Copy link
Collaborator

ddbeck commented Nov 26, 2024

Ack, my top-of-review comment got lost:

Cool! I have some suggestions to make this safer to run and to improve maintainability, but I like the overall shape of this.

scripts/cleanup-bcd-overrides.ts Outdated Show resolved Hide resolved
scripts/cleanup-bcd-overrides.ts Outdated Show resolved Hide resolved
@queengooborg queengooborg requested a review from jamesnw December 9, 2024 23:46
Copy link
Collaborator

@jamesnw jamesnw left a comment

Choose a reason for hiding this comment

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

I pushed a fix to a bug in one of my earlier suggestions. Apart from the renaming question from @ddbeck, the other issue currently is with the output yaml formatting.

Adding a comment to the document adds a line of whitespace which the formatter removes. I think ideally we should run prettier on the output like we do in feature-init, or perhaps more crudely, update package.json to have-

"cleanup-bcd-overrides": "tsx scripts/cleanup-bcd-overrides.ts; npm run format" },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants