-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: commit status message (for BA) #610
feat: commit status message (for BA) #610
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #610 +/- ##
==========================================
+ Coverage 97.59% 97.68% +0.08%
==========================================
Files 431 438 +7
Lines 36147 36601 +454
==========================================
+ Hits 35279 35754 +475
+ Misses 868 847 -21
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #610 +/- ##
==========================================
+ Coverage 97.59% 97.68% +0.08%
==========================================
Files 431 438 +7
Lines 36147 36601 +454
==========================================
+ Hits 35279 35754 +475
+ Misses 868 847 -21
Flags with carried forward coverage won't be shown. Click here to find out more.
|
1946182
to
9611ce2
Compare
The `ComparisonLoader` depended on a `EnrichedPull` object to be created. This made sense in the PR Comment context where there's always a pull. For the commit status we might not have a Pull, in which case we will default to comparing to the current commit's parent. This is still a comparison nonetheless, so most of the loader is the same. I'm just changing how it is created and adding a `from_EnrichedPull` classmethod. This is to be used in the bundle_analysis commit status
Creates the commit status context for bundle analysis. I moved some things around in the previous commit and this one to better accomodate changes and reuse code. Pretty similar to the PRCommentContext, but has some more details. And the pulls can be `None` (which causes the comparison to have 2 possible sources)
631277b
to
178a7f5
Compare
Introduces the message strategy to send commit statuses for BA. Does _NOT_ activate these statuses yet.
178a7f5
to
2ba43c9
Compare
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #610 +/- ##
==========================================
+ Coverage 97.59% 97.68% +0.08%
==========================================
Files 431 438 +7
Lines 36147 36601 +454
==========================================
+ Hits 35279 35754 +475
+ Misses 868 847 -21
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Codecov ReportAttention: Patch coverage is
Changes have been made to critical files, which contain lines commonly executed in production. Learn more ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #610 +/- ##
==========================================
+ Coverage 97.63% 97.74% +0.10%
==========================================
Files 466 473 +7
Lines 37353 38180 +827
==========================================
+ Hits 36471 37319 +848
+ Misses 882 861 -21
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 15 files with indirect coverage changes This change has been scanned for critical changes. Learn 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.
lgtm, left some minor comments
self._head_commit: Commit | None = head_commit | ||
|
||
@classmethod | ||
def from_EnrichedPull(cls, pull: EnrichedPull) -> "ComparisonLoader": |
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.
def from_EnrichedPull(cls, pull: EnrichedPull) -> "ComparisonLoader": | |
def from_EnrichedPull(cls, pull: EnrichedPull) -> ComparisonLoader: |
I believe this is now valid syntax in Python 3.12
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.
My IDE complains that it is not defined. And the container fails with
NameError: name 'ComparisonLoader' is not defined
So maybe not? I might be missing something
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.
Oh yeah, I just checked that it is still behind the special from __future__ import annotations
import.
I was just used to that from working on Sentry.
Now I’m not quite sure if shorthand Union / Optional syntax TypeA | TypeB | None
is also still behind that special import, or if that is readily available now. 🤔
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.
Also found out that from typing import Self
exists, and that it seems to be even a better fit when inheriting from base classes, as it will just forward the concrete type that methods are being called on. And its less to type (apart from the import)
services/bundle_analysis/new_notify/messages/tests/test_commit_status.py
Outdated
Show resolved
Hide resolved
* Remove prints * Refactor `build_context` chaining method calls * In-line check of "is message cached" in the notification method * Early return if message was already sent * Remove leading space from template
93928b3
to
4ab9c5e
Compare
Introduces the message strategy to send commit statuses for BA.
Does NOT activate these statuses yet.
There were some intermediary changes, please check the other commits for more details.