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

Fix broken links, and make them an error #66

Open
huonw opened this issue Jan 5, 2024 · 4 comments
Open

Fix broken links, and make them an error #66

huonw opened this issue Jan 5, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@huonw
Copy link
Contributor

huonw commented Jan 5, 2024

Currently running a build shows a lot of warnings about broken links, that can't be resolved. It'd be nifty to fix them, and make them an error:

// @TODO: This should throw on prod
onBrokenLinks: isDev ? "warn" : "warn",
onBrokenMarkdownLinks: isDev ? "warn" : "warn",

e.g.

$ NODE_OPTIONS="--max-old-space-size=6144" npm run build
...
[WARNING] Docs markdown link couldn't be resolved: (../../using-pants/key-concepts-to-know-about-pants/targets-and-build-files.mdx) in "/Users/huon/projects/pantsbuild/pantsbuild.org/versioned_docs/version-2.8/docs/getting-started/create-initial-build-files.mdx" for version 2.8
[WARNING] Docs markdown link couldn't be resolved: (../../using-pants/key-concepts-to-know-about-pants/targets-and-build-files.mdx) in "/Users/huon/projects/pantsbuild/pantsbuild.org/versioned_docs/version-2.8/docs/getting-started/create-initial-build-files.mdx" for version 2.8
[WARNING] Docs markdown link couldn't be resolved: (../../using-pants/resources-and-archives.mdx) in "/Users/huon/projects/pantsbuild/pantsbuild.org/versioned_docs/version-2.8/docs/getting-started/create-initial-build-files.mdx" for version 2.8
...

Before we make it an error, we'll likely also want to have validation on the Pants side, or else we'll only find out about new broken links when doing a doc sync here for a new release, and that would block merging that new release's docs.

@huonw huonw added the enhancement New feature or request label Jan 5, 2024
@thejcannon
Copy link
Member

I agree, and in general I'd love for us to keep the docs material in there pants repo "healthy"

@thejcannon
Copy link
Member

josh@cephandrius:~/work/pantsbuild.org$ NODE_OPTIONS='--max-old-space-size=6144' npm run build

> pantsbuild.org@0.0.0 build
> docusaurus build


    ------------------------------------------------------------------------------------------------------------------------------------------------------------ 
                                                                                                                                                                 
                                                                   Update available 3.0.1 → 3.1.0                                                                
                                                                                                                                                                 
                                         To upgrade Docusaurus packages with the latest version, run the following command:                                      
        `yarn upgrade @docusaurus/core@latest @docusaurus/plugin-client-redirects@latest @docusaurus/preset-classic@latest @docusaurus/eslint-plugin@latest      
                                                              @docusaurus/module-type-aliases@latest`                                                            
                                                                                                                                                                 
    ------------------------------------------------------------------------------------------------------------------------------------------------------------ 

[INFO] [en] Creating an optimized production build...

✔ Client
  

✔ Server
  Compiled successfully in 14.53m

(node:62066) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

✔ Client
  

● Server █████████████████████████ cache (99%) shutdown IdleFileCachePlugin
 stored

[SUCCESS] Generated static files in "build".
[INFO] Use `npm run serve` command to test your build locally.
josh@cephandrius:~/work/pantsbuild.org$

I'm gonna leave this open though since making these an error wouldn't fly, as someone can introduce a broken link in the pantsbuild/pants repo :/

@kaos
Copy link
Member

kaos commented Jan 17, 2024

Does this cover the docs links on https://www.pantsbuild.org/versions ?

I noticed they point at /2.14.x rather than just /2.14 etc.

@thejcannon
Copy link
Member

It should cover everything. Something must be wrong with my local setup since those are bad links, yet bumping the build to throw doesn't throw or warn 😨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants