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 webcompat_score rule #2558

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jgraham
Copy link
Member

@jgraham jgraham commented Dec 12, 2024

This sets the cf_webcompat_score field to match a value computed in BigQuery.

Checklist

  • Type annotations added to new functions
  • Docs added to functions touched in main classes
  • Dry-run produced the expected results
  • The to-be-announced tag added if this is worth announcing

@jgraham jgraham force-pushed the webcompat_score branch 2 times, most recently from a110499 to 7b0ce91 Compare December 12, 2024 15:13
Copy link
Member

@suhaibmujahid suhaibmujahid left a comment

Choose a reason for hiding this comment

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

Thank you, @jgraham! I left some minor comments.

The rule needs to be added to cron scripts. If updating the scores is not time-sensitive, using cron_run_daily.sh would be less intesive on Bugzilla compared to cron_run_hourly.sh.

Also, we need to add it to the wiki page.

bugbot/rules/webcompat_score.py Outdated Show resolved Hide resolved
bugbot/rules/webcompat_score.py Outdated Show resolved Hide resolved
bugbot/rules/webcompat_score.py Outdated Show resolved Hide resolved
def handle_bug(
self, bug: dict[str, Any], data: dict[str, Any]
) -> Optional[dict[str, Any]]:
bug_id = bug["id"]
Copy link
Member

Choose a reason for hiding this comment

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

The ID should be a string consistent with other rules, and this is what the parent class expects:

Suggested change
bug_id = bug["id"]
bug_id = str(bug["id"])

We have an issue to change that (i.e., #1432).

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, although note that making the change as written would break things (because the bug number is an integer in self.scored_bugs).

Copy link
Member

Choose a reason for hiding this comment

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

nit: It would be great to have bug_id = str(bug["id"]), so it will less likely to be messied when doing the refactoring in #1432 (it will match the search query).

You could use bug["id"] directly when using the ID with self.scored_bugs.

Comment on lines +62 to +59
"f6": "product",
"o6": "notequals",
"v6": "Web Compatibility",
Copy link
Member

Choose a reason for hiding this comment

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

Why should the bug not be in Web Compatibility when considering the webcompat:site-report keyword?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the first OR condition gets everything in Web Compatibility :: Site Reports. This matches the logic we're using when importing the bugs.

Copy link
Member

Choose a reason for hiding this comment

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

I just wanted to confirm that this is initial. In this way, we will exclude bugs that have the webcompat:site-report keyword if they are in the Web Compatibility product (other than the Site Reports component).

bugbot/rules/webcompat_score.py Outdated Show resolved Hide resolved
bugbot/rules/webcompat_score.py Outdated Show resolved Hide resolved
This sets the cf_webcompat_score field to match a value computed in BigQuery.
Copy link
Member

@suhaibmujahid suhaibmujahid left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +62 to +59
"f6": "product",
"o6": "notequals",
"v6": "Web Compatibility",
Copy link
Member

Choose a reason for hiding this comment

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

I just wanted to confirm that this is initial. In this way, we will exclude bugs that have the webcompat:site-report keyword if they are in the Web Compatibility product (other than the Site Reports component).

def handle_bug(
self, bug: dict[str, Any], data: dict[str, Any]
) -> Optional[dict[str, Any]]:
bug_id = bug["id"]
Copy link
Member

Choose a reason for hiding this comment

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

nit: It would be great to have bug_id = str(bug["id"]), so it will less likely to be messied when doing the refactoring in #1432 (it will match the search query).

You could use bug["id"] directly when using the ID with self.scored_bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants