serve icon indicating copy to clipboard operation
serve copied to clipboard

Add linting steps to doc-automation workflow

Open sadra-barikbin opened this issue 3 years ago • 13 comments

spellcheck and linkcheck was added to workflow yml file.

Checklist:

  • [x] Did you have fun?

sadra-barikbin avatar Sep 10 '22 05:09 sadra-barikbin

Codecov Report

Merging #1855 (a525833) into master (b2f80d2) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1855   +/-   ##
=======================================
  Coverage   44.95%   44.95%           
=======================================
  Files          63       63           
  Lines        2609     2609           
  Branches       56       56           
=======================================
  Hits         1173     1173           
  Misses       1436     1436           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 10 '22 06:09 codecov[bot]

Thanks @sadra-barikbin this is a good step forward, to merge this here's what's left

  1. The link checker script is working so can you fix all those links? Otherwise all future PRs will will temporarily fail this check until someone does do this. Also check that the output is correct for example I saw some errors pointed out in the ipex example that seemed just fine to me
  2. For the spellchecking, it should only run on the md files that were changed in the PR which you can get like so https://github.com/pytorch/serve/blob/788ede8c2b032a5e46fdceb1e5e1c5f82367b9cd/.github/workflows/lint.yml#L28 and when the check does fail you should tell people what they need to do either fix the typos or add a new word in the dictionary

msaroufim avatar Sep 12 '22 11:09 msaroufim

I noticed you're fixing some links, an important detail is for links in docs folder you need absolute links like a direct link GitHub.com/etc.. if you're linking to anything outside of docs otherwise the generated link will be broken. Anything that includes a .. is likely to be broken for example

I realize this is a bit messy but thank you for patience, this work will save us a lot of time.

msaroufim avatar Sep 12 '22 19:09 msaroufim

Regarding those links, link-checker didn't raise an error. Where exactly you mean those links would break?

sadra-barikbin avatar Sep 12 '22 20:09 sadra-barikbin

Here's a good example https://github.com/pytorch/serve/pull/1794/files

msaroufim avatar Sep 12 '22 22:09 msaroufim

I did. Some link errors need your review.

sadra-barikbin avatar Sep 14 '22 22:09 sadra-barikbin

Is spellcheck really a necessary thing? New words, sequences etc. must get added to its dictionary again and again. We could fix all typos now and remove this step. From now on, typos would most likely be fixed during PR reviews.

sadra-barikbin avatar Sep 14 '22 22:09 sadra-barikbin

Spellchecking is definitely lower priority than finding broken links we can finish that first

msaroufim avatar Sep 14 '22 23:09 msaroufim

@msaroufim any blocker?

sadra-barikbin avatar Sep 17 '22 16:09 sadra-barikbin

The Lint jobs are both red, they should be green for us to merge this specific change. Spellchecking needs to be progressive (only apply to changed files) as we discussed or not used

Also should resolve the merge conflict. Let me know if you have any questions.

msaroufim avatar Sep 18 '22 11:09 msaroufim

@msaroufim , Some links need your review:

  • I could not find a file named Transformer_handler_generalized_v2.py in the repo. referenced in kubernetes/kserve/kf_request_json/v2/bert/README.md. By the way there is examples/Huggingface_Transformers/Transformer_handler_generalized.py
  • [input](10000)s cause error in benchmarks/sample_report.md and I don't know their purpose.
  • I can't find https://github.com/pytorch/serve/tree/master/test/benchmark, referenced in CONTRIBUTING.md
  • I can't find https://github.com/pytorch/serve/settings/actions/runners referenced in benchmarks/README.md

sadra-barikbin avatar Sep 19 '22 06:09 sadra-barikbin

The last commit is about a link which due to a bug in link-check (which markdown-link-check makes use of), action raises an error. I filed an issue for them but for now I did a workaround for that link.

sadra-barikbin avatar Sep 19 '22 21:09 sadra-barikbin

Great to see the lint spellcheck now green

For the links here are some answers to your specific questions

  • Looks like upstream the file changed, I believe this is the correct one https://github.com/kserve/kserve/blob/master/docs/samples/v1beta1/torchserve/v2/bert/sequence_classification/Transformer_kserve_handler.py - this is great though already showing the value of your linter
  • We can make these not links https://github.com/pytorch/serve/blob/master/benchmarks/sample_report.md or add a rule to skip this file whatever is easier
  • Reference this instead https://github.com/pytorch/serve/tree/master/benchmarks
  • Remove runners link since that's only visible to admins of the repo so replace with some phrase like "check the runners tab on Github"

msaroufim avatar Sep 21 '22 20:09 msaroufim

@msaroufim , This repo isn't actively maintained?

sadra-barikbin avatar Sep 29 '22 01:09 sadra-barikbin

It is, folks are just busy with other stuff @lxning @namannandan @agunapal @rohithkrn can one of you please take a look?

msaroufim avatar Sep 29 '22 01:09 msaroufim

@sadra-barikbin please address the last piece of feedback from @namannandan, get the spellcheck job to be green and we should be good to merge this

msaroufim avatar Oct 11 '22 14:10 msaroufim

Done

sadra-barikbin avatar Oct 13 '22 20:10 sadra-barikbin