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

chore: added hack/verify-reports.sh script #3167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mlavacca
Copy link
Member

@mlavacca mlavacca commented Jun 19, 2024

What type of PR is this?

/area conformance

What this PR does / why we need it:

Recently, many submitted reports were not compliant with the rules stated in this document. This PR aims to create a script to automatically check the correctness of the uploaded reports and the structure. The following are the checks performed:

  • a README file exists in the project conformance page
  • such a README does not contain broken links
  • the reports are named according to the pattern <experimental | standard>-<semver>-<mode>-report.yaml
  • the project version is a valid semver
  • the GatewayAPIVersion field matches the folder in which the report has been created
  • the GatewayAPIChannel is either "standard" or "experimental"

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/conformance labels Jun 19, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 19, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mlavacca
Once this PR has been reviewed and has the lgtm label, please assign youngnick for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 19, 2024
@mlavacca
Copy link
Member Author

/test pull-gateway-api-verify

@mlavacca
Copy link
Member Author

/test pull-gateway-api-verify

@mlavacca mlavacca force-pushed the verify_reports branch 3 times, most recently from 982dcaa to 5bbaf47 Compare June 19, 2024 12:16
@mlavacca mlavacca marked this pull request as ready for review June 19, 2024 12:31
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 19, 2024
@mlavacca mlavacca force-pushed the verify_reports branch 2 times, most recently from b5a9d82 to 2a10efc Compare June 19, 2024 13:00
Signed-off-by: Mattia Lavacca <[email protected]>
@mlavacca
Copy link
Member Author

The CI job is intended to fail until #3168 does not get merged

@robscott
Copy link
Member

The CI job is intended to fail until #3168 does not get merged

That PR merged, this one may also need a rebase, we'll see.

/retest

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @mlavacca!

local mode=$(yq eval '.mode' "$report")
local version_pattern="^v?[0-9]+\.[0-9]+(\.[0-9]+)?$"

if [[ ! $version =~ $version_pattern ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Not every implementation is going to have a semantic version, I don't think we can require this check.

error "$report version does not match the semver pattern"
EXIT_VALUE=1
fi
if [[ ${gateway_api_version} != ${expected_gateway_api_version} ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

Where do we expect reports to be stored for patch versions?

Comment on lines +89 to +90
# Check if the README.md has broken links
docker run -v $(readlink -f "$implementation_dir"):/${implementation}:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /${implementation}/README.md
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Indentation looks a bit funky here

Comment on lines +89 to +90
# Check if the README.md has broken links
docker run -v $(readlink -f "$implementation_dir"):/${implementation}:ro --rm -i ghcr.io/tcort/markdown-link-check:stable /${implementation}/README.md
Copy link
Member

Choose a reason for hiding this comment

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

How does this utility work? Can/should we use this for all of our docs? I think some of our links are only valid with mkdocs-material context, would that be able to understand this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/conformance cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants