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: change to get new tokenless working #440

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joseph-sentry
Copy link
Contributor

We don't want to update the commit using github's information because that will rename the branch to a different format than what we're aiming for in tokenless

@codecov-notifications
Copy link

codecov-notifications bot commented May 8, 2024

Codecov Report

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

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #440      +/-   ##
==========================================
- Coverage   97.34%   97.34%   -0.01%     
==========================================
  Files         399      399              
  Lines       33603    33612       +9     
==========================================
+ Hits        32711    32718       +7     
- Misses        892      894       +2     
Flag Coverage Δ
integration 97.34% <71.42%> (-0.01%) ⬇️
latest-uploader-overall 97.34% <71.42%> (-0.01%) ⬇️
unit 97.34% <71.42%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.56% <60.00%> (-0.02%) ⬇️
OutsideTasks 97.49% <71.42%> (-0.01%) ⬇️
Files Coverage Δ
services/tests/test_repository_service.py 99.76% <100.00%> (+<0.01%) ⬆️
services/repository.py 95.43% <60.00%> (-0.85%) ⬇️

... and 7 files with indirect coverage changes

@codecov-qa
Copy link

codecov-qa bot commented May 8, 2024

Codecov Report

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

Project coverage is 97.34%. Comparing base (d0c5175) to head (c476580).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #440      +/-   ##
==========================================
- Coverage   97.34%   97.34%   -0.01%     
==========================================
  Files         399      399              
  Lines       33603    33612       +9     
==========================================
+ Hits        32711    32718       +7     
- Misses        892      894       +2     
Flag Coverage Δ
integration 97.34% <71.42%> (-0.01%) ⬇️
latest-uploader-overall 97.34% <71.42%> (-0.01%) ⬇️
unit 97.34% <71.42%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.56% <60.00%> (-0.02%) ⬇️
OutsideTasks 97.49% <71.42%> (-0.01%) ⬇️
Files Coverage Δ
services/tests/test_repository_service.py 99.76% <100.00%> (+<0.01%) ⬆️
services/repository.py 95.43% <60.00%> (-0.85%) ⬇️

... and 7 files with indirect coverage changes

Copy link

codecov-public-qa bot commented May 8, 2024

Codecov Report

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

Project coverage is 97.34%. Comparing base (d0c5175) to head (c476580).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #440      +/-   ##
==========================================
- Coverage   97.34%   97.34%   -0.01%     
==========================================
  Files         399      399              
  Lines       33603    33612       +9     
==========================================
+ Hits        32711    32718       +7     
- Misses        892      894       +2     
Flag Coverage Δ
integration 97.34% <71.42%> (-0.01%) ⬇️
latest-uploader-overall 97.34% <71.42%> (-0.01%) ⬇️
unit 97.34% <71.42%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.56% <60.00%> (-0.02%) ⬇️
OutsideTasks 97.49% <71.42%> (-0.01%) ⬇️
Files Coverage Δ
services/tests/test_repository_service.py 99.76% <100.00%> (+<0.01%) ⬆️
services/repository.py 95.43% <60.00%> (-0.85%) ⬇️

... and 7 files with indirect coverage changes

Copy link

codecov bot commented May 8, 2024

Codecov Report

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

Project coverage is 97.41%. Comparing base (d0c5175) to head (c476580).
Report is 2 commits behind head on main.

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

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #440      +/-   ##
==========================================
+ Coverage   97.37%   97.41%   +0.04%     
==========================================
  Files         430      430              
  Lines       34293    35334    +1041     
==========================================
+ Hits        33392    34420    +1028     
- Misses        901      914      +13     
Flag Coverage Δ
integration 97.34% <71.42%> (-0.01%) ⬇️
latest-uploader-overall 97.34% <71.42%> (-0.01%) ⬇️
unit 97.34% <71.42%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.67% <60.00%> (+0.06%) ⬆️
OutsideTasks 97.49% <71.42%> (-0.01%) ⬇️
Files Coverage Δ
services/tests/test_repository_service.py 99.76% <100.00%> (+<0.01%) ⬆️
services/repository.py Critical 95.43% <60.00%> (-0.85%) ⬇️

... and 7 files with indirect coverage changes

Related Entrypoints
run/app.tasks.upload.Upload
run/app.tasks.commit_update.CommitUpdate
run/app.tasks.upload.PreProcessUpload

@joseph-sentry joseph-sentry requested a review from a team May 9, 2024 15:23
if commit_updates["head"].get("slug") != commit_updates["base"].get("slug"):
branch_name = commit_updates["head"]["slug"] + ":" + branch_name
commit.branch = branch_name
# if this PR is from a fork don't update the branch here
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this the case? Can you maybe share some examples, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the PR to make more sense, basically with the old behaviour this would update the branch name to be:
<username>/<repo name>:<branch name> with this change it will be <username>:<branch name>

we used to prepend the slug to the branch name when detecting that the
commit is on a fork, but now we want the format of a forked branch to be
<username>:<branch name> so we try to extract the username from the
slug of the head of the PR that the commit is on

Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
Copy link
Contributor

@adrian-codecov adrian-codecov left a comment

Choose a reason for hiding this comment

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

Did we change the branch format we were expecting? Or did we save the slug all this time and realize until now we only wanted the username?

username = commit_updates["head"]["slug"].split("/")[0]
branch_name = username + ":" + branch_name
except:
log.error(
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually I wouldn't mind this change. But it seems unnecessary to add an extra catch-all error (which is discouraged in general) for a change that is not adding much (apparently) anyway.

So I have to ask, why is it that we want to get rid of the repo name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's honestly just a visual change, i don't think users need to know what the repo name of the fork is, so it's kinda just in the way

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

Successfully merging this pull request may close these issues.

None yet

3 participants