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

feat(commit-context): Do not create if older than 1 year #54624

Conversation

NisanthanNanthakumar
Copy link
Contributor

Objective:

Do not create a suspect commit if the resulting commit is over 1 year old.

@NisanthanNanthakumar NisanthanNanthakumar requested a review from a team as a code owner August 11, 2023 12:44
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 11, 2023
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #54624 (53a1f44) into master (3af433b) will increase coverage by 0.03%.
Report is 118 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #54624      +/-   ##
==========================================
+ Coverage   79.74%   79.78%   +0.03%     
==========================================
  Files        4995     5000       +5     
  Lines      212230   212382     +152     
  Branches    36179    36191      +12     
==========================================
+ Hits       169247   169440     +193     
+ Misses      37775    37730      -45     
- Partials     5208     5212       +4     
Files Changed Coverage Δ
src/sentry/integrations/utils/commit_context.py 80.00% <100.00%> (+1.42%) ⬆️

... and 131 files with indirect coverage changes

# Only return suspect commits that are less than a year old
if commit_context and datetime.strptime(
commit_context["committedDate"], "%Y-%m-%dT%H:%M:%SZ"
).replace(tzinfo=timezone.utc) > datetime.now(tz=timezone.utc) - timedelta(days=365):
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be a constant or a setting somewhere

@NisanthanNanthakumar NisanthanNanthakumar merged commit 14935b6 into master Aug 15, 2023
55 of 56 checks passed
@NisanthanNanthakumar NisanthanNanthakumar deleted the do-not-create-suspect-commit-if-its-older-than-1-year branch August 15, 2023 19:04
@sentry-io
Copy link

sentry-io bot commented Aug 15, 2023

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ValueError: time data '2023-08-07T23:46:07.000Z' does not match format '%Y-%m-%dT%H:%M:%SZ' sentry.tasks.process_commit_context View Issue

Did you find this useful? React with a 👍 or 👎

@asottile-sentry asottile-sentry added the Trigger: Revert Add to a merged PR to revert it (skips CI) label Aug 15, 2023
@getsentry-bot
Copy link
Contributor

PR reverted: d5a3714

getsentry-bot added a commit that referenced this pull request Aug 15, 2023
)"

This reverts commit 14935b6.

Co-authored-by: asottile-sentry <103459774+asottile-sentry@users.noreply.github.com>
NisanthanNanthakumar pushed a commit that referenced this pull request Aug 17, 2023
## 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.
@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2023
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 Trigger: Revert Add to a merged PR to revert it (skips CI)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants