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

amend branch names to be forked-slug:branch-name #331

Merged
merged 3 commits into from
Nov 14, 2023

Conversation

dana-yaish
Copy link
Contributor

@dana-yaish dana-yaish commented Nov 10, 2023

  • taking get_pull out of is_fork_pr for usability. I don't think it's the responsibility of is_fork_pr to do the request and get the pull's information
  • overriding branch in commit's endpoint since that's the only command that actually uses it and sends it in part of the request.

Copy link

codecov bot commented Nov 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (65210ba) 95.46% compared to head (94540b2) 95.48%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #331      +/-   ##
==========================================
+ Coverage   95.46%   95.48%   +0.01%     
==========================================
  Files          80       80              
  Lines        2715     2722       +7     
==========================================
+ Hits         2592     2599       +7     
  Misses        123      123              
Flag Coverage Δ
python3.10 95.72% <100.00%> (+0.01%) ⬆️
python3.11 95.72% <100.00%> (+0.01%) ⬆️
python3.8 95.72% <100.00%> (+0.01%) ⬆️
python3.9 95.72% <100.00%> (+0.01%) ⬆️
smart-labels 95.47% <100.00%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from dana/pr-option-in-create-report to main November 13, 2023 18:34
matt-codecov
matt-codecov previously approved these changes Nov 13, 2023
codecov_cli/helpers/git.py Outdated Show resolved Hide resolved
pull_dict = get_pull(service, decoded_slug, pr) if not token else None
if is_fork_pr(pull_dict):
headers = {}
branch = pull_dict["head"]["slug"] + ":" + branch
Copy link
Contributor

Choose a reason for hiding this comment

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

i think this is good here, just a note for later:

since : is a legal character in real branch names, i think in the API when we double-check that this PR is from a fork we should set a different field entirely in the database that the UI can check instead of trying to parse it out of the branch name (see ugly screenshot mockup)

Screenshot 2023-11-13 at 10 40 40 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

are you sure it's a valid character? I tried to create a branch with a ":" but says it's invalid, and the documentations say that too. see here and here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but would be a nice UI addition for PRs coming from a fork

Copy link
Contributor

Choose a reason for hiding this comment

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

oh i stand corrected, you're right! i should have checked official docs, i just read some page that said git branch names were "very permissive"

Copy link
Contributor

@matt-codecov matt-codecov left a comment

Choose a reason for hiding this comment

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

still lgtm :)

does the repo automatically dismiss reviews or are you doing that manually?

@dana-yaish
Copy link
Contributor Author

@matt-codecov nope it's automatic

@dana-yaish dana-yaish merged commit e1fbc08 into main Nov 14, 2023
14 checks passed
@dana-yaish dana-yaish deleted the dana/fork-branch-names branch November 14, 2023 18:48
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.

Fix branch conflation (PR from fork's main to upstream's main shouldn't overwrite coverage)
2 participants