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

Add a workflow to enforce new docs redirects #289

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

ptgott
Copy link
Contributor

@ptgott ptgott commented Nov 7, 2024

Add a docpaths workflow to the bot to ensure that any renamed or deleted docs pages accompany a new redirect in the docs config file (config.json). This way, we can prevent docs changes from introducing 404s, whether because of delays in search engine indexing or broken links from Teleport-owned sites.

The workflow takes a path to a config.json file, loads the redirect configuration, and checks whether all renamed and deleted pages correspond to a redirect. This change adds a docpaths value of the workflow flag and an optional teleport-path flag for the path to a gravitational/teleport clone so the workflow can locate a docs configuration file.

@ptgott ptgott requested a review from a team as a code owner November 7, 2024 15:48
@ptgott
Copy link
Contributor Author

ptgott commented Nov 7, 2024

Here is an example of a failing workflow run in a v16 test PR: https://github.com/gravitational/teleport/actions/runs/11746390534/job/32726045359?pr=48546#step:7:18

@ptgott ptgott marked this pull request as draft November 8, 2024 17:00
@ptgott ptgott force-pushed the paul.gottschling/2024-11-06-docs-redirs branch from 07dbd57 to 4b50bc2 Compare November 8, 2024 17:03
@ptgott ptgott marked this pull request as ready for review November 8, 2024 17:08
@ptgott ptgott force-pushed the paul.gottschling/2024-11-06-docs-redirs branch 2 times, most recently from 0c1621e to d9e5a50 Compare November 8, 2024 17:14
@ptgott ptgott force-pushed the paul.gottschling/2024-11-06-docs-redirs branch from d9e5a50 to de56c4f Compare November 19, 2024 21:09
@ptgott ptgott force-pushed the paul.gottschling/2024-11-06-docs-redirs branch from de56c4f to 5b46fbd Compare December 24, 2024 15:03
@ptgott ptgott force-pushed the paul.gottschling/2024-11-06-docs-redirs branch from 5b46fbd to b96e8e0 Compare January 17, 2025 20:07
Add a `docpaths` workflow to the bot to ensure that any renamed or
deleted docs pages accompany a new redirect in the docs config file
(`config.json`). This way, we can prevent docs changes from introducing
404s, whether because of delays in search engine indexing or broken
links from Teleport-owned sites.

The workflow takes a path to a `config.json` file, loads the redirect
configuration, and checks whether all renamed and deleted pages
correspond to a redirect. This change adds a `docpaths` value of the
`workflow` flag and an optional `teleport-path` flag for the path to
a `gravitational/teleport` clone so the workflow can locate a docs
configuration file.
@ptgott ptgott force-pushed the paul.gottschling/2024-11-06-docs-redirs branch from b96e8e0 to aae6322 Compare January 31, 2025 20:35
bot/internal/bot/docpaths.go Outdated Show resolved Hide resolved
bot/internal/bot/docpaths.go Outdated Show resolved Hide resolved
bot/internal/bot/docpaths.go Outdated Show resolved Hide resolved
bot/internal/bot/docpaths.go Show resolved Hide resolved
bot/internal/bot/docpaths.go Outdated Show resolved Hide resolved
bot/internal/bot/docpaths.go Outdated Show resolved Hide resolved
bot/internal/bot/docpaths.go Outdated Show resolved Hide resolved
bot/internal/bot/docpaths.go Outdated Show resolved Hide resolved
- Remove an unnecessary type declaration.
- Rename `Redirect` to `DocsRedirect` for clarity.
- Fix code comment.
- Fix `trace.Wrap` usage.
- Use filepath instead of path.
- Make toURLPath clearer.
@ptgott ptgott requested a review from zmb3 February 4, 2025 15:59
@fheinecke fheinecke merged commit 4e94e3b into main Feb 4, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants