Skip to content

ci: Add ci check for broken URLs#15141

Merged
MoritzThomasHuebner merged 19 commits intomagma:masterfrom
MoritzThomasHuebner:add_ci_check_for_broken_links
Mar 17, 2023
Merged

ci: Add ci check for broken URLs#15141
MoritzThomasHuebner merged 19 commits intomagma:masterfrom
MoritzThomasHuebner:add_ci_check_for_broken_links

Conversation

@MoritzThomasHuebner
Copy link
Copy Markdown
Contributor

@MoritzThomasHuebner MoritzThomasHuebner commented Mar 8, 2023

Closes #14962
Merge after #15121

Summary

  • Introduced the gaurav-nelson/github-action-markdown-link-check workflow to run on markdown files withing docs/.
  • Added a config to exclude irrelevant and known broken links.
    • Ignores any link which does not start with http.
    • Ignores links containing "%2F" (a slash), since markdown-link-check does not correctly check these URLs.
    • Ignores all links which point to local resources, such as localhost, 127.0.0.1, etc.
    • Ignores example URLs.
    • Ignores some known broken links for which issues exist.
  • The new check should not be required since external URLs can be temporarily unreachable for many reasons/
  • Will not fix the myriad of reported pre-existing markdown-lint errors.

Question: Should this also run on markdown files outside docs/? There is no way to exclude symbolic links so many files may be scanned twice.

Test Plan

In #15121 we fixed most broken links already. I used markdown-link-check and a self written script to scrape for URLs. Otherwise we only want to see that the test is green.

@pull-request-size pull-request-size bot added the size/L Denotes a Pull Request that changes 100-499 lines. label Mar 8, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 8, 2023

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added component: ci All updates on CI (Jenkins/CircleCi/Github Action) component: docs Documentation-related issue labels Mar 8, 2023
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.4.X/nms/metrics.md
Comment thread docs/docusaurus/versioned_docs/version-1.5.X/nms/metrics.md
Comment thread docs/docusaurus/versioned_docs/version-1.6.X/nms/metrics.md
Comment thread .github/workflows/docs-workflow.yml Outdated
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.0.0/feg/legacy/README.md
Comment thread docs/docusaurus/versioned_docs/version-1.6.X/nms/metrics.md
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 8, 2023

DP Lint & Test

0 tests   0 ✔️  0s ⏱️
0 suites  0 💤
0 files    0

Results for commit 7959b98.

♻️ This comment has been updated with latest results.

@MoritzThomasHuebner MoritzThomasHuebner force-pushed the add_ci_check_for_broken_links branch 2 times, most recently from e810bb1 to 46b992a Compare March 8, 2023 08:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 8, 2023

Oops! Looks like you failed the Docs Lint & Check Generated Files In Sync.

Howto

♻️ Updated: ✅ The check is passing the Docs Lint & Check Generated Files In Sync after the last commit.

@MoritzThomasHuebner MoritzThomasHuebner force-pushed the add_ci_check_for_broken_links branch 6 times, most recently from 2521619 to 74663d3 Compare March 9, 2023 04:31
@MoritzThomasHuebner MoritzThomasHuebner marked this pull request as ready for review March 9, 2023 04:45
@MoritzThomasHuebner MoritzThomasHuebner requested review from a team as code owners March 9, 2023 04:45
Comment thread .github/workflows/docs-workflow.yml Outdated
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # [email protected]
- uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # pin@v1
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.

Nit: Perhaps it would be better to use d53a906aa6b22b8979d33bc86170567e619495ec/1.0.15 ?

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.

Currently there are some warnings, I think we might get rid of them with the new version.
Screenshot from 2023-03-13 16-13-02

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah looks like the new version does not produce these errors anymore

Comment thread .github/workflows/docs-workflow.yml Outdated
- uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # pin@v1
with:
use-verbose-mode: 'yes'
config-file: '.github/workflows/markdown_link_check_config.json'
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.

I think the config file should be moved to .github/workflows/config/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved

MoritzThomasHuebner and others added 8 commits March 15, 2023 11:42
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
@MoritzThomasHuebner MoritzThomasHuebner force-pushed the add_ci_check_for_broken_links branch from 1ee4b87 to 69e3a09 Compare March 15, 2023 00:43
MoritzThomasHuebner and others added 3 commits March 15, 2023 12:01
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
@MoritzThomasHuebner MoritzThomasHuebner force-pushed the add_ci_check_for_broken_links branch from 2232233 to 7959b98 Compare March 15, 2023 05:07
Copy link
Copy Markdown
Member

@maxhbr maxhbr left a comment

Choose a reason for hiding this comment

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

LGTM

@MoritzThomasHuebner MoritzThomasHuebner merged commit b7a5439 into magma:master Mar 17, 2023
lucasgonze pushed a commit to lucasgonze/magma that referenced this pull request Feb 29, 2024
* docs: remove dead links in kubectl commands (v1.7)

Signed-off-by: Sebastian Wolf <[email protected]>

* docs: fix link to black (v1.5 and v1.6)

Signed-off-by: Sebastian Wolf <[email protected]>

* docs: replace archived fb github link

Signed-off-by: Sebastian Wolf <[email protected]>

* docs: replace dead wemake-python link with github repo link

Signed-off-by: Sebastian Wolf <[email protected]>

* docs: update thanos storage link in p002

Signed-off-by: Sebastian Wolf <[email protected]>

* docs: update links to new artifactory

Signed-off-by: Sebastian Wolf <[email protected]>

* docs: update dead facebookincubator links to magma

Signed-off-by: Sebastian Wolf <[email protected]>

* docs: Fixed a number of dead links

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* docs: Fixed a broken link

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* docs: Removed some weird underscores

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* docs: Added missing "https" for consistency

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* docs: Fixed a typo

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* docs: Added workflow for broken URLs

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* docs: Replace uber link

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* ci: Moved markdown link check config file

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* ci: Increased markdown link check version

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* ci: Fixed a path to a config file

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* ci: Testing workflow

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

* ci: Added another url exception

Co-authored-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>

---------

Signed-off-by: Sebastian Wolf <[email protected]>
Signed-off-by: Moritz Huebner <[email protected]>
Co-authored-by: Sebastian Wolf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: ci All updates on CI (Jenkins/CircleCi/Github Action) component: docs Documentation-related issue size/L Denotes a Pull Request that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linter: check for 404 errors in documentation links

3 participants