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 false negatives in the docpaths workflow #321

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

ptgott
Copy link
Contributor

@ptgott ptgott commented Feb 5, 2025

In CheckDocsPathsForMissingRedirects, a trace.Wrap call mistakenly includes an unrelated error as an argument, and the error is either nil or handled earlier in the function. This means that docs pull requests with insufficient redirects still cause the workflow to pass.

This change fixes the issue and adds testing for error handling in CheckDocsPathsForMissingRedirects. As part of this, it improves some other error messages returned by the function.

@ptgott ptgott requested a review from a team as a code owner February 5, 2025 18:10
In `CheckDocsPathsForMissingRedirects`, a `trace.Wrap` call mistakenly
includes an unrelated error as an argument, and the error is either nil
or handled earlier in the function. This means that docs pull requests
with insufficient redirects still cause the workflow to pass.

This change fixes the issue and adds testing for error handling in
`CheckDocsPathsForMissingRedirects`. As part of this, it improves some
other error messages returned by the function.
@ptgott ptgott force-pushed the paul.gottschling/2025-02-05-redirect-check-fix branch from 98ffa9f to 6e283d5 Compare February 7, 2025 16:54
"path/filepath"
"strings"

"github.com/gravitational/shared-workflows/bot/internal/github"
"github.com/gravitational/trace"
"github.com/spf13/afero"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use io/fs instead of pulling in a dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 9c4ac80

Use the OS FS per feedback from zmb3.
@camscale camscale merged commit e2c9ce7 into main Feb 10, 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