Skip to content

ref(rules): Update typing in rule files #69068

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

Merged
merged 6 commits into from
Apr 17, 2024

Conversation

ceorourke
Copy link
Member

Pulls out the non-functional changes from #68517 which are mostly typing related.

@ceorourke ceorourke requested a review from a team as a code owner April 16, 2024 22:52
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 16, 2024
Copy link
Contributor

@nhsiehgit nhsiehgit left a comment

Choose a reason for hiding this comment

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

👍

@@ -236,8 +245,9 @@ def apply_rule(self, rule: Rule, status: GroupRuleStatus) -> None:
if not predicate_func(predicate_iter):
return
else:
self.logger.error(
f"Unsupported {name}_match {match!r} for rule {rule.id}",
log_string = f"Unsupported {name}_match {match!r} for rule {rule.id}"
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need to be in a separate var?

Copy link
Member Author

Choose a reason for hiding this comment

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

I got some error if i didn't: LOG011 avoid pre-formatting log messages

@@ -319,7 +346,7 @@ class EventFrequencyCondition(BaseEventFrequencyCondition):
label = "The issue is seen more than {value} times in {interval}"

def query_hook(
self, event: GroupEvent, start: datetime, end: datetime, environment_id: str
self, event: GroupEvent, start: datetime, end: datetime, environment_id: int
Copy link
Contributor

Choose a reason for hiding this comment

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

ooo is it the ID and not the text now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this was just wrong before

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 69.04762% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 79.64%. Comparing base (2869247) to head (a8139b7).
Report is 36 commits behind head on master.

❗ Current head a8139b7 differs from pull request most recent head 17827de. Consider uploading reports for the commit 17827de to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #69068       +/-   ##
===========================================
+ Coverage   58.20%   79.64%   +21.43%     
===========================================
  Files        6420     6429        +9     
  Lines      284855   285226      +371     
  Branches    49078    49128       +50     
===========================================
+ Hits       165809   227161    +61352     
+ Misses     118650    57674    -60976     
+ Partials      396      391        -5     
Files Coverage Δ
...entry/api/endpoints/project_rules_configuration.py 100.00% <100.00%> (+76.19%) ⬆️
src/sentry/buffer/redis.py 92.23% <ø> (+63.75%) ⬆️
src/sentry/rules/base.py 92.59% <100.00%> (+22.94%) ⬆️
src/sentry/rules/conditions/event_frequency.py 79.42% <77.77%> (+40.58%) ⬆️
src/sentry/rules/processing/processor.py 90.17% <30.00%> (+68.08%) ⬆️

... and 1901 files with indirect coverage changes

Copy link
Member

@JoshFerge JoshFerge left a comment

Choose a reason for hiding this comment

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

i notice there is some test coverage lacking on these changes -- worth adding some now?

@ceorourke ceorourke merged commit 8d76050 into master Apr 17, 2024
48 checks passed
@ceorourke ceorourke deleted the ceorourke/rules-typing-seiji-edition branch April 17, 2024 18:19
schew2381 added a commit that referenced this pull request May 1, 2024
Taken from #68517 and added as a
followup PR alongside #69068
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants