-
Notifications
You must be signed in to change notification settings - Fork 14
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
Checks links rot with CI + have permalink #2465
Comments
Two issues:
The first issue could be resolved by using a checker which looks at the source: the MDX files. But then we need to parse links to make a difference between external and internal links, and the check for internal links would still need to be done dynamically. We could use a headless browser, but it makes all the things more complex and prone to error and flakiness… |
Please check first, if there is a plugin which allows us to use something like permalinks for our stories. |
For example: https://storybook.js.org/addons/storybook-redirect/ |
There is as well a possibility to set an id attribute: https://storybook.js.org/docs/configure/sidebar-and-urls#permalink-to-stories |
@imagoiq, is this really a blocker for the storybook migration? If not, please remove the milestone (the ticket will just be with the others in the backlog) so we have a better overview of when we can migrate. |
https://storybook.js.org/addons/storybook-redirect has not been updated for 5 years and looks rather complicated. With #2603, we get kind of permalinks. Nothing prevents us from changing those ids, but we are safe if we can keep ourselves from changing them, or at least do it carefully and add a redirect with a middleware as in storybookjs/storybook#23093 (comment) The only remaining part is external URLs. If we omit Figma, ng-boostrap, badge-fury, archive.design-syste.post.ch, MDN, caniuse (which should be rather stable) we have currently: 1 link on card component (picsum.photos to generated examples) Therefore, it might be overkilled to check external links with a solution involving e2e for example. |
@gfellerph I added this ticket again on the migration milestone because having those ids will stop the old link from working, so ideally it should be done when the documentation is publicly available (or before). |
From time to time, we have rot links on the documentation. To prevent that, we could have a workflow in the CI pipeline to checks all links. This workflow would not need to run in every PR, but daily for example because external can break at anytime.
Impediment:
Storybook is dynamically generated and needs more time to fully load a page. Does a link checker support this situation?
Some options to analyse:
https://github.com/lycheeverse/lychee
https://github.com/untitaker/hyperlink#options
https://github.com/marketplace/actions/check-links-with-linkcheck
The text was updated successfully, but these errors were encountered: