-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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-context): Do not create if older than 1 year old #54866
feat(commit-context): Do not create if older than 1 year old #54866
Conversation
committed_date = datetime.strptime( | ||
commitInfo.get("committed_date"), date_format_expected | ||
).astimezone(timezone.utc) |
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 sad that we have to define the format for 8601. Can we put a comment to replace this when we get to python 3.11 and can use dateutil.parser.isoparse
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.
added the comment!
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.
there is isodate.parse_date
but we don't seem to use it anywhere
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.
hmm can you link to it?
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.
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.
refactored to use isodate.parse_datetime
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #54866 +/- ##
==========================================
+ Coverage 79.74% 79.86% +0.11%
==========================================
Files 4995 5025 +30
Lines 212230 213885 +1655
Branches 36179 36393 +214
==========================================
+ Hits 169247 170813 +1566
- Misses 37775 37833 +58
- Partials 5208 5239 +31
|
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
PR reverted: 245bce9 |
@NisanthanNanthakumar please write a test for this. this has now been reverted twice and the codecov integration has pointed out that this change is not covered by tests |
…55013) ## Objective: Update on the reverted PR: #54866 Fixes SENTRY-14ZG The problem was the wrong key. copy-paste error. But I noticed from the captured exceptions that some of the results from the github API does not return a date for the commit. So I added a filter for to exclude those commits from the `max` function that determines the most recent commit. --------- Co-authored-by: Snigdha Sharma <snigdha.sharma@sentry.io> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Objective
Update on the reverted PR: #54624
The original PR had errors from GitLab date strings not being parsed correctly bc they are formatted differently from GitHub. So this PR returns the datetime object for internal usage and will make date comparisons easier without needing to know which integration it came from.