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

determine priority of compat_features keys vs keys in BCD generated features. #1930

Open
autonome opened this issue Oct 9, 2024 · 2 comments
Labels
enhancement New feature or request tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings

Comments

@autonome
Copy link
Collaborator

autonome commented Oct 9, 2024

If you add a key to a feature's compat_features section, which already is in a feature that does not have a compat_features section, the dist script complains (rightly) that there are duplicate keys.

However, there are valid reasons to move a key from feature A to feature B, and treating this as a duplicate rather than a move prevents being able to do this.

Eg if we go ahead with a MessageEvent feature (unclear atm), it would have this:

compat_features:
  # Already generated in Broadcast channel.
  # Revisit once the "keys in impl or feature" question is answered.
  #- api.BroadcastChannel.message_event
@ddbeck ddbeck added enhancement New feature or request tools and infrastructure Project internal tooling, such as linters, GitHub Actions, or repo settings labels Oct 9, 2024
@ddbeck
Copy link
Collaborator

ddbeck commented Oct 9, 2024

I think the priority is unequivocal: compat_features in a .yml file are considered ahead of a BCD tag.

That said, it's annoying when moving a key from an origin feature to a destination feature. It's a multi-step process:

  1. In the origin YAML file, check if there's a compat_features list. If there's not a list, then create one that duplicates the BCD tag.
  2. In the origin YAML file, remove the key from compate_features.
  3. In the destination YAML file, check if there's a compat_features list. If there's not a list, then create one that duplicates the BCD tag.
  4. In the destination YAML file, add the key to compat_features.

There's nothing about this that could not be automated, once you know the key(s) to move and the source and destination. I'd welcome a PR adding a convenience script to /scripts for this task. I imagine something like mv-compat source-path dest-path compat-key … would be very handy indeed.

@jamesnw
Copy link
Collaborator

jamesnw commented Oct 18, 2024

3. In the destination YAML file, check if there's a compat_features list. If there's not a list, then create one that duplicates the BCD tag.

I also would find it helpful to have a script that just creates a compat_features list that duplicates the BCD tag, in essence the reverse of migrate-to-bcd. This would be helpful when adding missing keys to a feature. I think all we would need to do is getting the compat_features from the .yml.dist, remove the comments, and add it to the .yml.

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

No branches or pull requests

3 participants