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

Link to docs on status errors #381

Merged
merged 5 commits into from
Aug 18, 2021
Merged

Link to docs on status errors #381

merged 5 commits into from
Aug 18, 2021

Conversation

jonabc
Copy link
Contributor

@jonabc jonabc commented Aug 15, 2021

This branch/PR is based off of the docs updates at #380.

The linked updates to documentation mean that the tool can start to promote better self-serve resolution to compliance problems. As a first step, status failures should be linking to the help documents in order to help new users diagnose and hopefully fix any encountered errors.

I originally tried to keep the changes small, since the only product focused change here is to print a message like "see the docs" when the status command found errors. That became difficult and I found myself having to build workarounds because the existing way that reporters and commands interacted involved lots of block yielding and was generally more complex than it needed to be. I decided to rewrite the reporter system to make things simpler, which made adding this new functionality much easier as well.

The reporter and command changes largely amount to two things

  1. Creating report objects in the command class and passing them into reporters. This focuses the reporter into only focusing on how to output information that is gathered in the report object during command runs
  • this puts the command class in control of when report objects are created and when the reporter methods are called
  1. Breaking the nested yield pattern that was used in commands and reporters. Reporter objects can now implement begin and end hooks for each of command, application, source and dependency as needed to output information. It's now simpler to write command methods because there is less use of yielded blocks to add or override functionality

a few things were making the reporters hard to use when
overriding command functionality

- the "around" semantics made it harder and overall
  more confusing
- the reporters being responsible for creating reports
  as well as printing output made it difficult to simplify
  one without affecting the other

removing the latter, and restructuring the reporters
to use begin_* and end_* patterns made the code
significantly simpler and easier to use
Base automatically changed from moar-docs-work to master August 18, 2021 16:32
@jonabc jonabc merged commit 3349d2b into master Aug 18, 2021
@jonabc jonabc deleted the link-to-docs-on-status-errors branch August 18, 2021 17:10
@jonabc jonabc mentioned this pull request Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant