Repository navigation
schema: Allow optional implementation_url - #7396
sideshowbarker wants to merge 4 commits into
Conversation
This change updates the compat-data schema and docs to allow per-browser optional implementation_url values to be specified in the support data for any browser; detailed description: > An optional changeset URL or commit URL for the change which implemented > the feature in the source code for the associated browser; e.g. a > https://trac.webkit.org/changeset/ URL for a changeset whose subject > line is in the form *"Enable [feature name/description]."* or *"Enable > [feature name/description] by default."*. The presence of an > `implementation_url` value indicates that the associated browser has > spec-conformant support for the feature in its source code. Therefore, > an `implementation_url` value can be added even if the feature hasn't > yet shipped in a stable release, but instead only in a Nightly, Canary, > or Technology Preview release — or even if the feature hasn't yet > shipped in any release at all, but has only landed in the source code > for the associated browser. mdn#6896 (comment) and mdn#6896 (comment) are where the idea for this change arose. In summary, the rationale is to have a record in BCD of what changeset landed support for a feature in a particular browser’s codebase. Among other use cases, we have downstream consumers who care only whether or not there’s an implementation of the feature in a particular browser engine — even if that implementation hasn’t yet actually shipped in a major release.
afa7773 to
1c5ea4f
Compare
|
@sideshowbarker Would you mind illustrating this with an example or two? What would some data that uses this field actually look like? |
| * An optional changeset URL or commit URL for the change which implemented the feature in the | ||
| * source code for the associated browser; e.g. a https://trac.webkit.org/changeset/ URL. | ||
| */ | ||
| implementation_url?: string; |
There was a problem hiding this comment.
Should an array be allowed, because I see some notes with two tracking bugs?
browser-compat-data/api/AudioParam.json
Line 260 in aefff29
There was a problem hiding this comment.
Should an array be allowed, because I see some notes with two tracking bugs?
We could allow an array (as we do already for spec_url) — but the reason I restricted it to a single string in the initial patch here is that I was not aware for any known cases where we’d need to specify more than one URL.
browser-compat-data/api/AudioParam.json
Line 260 in aefff29
OK, looking at that case, I see the subject of https://bugzil.la/1171438 is “Implement the new behavior for AudioParam.value”, so that’s clearly a (yet-unimplemented) feature/implementation request — while looking at https://bugzil.la/1567777 see that one looks like it’s just a bug report (and one which is actually marked as a duplicate of the https://bugzil.la/1171438 feature request…)
So to me at least, that’s not a case that demonstrates a concrete need for allowing an array for the implemenation_url value — because the https://bugzil.la/1567777 URL isn’t a changeset URL at all, and neither actually is the https://bugzil.la/1171438, since the feature hasn’t actually been implemented yet.
There was a problem hiding this comment.
Cool, but that's just a one example. Searching by https://[^dw].+https://[^dw] gives 43 results, so probably something to consider.
Edit: Those may also turn out as just bug reports, though. A short skimming couldn't find a valid example.
Edit 2: It seems I just had a misunderstanding here, as this is about URLs to commits, not tracking bugs.
There was a problem hiding this comment.
Cool, but that's just a one example. Searching by
https://[^dw].+https://[^dw]gives 43 results, so probably something to consider.Edit: Those may also turn out as just bug reports, though. A short skimming couldn't find a valid example.
Right. But you’ve make me realize that for Firefox features, rather than an https://bugzil.la URL, what we’d instead want to have in implementation_url values is a https://hg.mozilla.org/mozilla-central/rev URL — for example:
The subject of that changeset is “Implement FetchEvent.handled” and it happens to have a corresponding bug at https://bugzilla.mozilla.org/show_bug.cgi?id=1617822 but it seems clear that we’d want to cite the https://hg.mozilla.org/mozilla-central/rev/8213cdcc0378 URL instead — and so, to generalize from that, we’d want to cite https://hg.mozilla.org/mozilla-central/rev URLs rather than https://bugzil.la or https://bugzilla.mozilla.org URLs.
And then to generalize even further, I think regardless of which browser it’s for, we’d want to restrict the value to being a URL for the browser project’s revision log rather than for the project’s bug tracker.
So that means we’d want either a https://trac.webkit.org/changeset/, https://hg.mozilla.org/mozilla-central/rev/, or https://chromium.googlesource.com/chromium/src or https://crrev.com/ URL.
Given that, I’ve pushed another commit here that updates the docs part of patch to explicitly mention those — and I’ve also updated the schema change itself to explicitly limit the value to a pattern that matches URLs in one of those forms.
I’ve raised #7417 as a concrete example. As noted there, it adds an
As #6873 (comment) notes, that change means this feature shipped in at least TP 114 and probably was also in since TP 113. With my downstream-consumer hat on, I can say that once that PR were to get merged, I could use the data downstream to correct the problem I described in #6896 (comment). |
This change updates the compat-data schema docs to provide guidance that implementation_url values will be https://trac.webkit.org/changeset/, https://hg.mozilla.org/mozilla-central/rev/, or https://crrev.com/ URLs. The change also updates the schema itself to constrain the allowed value to a pattern that matches URLs in one of those forms.
|
This and the example PR are really helpful for understanding the proposal. Well done, @sideshowbarker! Before I start fussing with the documentation and JSON schema, I've got a couple big questions to make sure we're on the right track: What's the meaning of
|
|
Oops, hit submit a little soon. For that last section, I guess I'm asking: why is |
Short answer: I’m not wedded to a need for including any language tying it to the specification; it’s not strictly necessary — so rather than “spec-conformant support”, I think “complete support” or ”non-partial support” or such would be fine. I think the goal of the relevant language here should just be to make it clear that the point at which we add an
The most complete. In the case of the WebKit project, for example, that’s often a commit/revision which has a subject line in the form “Enable the foo feature” or “Enable the foo feature by default” — but in general it can also be often by “Implement the foo feature” or “Support the foo feature”. Determining whether which particular commit/revision really adds usable support for a feature is a qualitative judgement that depends on the BCD change author having some experience and familiarity with each browser projects’ conventions. While I can confidently assert that, given a particular browser-project commit/revision, I personally know how to figure out whether it really represents implementation of fully-usable support, I don’t know how to document the criteria for that succinctly without adding lots of extra words to the docs. And it seems like the relevant part of the docs for this is already pretty long, so I’d suggest that a better place to try to document that guidance would probably be the part of the MDN article at https://developer.mozilla.org/en-US/docs/MDN/Contribute/Processes/Matching_features_to_browser_version, or an additional new article to supplement that.
Yes, that. I think we should always consider the
I believe what makes sense is that we should always prefer the URL latest revision — in particular, in even if all that revision does it to flip a preference/flag value to cause the feature to be exposed by default. That is in fact what many of the relevant WebKit revisions actually do — the ones worded “Enable the foo feature by default.”
That, I think. In cases like that, we just completely remove the
As I mentioned earlier, maybe we could preempt that question by replacing “spec-conformant implementation” with “complete implementation” or something. At least that gets around the problem of it being tied to a spec. But that aside, generally, you shouldn’t need to independently determine whether the implementation is spec-conformant. I mean, we also don’t do that when browser projects assert “This release adds support for this feature.” So instead in the case for pre-release landing of features, you just make a qualitative assessment based on your experience and your understanding of the relevant browser project’s conventions with respect to changeset messages; that is, you basically say, “OK this is changeset message follows the same kind of pattern I am familiar with for features that end of being included in he release notes for the next major release.” But that said, if instead you really did want to independently confirm a browser has spec-conformant support, you could do that be running the relevant WPT tests and checking the results, and/or by reading the spec and running your own tests.
That’s a good question. I’m not actually sure what the answer should be. The problem with non-standard features is that there’s no way for anybody to ever evaluate how complete they are. So it actually makes no sense to state “This browser has complete support for non-standard feature foo.” The problem is that without a standard spec that defines the requirements of the feature, nobody can even write tests that can be used to check how complete the support for a feature is in a particular browser.
Again I’m actually not sure what the answer should be. But I’m inclined to say that we should just cross that bridge when we get there. That is, if/when a BCD contributor submits a patch/PR with an
I think the answer to that is definitely No. "spec-conformant" means it fully implements the spec, without any known/documented non-conforming behavior.
I think the clear answer to that needs to be, it has no meaning, and we should prohibit it. I don’t think JSON Schema provides us with a practical way to express prohibiting
That’s a good question — but it seems like probably another “let’s cross that bridge when we get it”, where once we hit a case of that actually happening, we’d have something concrete to consider. But my initial sense of it is, if a spec changes to add new methods or attributes to an existing API, then those additions essentially constitute a new feature — and all browser projects are going to treat them as such, and document them as such. And for us with BCD, that means we’d anyway have a separate The other case to consider of course is the case where the spec changes to remove some existing feature. But that was brought up in an earlier comment, and to re-state what I said in my response to that: I think at the point where the relevant browser removes the feature, we completely yank the And even prior to that — and to the point about what “spec-conformant” means, and whether we should prohibit But I think that’s really another kind of “let’s cross that bridge when we get it” situation. |
|
What's the status of this? I've wanted to add a few links like this in the past few days, but it would fail the lint like #7417. |
|
This has come up a couple of times in the past few days. Re-adding it to my (ideally short-term) review queue |
ddbeck
left a comment
There was a problem hiding this comment.
OK, there's some concrete suggestions in line comments.
One thing I'm thinking about though, after all the discussion (especially for all the questions about the corner cases), is that we might want to constrain ourselves initially. Perhaps only use this for features in development, then drop such links when features properly ship. I'm at this point where I trust the schema to express lots of things except for the thing that this plainly fixes (unreleased features). But I'm not sure I know how this proposal interacts with things that the schema already copes with, so maybe the answer, for now, is to simply not let those things interact.
|
|
||
| #### `implementation_url` | ||
|
|
||
| An optional changeset URL or commit URL for the revision that implemented the feature in the |
There was a problem hiding this comment.
A few things here:
- What do you think of breaking this up visually?
- Based on the discussion, can we drop "spec-conformant" bit? I think hashing out "is this URL good enough for
implementation_url?" is probably better suited to the data guidelines; consumers ought to be able to trust that we've done some adequate vetting that the URL demonstrates support without needing to know the gritty details. - Wordsmithing the "even if the feature hasn't shipped" stuff, particularly to make "Safari Technology Preview" more searchable.
Here's sorta what I had in mind (open to modification/reinterpretation):
An optional URL that links to the commit or changeset for the revision that implemented the feature in the source code for the browser or underlying engine.
For example, a URL from:
https://trac.webkit.org/changeset/https://hg.mozilla.org/mozilla-central/rev/https://crrev.com/Typically, an applicable change has a subject line in the form of "Implement [feature]",
"Support [feature]", or "Enable [feature]".The presence of an
implementation_urlvalue indicates that the associated browser has support for the feature in its source code. Therefore, animplementation_urlvalue can be added even if the feature
hasn't yet shipped in a stable version, but may be available in a development version (such as Firefox Nightly, Chrome Canary, or Safari Technology Preview).
|
Hey @sideshowbarker, I think this is a great feature and would be very helpful to include! It looks like this is awaiting a rebase and a response from you -- are you still up for working on this PR? |
I can’t justify the time needed to respond to the open comments on this and finish it up. I can no longer see adding this as a high priority, because the problem I’d originally hoped this could help solve was the problem of not being able to add a version identifier for features that had shipped in Safari Technology Preview — but that problem was subsequently solved when the policy and schema were changed to allow And while I do still think there’s some ancillary value in being able to add implementation URLs to features, I can’t see enough value in it personally to justify taking the time needed to shepherd this PR the rest of way through the process. And once we had this, I don’t think I’d be spending time adding implementation URLs to any features — so unless others are planning to add them, I think this could end up just being something we put work into but never ended up actually using. |
|
That makes sense -- I guess with the collector as well, there's even less incentive to track down bug URLs and add them to BCD, so it might end up unmaintained like the |
Co-authored-by: Daniel D. Beck <[email protected]>
|
I think this is still a helpful feature, so I've opened #16415 to continue the work done in this PR. Thank you @sideshowbarker for getting the ball rolling on this! |
This change updates the compat-data schema and docs to allow per-browser optional
implementation_urlvalues to be specified in the support data for any browser; detailed description:#6896 (comment) and #6896 (comment) are where the idea for this change arose. In summary, the rationale is to have a record in BCD of what changeset landed support for a feature in a particular browser’s codebase. Among other use cases, we have downstream consumers who care only whether or not there’s an implementation of the feature in a particular browser engine — even if that implementation hasn’t yet actually shipped in a major release.