kubernetes / contributor-site

Code for kubernetes.dev
https://www.kubernetes.dev
Apache License 2.0
67 stars 149 forks source link

Allow leading spaces for reference links #366

Closed stmcginnis closed 1 year ago

stmcginnis commented 1 year ago

Some of the sites that get pulled in use a mix of inline and reference links. Reference links are expected to have the format of the link reference name in brackets, starting at the beginning of the line, followed by a colon and then the linked target.

Some of the external sites have been found to have some variation on this format though. While markdown references show the format as above, it does work when these link references have leading spacing before the opening bracket. This has caused broken slack links, as one example.

This change updates the regex for identifying these reference links in the get-content script to allow for leading spaces.

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: stmcginnis Once this PR has been reviewed and has the lgtm label, please assign jeefy for approval by writing /assign @jeefy in a comment. 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: - **[OWNERS](https://github.com/kubernetes/contributor-site/blob/master/OWNERS)** 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 commented 1 year ago

Welcome @stmcginnis!

It looks like this is your first PR to kubernetes/contributor-site 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/contributor-site has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

mrbobbytables commented 1 year ago

/ok-to-test

stmcginnis commented 1 year ago

Hmm... there are definitely parts where this is not correct. I can see some cases where there are example markdown comments in docstrings that could be problematic here. There's likely other conditions.

It looks like maybe the safest thing for now would be to just enforce that legitimate link references do not have leading characters. I can try to watch out for those and help catch any incoming issues in reviews.

In the meantime, I'll watch #93 and see if there is any progress there. If I have a good time block to focus on it, I may take that over and give it one more shot. Currently assigned, but that was quite awhile ago and there hasn't been any progress. So likely they didn't realize the amount of work they were signing up for with that one. :D

Will close this for now since it definitely is the best approach. Thanks for taking a look!