-
Notifications
You must be signed in to change notification settings - Fork 57
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
docs: how to use pebble api #545
Conversation
Capturing my initial thoughts before I do a more detailed review (not today):
|
On the title: I think we should base this how-to on a scenario, which is also what we discussed earlier when talking about Pebble how-to guide ideas, see the doc here (internal only, sorry). The scenario in the example is indeed "Automate service testing", but the same pattern can be used in anything that needs to be automated. So maybe using "Automate service testing" as the title would be too narrow, because if I'm a user of Pebble and I want to use Pebble for some automation work but not automated testing, seeing this title would not attract me and I might not click on it. On making Pebble available in the env: I think "how to make Pebble available in the CI env" is a tricky question to answer, mostly because there is no right answer because the CI runner could be a VM where Pebble can be installed in many ways: manual/configuration management/built in the custom image, or it could be an OCI image where Pebble is or is not the entrypoint. Maybe we want to recommend using a container CI runner with Pebble as the entrypoint (from Canonical's standpoint), but it is too opinionated and may only be preferred/known by/to rock/charm users. So, how about we only slightly mention that it must be available as a prerequisite, list a few options, but don't recommend a specific one? On adding more steps to run tests: For similar reasons, some detailed steps (or even some mocks) to run some tests are not included, because there are many ways. Maybe the user doesn't want to trigger the tests in one script. Maybe the users can have a setup script, then run a test in a different step, then another step for the teardown. The applications could be endless. What's more, I think the goal of a how-to is not to provide something the user can copy-paste and reproduce (that would be the goal of a tutorial), but to show how to use some feature and why this feature can be useful. On the order of the ways to access the API: Compared to systemd, the API is a strong selling point, but it's not logical to put curl in the first place. However, not leading with curl is a bit tricky because it's the most well-known and easy-to-start method for API access. Thoughts? Shall we reorder it to something like Python-Go-curl? (Ranking Python before Go purely because of the TIOBE index). |
I'm adding suggestions on specific parts. To continue the discussion of the general comments:
|
I've finished adding comments on specific parts. There are two main refactoring suggestions here and here. Copying the outstanding discussion points from earlier:
|
Note that the docs build is failing now. |
Refactored after our discussion. Changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice new doc, thanks! I've finished reviewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor comments, and one comment about not trying to reuse content between reference and how-to. But this is looking very good now, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit suggestion, but this looks good to me -- approved!
Co-authored-by: Ben Hoyt <[email protected]>
Add a new how-to guide for Pebble and refactor existing Pebble API introduction content as reusable content.
Preview: https://canonical-pebble--545.com.readthedocs.build/en/545/how-to/use-the-pebble-api/