question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

document.github_url has `master` branch in URL

See original GitHub issue

Link in contributors.txt points to mdn/content branch master, which does not exist. It should be main branch.

Interestingly enough, when I run npm run build on local checkout, the produced files have correct URLs.

Example

Documentation pages have associated /contributors.txt files which list contributors to the individual pages. For example, for Web/API/Window it is at Web/API/Window/contributors.txt

Unfortunately, the link is incorrect, it has master in it:

# Contributors by commit history
https://github.com/mdn/content/commits/master/files/en-us/web/api/window/index.html

It should have main instead:

# Contributors by commit history
https://github.com/mdn/content/commits/main/files/en-us/web/api/window/index.html

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
peterbecommented, Dec 9, 2020

I think the problem is that we might be trying to be too smart. When it builds in production (the most important build), it all starts with a GitHub Action workflow that runs on a cronjob. It checks out the master branch of mdn/yari and within that workflow, it checks out the main branch of mdn/content. But I suspect that what’s happening is that process.env.GITHUB_REF refers to the ref of the mdn/yari branch, not the mdn/content one.

I suspect that this function actually dates back to the early days when the build JS code was all in the same repo as the en-US content. Then, it kinda made sense that the github_url for each document could be assumed to be same git checkout as that for the code.

@tannerdolby This issue might become complex and I intend to take an active role in solving it. But please stick around!

@escattone I’ve labelled this as a milestone blocker.

0reactions
peterbecommented, Feb 16, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting permanent links to files - GitHub Docs
For a permanent link to the specific version of a file that you see, instead of using a branch name in the URL...
Read more >
Is there a stable url to always get the default branch in github?
The solution is to use HEAD. That symbolic name will give you tip of the default branch no matter what its name is....
Read more >
Git plugin - Jenkins
Checkout from the Jenkins source repository using https protocol, no credentials, the master branch, and changelog calculation disabled. If changelog is ...
Read more >
git-remote Documentation - Git
Be a little more verbose and show remote url after name. ... a symbolic-ref refs/remotes/<name>/HEAD is set up to point at remote's <master>...
Read more >
GIT Push and Pull Tutorial - DataCamp
The HTTPS or URL is copied from the given GitHub account, which is the place ... and the master is the branch, name.upstream...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found