Skip to content

Redirect to upstream repo when clicking on "View on GitHub" - #9316

Merged
outofambit merged 2 commits into
developmentfrom
view-on-github-upstream
Mar 19, 2020
Merged

outofambit merged 2 commits into
developmentfrom
view-on-github-upstream

Conversation

@rafeca

@rafeca rafeca commented Mar 18, 2020

Copy link
Copy Markdown
Contributor

Closes #9312

Description

This PR changes the redirection URL when clicking the "View on GitHub" main menu item to open the upstream repository when the current repository is a fork.

Release notes

Notes: no-notes

@rafeca
rafeca requested a review from outofambit March 18, 2020 19:05
@tierninho
tierninho self-requested a review March 18, 2020 19:31

@tierninho tierninho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Confirming the View on GitHub button/menu item points to the Upstream repo. Also the contextual commit menu still points to the fork. 👍

However, I deleted the upstream in the cmd line and the View on GitHub button/menu item points to the Upstream repo. Same result if you were to change it to point elsewhere. Is this intended?

outofambit
outofambit previously approved these changes Mar 19, 2020
@rafeca

rafeca commented Mar 19, 2020

Copy link
Copy Markdown
Contributor Author

However, I deleted the upstream in the cmd line and the View on GitHub button/menu item points to the Upstream repo. Same result if you were to change it to point elsewhere. Is this intended?

Good question! From what I see on the code, the upstream repository is calculated using the GitHub API (via the parent field on the repository object). This means that if the cloned repository is a GitHub fork both the "Create issue on GitHub" and "View on GitHub" menu items will redirect to the parent repository (no matter if the local git working copy has an upstream remote).

Based on #9170, I think that this is the expected behaviour, but looping in @billygriffin and @ampinsk to doublecheck.

@rafeca
rafeca dismissed outofambit’s stale review March 19, 2020 10:05

The base branch was changed.

@rafeca
rafeca changed the base branch from feature/create-issue-metrics to development March 19, 2020 10:05
@outofambit

Copy link
Copy Markdown
Contributor

Based on #9170, I think that this is the expected behaviour,

@rafeca and @tierninho yep i can confirm this is expected behavior. we care more about the repos on github than local repos for this scenario.

@outofambit

Copy link
Copy Markdown
Contributor

appveyor doesn't seem to be picking this up after the base changed, but this change is safe enough that i'm going to just merge it.

@outofambit
outofambit merged commit 0aaa5f1 into development Mar 19, 2020
@outofambit
outofambit deleted the view-on-github-upstream branch March 19, 2020 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show the upstream repository on github when clicking on "view on github"

3 participants