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

[ENHANCEMENT] Allow reset of Baseline Status and Browser Feature Availability #515

Open
jcscottiii opened this issue Jul 18, 2024 · 0 comments
Labels
enhancement New feature or request go Pull requests that update Go code

Comments

@jcscottiii
Copy link
Collaborator

jcscottiii commented Jul 18, 2024

Is your feature request related to a problem? Please describe.
There are two use cases that need to be handled:

  1. Sometimes a feature may be marked as baseline and that status needs to be revoked
  2. Sometimes, a feature may be marked as available in a browser but that needs to be changed

Both cases happened during this PR: mdn/browser-compat-data#23401

The parse-html-unsafe feature was previously marked as available in all browsers (which then gave it baseline status). However, that changed and the system partially handled it. The status was set successfully to not baseline but the baseline low date did not get reset. Additionally, the browser that had the feature availability removed, still had an availability date in our system. Even after ingesting this data from web features.

Describe the solution you'd like
For baseline status, given there's always a baseline enum passed in, we need to only allow the low and high dates to be set to nil by taking in the passed in value. Currently, we only allow the values to be changed from a non nil value to another non nil value:

existingStatus.LowDate = cmp.Or[*time.Time](status.LowDate, existingStatus.LowDate)
existingStatus.HighDate = cmp.Or[*time.Time](status.HighDate, existingStatus.HighDate)

For browser specific availability:

  • in extractBrowserAvailability, we need to handle the nil cases for each browser. so that we return an additional collection of availability dates to delete.
  • add a new method to lib/gcpspanner/browser_availabilities.go to delete each entry in that collection if exists.
    • Why delete instead of updating with a nil? This will reflect the exact state of the web features repo instead. Additionally, it will make sure any joins continue to perform correctly.
  • bonus: we need to allow for upserts of browser availability like other upsert methods instead of the current insert-only method.
    • This bonus will not solve this issue but we can clearly see that dates may change and we should be able to adapt to that.
@jcscottiii jcscottiii added enhancement New feature or request go Pull requests that update Go code labels Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code
Projects
Status: 2024-Q4
Development

No branches or pull requests

1 participant