-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Silences warning logs and adds additional earlier skip check if no detected BCD updates #909
Merged
foolip
merged 8 commits into
openwebdocs:main
from
bocoup:only-log-warnings-on-unresolved-contradictions
Dec 14, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bc8b26d
set log message default to quiet
ChrisC e4944b9
adds helper to detect contradictions
ChrisC ace7e41
adds check for "preview" statement
ChrisC 846fb2e
catches specific version_added updates over generic support statements
ChrisC 09eb95a
walks back edits to "normal" update unit test
ChrisC 388dc62
stops using "contradictions" terminology
ChrisC 1a15d19
fixes logic for handling "preview" statements
ChrisC f8a0f4a
Merge remote-tracking branch 'upstream/main' into only-log-warnings-o…
ChrisC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be the signature if we pass in
defaultStatements
:It could be an empty array, but not null. An example of what an array might be:
If we may have tests result showing support in Chrome 110, and the lack of support in Chrome 29, that is consistent with BCD. But if we have test results showing support in Chrome 9, that is a contradiction.
In my following comments, I'll assume that we iterate over
versionMap
, skip any nulls, and inside that loop iterate overstatements
, which is usually zero or one item, but possibly more.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChrisC do you plan to address this? If so I'll hold off with review of the recent changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@foolip I did try to address this and was hoping that with some smart sorting of the statements and versions, this would be simple to implement. Unfortunately, that approach did not work reliably.
Instead, I'm going to add another
provide...
method after we get thedefaultStatements
to infer supported and unsupported ranges to check each version against. That will be the most robust solution for checking version support against multiple default statements.I would prefer to do that in a separate PR if possible (since I think it will be quite a bit more code to add), but if you have a strong preference for keeping it in this PR, I can continue with that work here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds great @ChrisC, and fine to do it in a separate PR since it's not as simple as I thought initially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's untested code of how I thought testing against an array of statements (
defaultStatements
) would probably work:In other words, for each true or false test result for a specific version (from collector results), test it against the support statements, once range at a time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is more or less what I tried. However, take the array of statements you provided as an example ☝🏽.
Let's say you're testing version
10
with a a test result ofhasSupport === true
against this set of support statements. This should not show any contradictions. However, when tested for support against each statement individually, it would returnfalse
when tested against the the statement ofversion_added: 30
and then send out a false positive signal for the need to update the statements. (Note that it would returntrue
against the other statement.)I suppose you could collect all the comparisons when iterating through the statements, and assume that as long as there's no inconsistency between the individual statement comparisons, there there's no need to update them. But that seemed a bit brittle and non-specific to me. See another approach where we test against ranges more specifically in #967.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look at your new PR, but for now just want to say that I don't think we should test a version ("10" in your example) against a part of a support statement, only the full array as one test.
If there is a contradiction we do need to figure out how which part of a support statement to update, or if we should add/remove a part, but I consider that a problem of handling more cases correctly, not identifying when an update is needed and logging.