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

[BUG]: Link Checker Github Action is fooled on feature branches because of hardcoded links to /blob/main #693

Open
1 task done
njbrake opened this issue Jan 20, 2025 · 0 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation gha GitHub actions related good first issue Good for newcomers

Comments

@njbrake
Copy link
Contributor

njbrake commented Jan 20, 2025

Description

I completed this PR #614 which renamed a file from .env.example to .env.template. All of the actions passed, and I merged it to main, only to get a notification that a github action was failing and I had broken the main branch! Serves me right for doing a merge to main at the end of the day on a Friday 😆 . The issue was that I had forgotten to update some documentation: PR to fix my mistake is here #679.

This should not have been able to happen, the link checker should identify broken links before they happen.

The issue comes from how we reference links to files in our github repo. We often reference files using HTTP links to the main branch, like

https://github.com/mozilla-ai/lumigator/blob/main/README.md?plain=1#L63

[link text](https://github.com/mozilla-ai/lumigator/blob/main/.env.template)

This means that when the link checker runs on a feature branch, it's checking links that point to the main branch, which is why it missed that I had renamed a file and thus broken a link.

Reproduction

  1. make a feature branch
  2. delete the .env.template file, commit the change, push to github, make a PR
  3. Observe that the github action will pass even though the file is gone and the links to that file in the repo should now be broken.

Relevant log output

Expected behavior

I think the links in the repo docs should be updated to be relative links, this way they will point to the files that exist on the branch itself, and not always to whatever is in main. This will become more important as we maintain versions of lumigator. (aka we don't want version 1.0 to accidentally be referencing to newer 2.0 docs).

System Info

n/a

Have you searched for similar issues before submitting this one?

  • Yes, I have searched for similar issues
@njbrake njbrake added bug Something isn't working documentation Improvements or additions to documentation good first issue Good for newcomers gha GitHub actions related labels Jan 20, 2025
@njbrake njbrake mentioned this issue Jan 23, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation gha GitHub actions related good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant