Skip to content

Unit test to require execution module documentation - #52368

Merged
Ch3LL merged 60 commits into
saltstack:developfrom
mchugh19:doc_tests
Jun 6, 2019
Merged

Ch3LL merged 60 commits into
saltstack:developfrom
mchugh19:doc_tests

Conversation

@mchugh19

@mchugh19 mchugh19 commented Mar 30, 2019 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds unit test to validate that salt module, state, returners, wheel, etc files have a matching rst in docs and checks that doc rst files have matching py.
Also adds missing docs so that the tests pass

Previous Behavior

Modules could be added without documentation link

New Behavior

Unit test will catch that modules do not have associated docs

python tests\runtests.py -n unit.test_doc.DocTestCase.test_states_doc_files

AssertionError: 'zabbix_usermacro' not found in ['acme', 'alias', '...
'zone', 'zookeeper', 'zpool'] : State file zabbix_usermacro is missing documentation in ...salt/doc/ref/states/all

Tests written?

Yes

Commits signed with GPG?

No

@mchugh19
mchugh19 requested a review from a team as a code owner April 2, 2019 07:05

@waynew waynew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! I ❤️ better docs!

@waynew

waynew commented Apr 2, 2019

Copy link
Copy Markdown
Contributor
02:09:36 /var/jenkins/workspace/pr-doc_PR-52368-YBQWFDKYTXAEE66QNONYBROXKZYDY3U4XQ4FDLNWAOWZLXEJGTKA/salt/states/azurearm_dns.py:docstring of salt.states.azurearm_dns:22:Field list ends without a blank line; unexpected unindent.
02:09:36 make: *** [html] Error 2
02:09:36 make: Leaving directory `/var/jenkins/workspace/pr-doc_PR-52368-YBQWFDKYTXAEE66QNONYBROXKZYDY3U4XQ4FDLNWAOWZLXEJGTKA/doc'```

waynew
waynew previously requested changes Apr 2, 2019

@waynew waynew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like the doc build failed

@mchugh19

mchugh19 commented Apr 2, 2019 •

Copy link
Copy Markdown
Contributor Author

Yep. Since the test finds missing docs, I then added lots of missing rst files. Because they've never been used, it turns out there are many typos and errors that Sphinx chokes on. I've then started going through those errors and I'm now up to working through the state errors. So it will probably be another couple of days until I can get everything building again.

While needed it's turned out to be a suckier project than first expected. But I now know a bit more about rst syntax than I did before 😋

Relatedly, once it works, we'll want to get this merged quickly as it has required touching lots of module files to fix their documentation. Letting it linger risks constant merge conflicts.

@waynew

waynew commented Apr 2, 2019

Copy link
Copy Markdown
Contributor

That makes sense :)

Ping me when it's (re)-ready to merge and I'll make sure to get it shepherded 🐑 🚀 😀

@mchugh19

mchugh19 commented Apr 3, 2019 •

Copy link
Copy Markdown
Contributor Author

Down to the last doc error of:

Warning, treated as error:
<autosummary>:1:Unknown target name: "aws kms envelope encryption".

Edit: looks like it's from aws_kms renderer. Taking a look...

Any thoughts? Otherwise this looks good to go!

Pshew!

@mchugh19

mchugh19 commented Apr 4, 2019

Copy link
Copy Markdown
Contributor Author

I think we've got a clean build!

The unit test only checks that each python file has a corresponding rst file. The doc build process errors if the rst file isn't referenced, forcing the human to add the entry to an index file, but it doesn't clearly state that process. Not sure how often that comes up, but in PRs it should be discovered.

Anyway, I think this is all set to go. @waynew care to look it over once more with the team and merge?

@mchugh19 mchugh19 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

build is now clean

@waynew
waynew dismissed their stale review April 5, 2019 16:45

changes 👍

@mchugh19

Copy link
Copy Markdown
Contributor Author

ping @waynew. This should go in before too many conflicting files are updated.

@waynew

waynew commented Apr 17, 2019

Copy link
Copy Markdown
Contributor

Hey @mchugh19 It appears that something is wonky with the PR builds. Specifically, they're failing before the tests even start. Could you try rebasing? If that doesn't clear up the tests then we may want to try just opening a new PR, but 🤞

@mchugh19

mchugh19 commented Apr 17, 2019 via email

Copy link
Copy Markdown
Contributor Author

@max-arnold max-arnold mentioned this pull request May 1, 2019
@mchugh19

Copy link
Copy Markdown
Contributor Author

The failed lint job doesn't appear related to this PR

@dwoz

dwoz commented May 16, 2019

Copy link
Copy Markdown
Contributor

re-run lint

@waynew

waynew commented May 23, 2019

Copy link
Copy Markdown
Contributor

Pretty sure these other failures are also unrelated - re-running now (they look like they failed in the setup step)

@mchugh19

Copy link
Copy Markdown
Contributor Author

Can we get this backported to earlier releases? Docs should probably be accurate for supported releases.

@Ch3LL

Ch3LL commented May 31, 2019

Copy link
Copy Markdown
Contributor

of course! I'll add the backport label and it will get backported when its merged.

@Ch3LL Ch3LL added the bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch label May 31, 2019
Correct spacing
@Ch3LL Ch3LL added the Awesome label Jun 6, 2019
@Ch3LL
Ch3LL merged commit 124c8ec into saltstack:develop Jun 6, 2019
@Ch3LL

Ch3LL commented Jun 6, 2019 •

Copy link
Copy Markdown
Contributor

thanks for this one @mchugh19 ! This will be great to have. I'll try backporting it tomorrow or monday :)

@Ch3LL Ch3LL added Bugfix - [Done] back-ported and removed bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch labels Jun 11, 2019
@mchugh19
mchugh19 deleted the doc_tests branch July 4, 2019 14:22
mchugh19 pushed a commit to mchugh19/salt that referenced this pull request Jan 19, 2020
Unit test to require execution module documentation
dwoz added a commit that referenced this pull request Apr 14, 2020
Port #52368 doc requirement tests to master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants