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

[8.x](backport #5443) mage: check that links are live in the OTel README #5667

Merged
merged 8 commits into from
Oct 8, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 2, 2024

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 and otel:readme mage targets to validate all links in the Otel Readme are valid.

What does this PR do?

Why is it important?

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

How to test this PR locally

You can either run mage check or mage 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

* 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
@mergify mergify bot requested a review from a team as a code owner October 2, 2024 14:28
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Oct 2, 2024
@mergify mergify bot requested review from andrzej-stencel and michel-laterman and removed request for a team October 2, 2024 14:28
Copy link
Contributor Author

mergify bot commented Oct 2, 2024

Cherry-pick of 835cd9c has failed:

On branch mergify/bp/8.x/pr-5443
Your branch is up to date with 'origin/8.x'.

You are currently cherry-picking commit 835cd9c0bf.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   NOTICE.txt
	modified:   dev-tools/mage/check.go
	new file:   dev-tools/mage/gotool/linkcheck.go
	modified:   dev-tools/mage/install.go
	modified:   magefile.go
	modified:   tools/tools.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   go.mod
	both modified:   go.sum

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Copy link
Member

@mauri870 mauri870 left a comment

Choose a reason for hiding this comment

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

There are conflicts in this branch, leaving on hold until I fix them.

Copy link
Contributor Author

mergify bot commented Oct 3, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/8.x/pr-5443 upstream/mergify/bp/8.x/pr-5443
git merge upstream/8.x
git push upstream mergify/bp/8.x/pr-5443

@mauri870
Copy link
Member

mauri870 commented Oct 4, 2024

/test

Copy link
Contributor Author

mergify bot commented Oct 4, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/8.x/pr-5443 upstream/mergify/bp/8.x/pr-5443
git merge upstream/8.x
git push upstream mergify/bp/8.x/pr-5443

Copy link
Contributor Author

mergify bot commented Oct 7, 2024

This pull request has not been merged yet. Could you please review and merge it @mauri870? 🙏

Copy link

@mauri870 mauri870 merged commit 43341b8 into 8.x Oct 8, 2024
14 checks passed
@mauri870 mauri870 deleted the mergify/bp/8.x/pr-5443 branch October 8, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant