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

bug-1819628: reject incoming crash reports by Android_PackageName #962

Merged
merged 1 commit into from Jan 17, 2024

Conversation

willkg
Copy link
Collaborator

@willkg willkg commented Jan 17, 2024

This adds a map of product -> supported Android_PackageName values and a throttler rule to reject incoming crash reports where the configuration denotes a list of supported packagenames and either the Android_PackageName is missing or it's not in the supported list.

The initial set of supported packagenames is provided in bug-1819628.

@willkg willkg requested a review from a team as a code owner January 17, 2024 02:50
if is_not_supported:
logger.info("ProductName rejected: %r", product_name)
return True
return False
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I cleaned up the logic here a little, but it should do the same thing it did before.

antenna/throttler.py Outdated Show resolved Hide resolved
This adds a map of product -> supported Android_PackageName values and a
throttler rule to reject incoming crash reports where the configuration
denotes a list of supported packagenames and either the
Android_PackageName is missing or it's not in the supported list.

The initial set of supported packagenames is provided in bug-1819628.
)
else:
logger.info(
"Android_PackageName rejected: %s %r", product_name, packagename
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Having this logged allows us to later look at the logs when someone asks us, "are we rejecting packagename xyz?" and then we can say "yes, and we got 1 billion of them yesterday!!!!"

Copy link
Contributor

@smarnach smarnach left a comment

Choose a reason for hiding this comment

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

Looks good to me.


# Supported packagenames values; these have to match the Android_PackageName of the
# incoming crash report
MOZILLA_PRODUCT_PACKAGENAMES = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering whether we'd prefer to have this data in a configuration file rather than in the source code, but I guess either way is fine.

@willkg willkg merged commit cbcf2ed into main Jan 17, 2024
1 check passed
@willkg
Copy link
Collaborator Author

willkg commented Jan 17, 2024

Thank you!

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