-
Notifications
You must be signed in to change notification settings - Fork 148
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
mage: check that links are live in the OTel README #5443
Conversation
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
This pull request does not have a backport label. Could you fix it @mauri870? 🙏
NOTE: |
This PR adds a utility based on the `link-patrol` command to check if links in a given file are live. Added a check in the `check` and `otel:readme` targets to validate all links in the Otel Readme are valid.
9e03986
to
f35a438
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. I do have three questions about the semantics of this check:
- Are we checking all the links every time? Is there a mode available where we only check the PR diff?
- What happens if the site we check is slow or unavailable? How does the tool behave in that case?
- Do we have special cases (I imagine mostly around releases and changelog generation) where we'd run into a chicken-and-egg situation where links will only become valid after the PR is merged?
Thanks for the feedback, I'll try to reply to the points in order.
|
This pull request is now in conflicts. Could you fix it? 🙏
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
We could only run it on files changed in the PR, but I'm not sure that would really improve much. There's not a lot of markdown files in this repo. I was mostly concerned about run times. If we're annoyed by the time it takes to run or by general flakiness, we can look into making it better. |
Definitely. For now it will only check the OTel README, but if we want to extend it to other files we might have to look closer to runtime performance, timeouts and the noisy output that the tool generates. |
|
|
This pull request is now in conflicts. Could you fix it? 🙏
|
/test |
Quality Gate passedIssues Measures |
* mage: add check that links are live in the OTel README This PR adds a utility based on the `link-patrol` command to check if links in a given file are live. Added a check in the `check` and `otel:readme` targets to validate all links in the Otel Readme are valid. * remove unused directive for forbidigo * update doc for LinkCheck * update NOTICE.txt * Update license header with Elastic License 2.0 --------- Co-authored-by: Shaunak Kashyap <[email protected]> (cherry picked from commit 835cd9c) # Conflicts: # go.mod # go.sum
…DME (#5667) * mage: check that links are live in the OTel README (#5443) * mage: add check that links are live in the OTel README This PR adds a utility based on the `link-patrol` command to check if links in a given file are live. Added a check in the `check` and `otel:readme` targets to validate all links in the Otel Readme are valid. * remove unused directive for forbidigo * update doc for LinkCheck * update NOTICE.txt * Update license header with Elastic License 2.0 --------- Co-authored-by: Shaunak Kashyap <[email protected]> (cherry picked from commit 835cd9c) # Conflicts: # go.mod # go.sum * fix conflicts * mage notice * go mod tidy * go get github.com/rednafi/link-patrol/cmd/link-patrol --------- Co-authored-by: Mauri de Souza Meneguzzo <[email protected]>
This PR adds a utility based on the
link-patrol
command to check if links in a given file are live. This utility should be reusable so we can use it to validate other files in the repository.Also added a check in the
check
andotel:readme
mage targets to validate all links in the Otel Readme are valid.What does this PR do?
Why is it important?
./changelog/fragments
using the changelog toolHow to test this PR locally
You can either run
mage check
ormage otel:readme
to trigger the link check.To test it indeed fails if a link is invalid you can introduce a typo and it should fail in subsequent runs.
sed -i 's/featuregate/fff/' internal/pkg/otel/templates/README.md.tmpl
Related issues