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

check-links added to repo #1559

Merged
merged 12 commits into from
Nov 4, 2024
Merged

Conversation

RichardChukwu
Copy link
Contributor

feat #300

  • Added a new GitHub Actions workflow for checking markdown links

  • Configured check_links_config.json to include patterns for ignoring certain links (e.g., localhost, example.com)

  • Ensured the workflow is triggered on push and pull requests

  • Tested the configuration locally and via GitHub Actions to verify correct link checking using README.md as a case study and all links were checked

@RichardChukwu RichardChukwu requested a review from a team as a code owner October 17, 2024 20:35
--verbose \
--config .github/workflows/check_links_config.json \
${{needs.changedfiles.outputs.md}} \
|| { echo "Check that anchor links are lowercase"; exit 1; }
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain this line a bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, This line of code runs the markdown-link-check with verbose logging enabled and specifies the custom configuration file (check_links_config.json). The needs.changedfiles.outputs.md variable is used to dynamically target only the markdown files that were modified in the PR.

The || { echo "Check that anchor links are lowercase"; exit 1; } part is a fallback check to ensure that if there are any issues with the anchor links not being lowercase (which is a requirement for valid markdown links), the workflow will fail and print a meaningful message for the contributor to resolve.

However, if this check is redundant, I can adjust or remove it.

Copy link
Member

Choose a reason for hiding this comment

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

Not objecting to the current implementation, but I wonder if maybe a linter would do a better job of that particular edge case. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that a linter might be more appropriate for this edge case, as it would likely cover more general cases of markdown formatting and anchor validation. Not quite sure how to implement exactly for this as I'm new here. I'll appreciate any help @tylerbenson

Copy link
Member

Choose a reason for hiding this comment

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

I don't have any specific insight here. Maybe investigate what other OpenTelemetry repos are doing?

@tylerbenson tylerbenson added the github_actions Pull requests that update GitHub Actions code label Oct 18, 2024
@@ -0,0 +1,4 @@
// <autogenerated />
Copy link
Member

Choose a reason for hiding this comment

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

I think the changes to the dotnet folder need to be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I'll do that

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 @tylerbenson any further changes?

Copy link
Member

@tylerbenson tylerbenson Oct 28, 2024

Choose a reason for hiding this comment

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

I meant the whole dotnet folder should not have any diffs... I think I should only see changes in .github/workflows.

Copy link
Contributor Author

@RichardChukwu RichardChukwu Oct 28, 2024

Choose a reason for hiding this comment

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

Yes, I did notice that those files somewhat gets automatically added after cloning the repo and running a build, hence why they are being commited as changes, not sure why though.

I want to try to reclone and commit the github workflow changes again however to see if it fixes that

Copy link
Contributor Author

@RichardChukwu RichardChukwu Oct 28, 2024

Choose a reason for hiding this comment

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

Done, you should be seeing only the changes in the .github/workflows now @tylerbenson

@@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Copy link
Member

Choose a reason for hiding this comment

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

While I don't know why this file is checked in... I don't think this is the right PR to remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll close this PR then to have a fresh start with new clone then

Copy link
Member

Choose a reason for hiding this comment

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

That shouldn't be necessary. Just undo deleting this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done

@tylerbenson tylerbenson merged commit a7b5001 into open-telemetry:main Nov 4, 2024
11 checks passed
@tylerbenson
Copy link
Member

@RichardChukwu
Copy link
Contributor Author

RichardChukwu commented Nov 14, 2024

@RichardChukwu I'm seeing an odd failure: https://github.com/open-telemetry/opentelemetry-lambda/actions/runs/11840804028/job/32995521705?pr=1593

Would you mind taking a look?

Hello @tylerbenson, seems really odd actually.

From what I can see via the logs, seems like a package.json file seems non-existent and can't be read in the stated path /home/runner/work/opentelemetry-lambda/opentelemetry-lambda/ thereby preventing npm install from running via checks.

Checked the workflow file: https://github.com/open-telemetry/opentelemetry-lambda/blob/main/.github/workflows/check-links.yaml and it shouldn't be giving that error though

@tylerbenson
Copy link
Member

Ok, I'll ignore the error for now. Please investigate.

@tylerbenson
Copy link
Member

We are still seeing errors here. Can you please see what's wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants