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

test: add a test to check for correct internal links, and fix them #4421

Merged
merged 5 commits into from
Feb 14, 2024

Conversation

pb8o
Copy link
Contributor

@pb8o pb8o commented Feb 1, 2024

Add a test to check that internal links in markdown files are correct.

Also restrict both markdown tests to only check for files within the git repo.

Changes

  • Restrict style checks to files commited in git. This helps with very messy workspaces.
  • A new check for markdown internal links.
  • A new devtool command to quickly run style checks.

Reason

This should help internal and external contributors run style checks quickly, which is one of the DevEx pain points we currently have.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@pb8o pb8o self-assigned this Feb 1, 2024
@pb8o pb8o added Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` Type: Documentation Indicates a need for improvements or additions to documentation Status: Awaiting author Indicates that an issue or pull request requires author action python Pull requests that update Python code labels Feb 1, 2024
Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e3b93fa) 81.37% compared to head (60e9101) 81.37%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4421   +/-   ##
=======================================
  Coverage   81.37%   81.37%           
=======================================
  Files         243      243           
  Lines       29518    29518           
=======================================
  Hits        24021    24021           
  Misses       5497     5497           
Flag Coverage Δ
4.14-c5n.metal 78.66% <ø> (ø)
4.14-c7g.metal ?
4.14-m5d.metal ?
4.14-m5n.metal 78.65% <ø> (ø)
4.14-m6a.metal 77.77% <ø> (ø)
4.14-m6g.metal 76.73% <ø> (ø)
4.14-m6i.metal 78.64% <ø> (ø)
4.14-m7g.metal 76.73% <ø> (ø)
5.10-c5n.metal 81.32% <ø> (?)
5.10-c7g.metal ?
5.10-m5d.metal ?
5.10-m5n.metal 81.31% <ø> (ø)
5.10-m6a.metal 80.53% <ø> (ø)
5.10-m6g.metal 79.63% <ø> (ø)
5.10-m6i.metal 81.31% <ø> (ø)
5.10-m7g.metal 79.63% <ø> (ø)
6.1-c5n.metal 81.32% <ø> (ø)
6.1-m5n.metal 81.31% <ø> (?)
6.1-m6a.metal 80.53% <ø> (ø)
6.1-m6g.metal 79.63% <ø> (ø)
6.1-m6i.metal 81.31% <ø> (ø)
6.1-m7g.metal 79.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pb8o pb8o added Status: Awaiting review Indicates that a pull request is ready to be reviewed and removed Status: Awaiting author Indicates that an issue or pull request requires author action labels Feb 1, 2024
@wearyzen
Copy link
Contributor

wearyzen commented Feb 1, 2024

Tagging the issue which was created for this: #4342
also a general question: why not use the mlc tool mentioned in the issue which can find internal and external broken links?

@pb8o
Copy link
Contributor Author

pb8o commented Feb 12, 2024

Tagging the issue which was created for this: #4342 also a general question: why not use the mlc tool mentioned in the issue which can find internal and external broken links?

Because I would rather not introduce a new dependency if it doesn't buy us much. Checking for internal links is pretty simple. And checking for external links I think it should not be done as part of CI (we can sync on that offline).

@pb8o pb8o force-pushed the check-mdwn-internal-links branch 7 times, most recently from fca663f to a56e48e Compare February 14, 2024 09:47
roypat
roypat previously approved these changes Feb 14, 2024
@pb8o pb8o force-pushed the check-mdwn-internal-links branch 3 times, most recently from 9f82ee3 to 8f3253e Compare February 14, 2024 12:43
roypat
roypat previously approved these changes Feb 14, 2024
Add a helper function to only consider files in the repo. This helps if
the local workspace has files coming from other sources, like the linux
kernel, or uncommitted changes.

Signed-off-by: Pablo Barbáchano <[email protected]>
Add a test to check that internal links in markdown files are correct.

Also restrict both markdown tests to only check for files within the git
repo.

Signed-off-by: Pablo Barbáchano <[email protected]>
This helps when the workspace includes files not commited in the repo.

Signed-off-by: Pablo Barbáchano <[email protected]>
This is convenient to add all the style checks locally

Signed-off-by: Pablo Barbáchano <[email protected]>
@wearyzen wearyzen merged commit f3549ec into firecracker-microvm:main Feb 14, 2024
7 checks passed
@pb8o pb8o deleted the check-mdwn-internal-links branch February 14, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` python Pull requests that update Python code Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Documentation Indicates a need for improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants