-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[WIP] [CI:DOCS] man-page checker: include --format (Go templates) #14046
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I don't need to say DO NOT MERGE, because this isn't even going to pass CI. Current set of failures is:
Those are beyond my ability to fix. And, as will be obvious to anyone who looks at the diffs, I didn't even bother describing any of the options I added in the man pages. This is just a proof of concept. Worth pursuing? If so, would someone like to tag-team with me on it, pushing fixes to this PR? |
The idea is very nice but there is a significant problem with it. The current autocompletion is best effort and far from perfect. For example Also this all depends on the correct use of AutocompleteFormat(). I think this is a good idea but I have to improve AutocompleteFormat() first to actually make this work correctly. I guess it would help to have a test which checks that the suggested field name actually work for the given command. |
Thank you! |
I think we should still merge some of your detected problem (--rollback ordering for example) I will take a look at the autocompletion code to see if there is anything I can improve easily |
@containers/podman-maintainers this is a followup (precursor, actually) to @Luap99's demo this morning. Could each of you PTAL at the diffs and, if you are responsible for any of the modified man pages, take a moment to submit a (separate) PR to update the There is, at this time, no automated checking. This PR probable has to linger for weeks or months while we get the man pages in shape. If you're willing to do the man-page updates piecemeal, I'm willing to keep rebasing and tweaking the script logic. (By "tweak" I mean find, with your help, some way to deal with |
@@ -70,6 +61,14 @@ For a container to send the READY message via SDNOTIFY it must be created with t | |||
| .Policy | Auto-update policy of the container | | |||
| .Updated | Update status: true,false,failed | | |||
|
|||
#### **--rollback** |
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.
We should get this change merged independently from this PR, this is obviously correct and should not have to wait for the other stuff to land which will take more time.
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.
OK, I can submit a mini-PR for this and other obvious fixes. Before I do so, can you (or anyone) comment on the weird "Print the numeric IDs only" line (search for FIXME FIXME) below?
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.
I think this must be under the --quiet option.
As part of work done in containers#14046, fix bugs found in man pages, basically just moving a few descriptions to the right place and removing some undesired asterisks. Signed-off-by: Ed Santiago <[email protected]>
91f5bb4
to
7a652ea
Compare
| .AvgCPU | Average CPU (full precision float) | | ||
| .AVGCPU | Average CPU (formatted) | | ||
| .CPU | Percent CPU (full precision float) | | ||
| .CPUNano | CPU Usage, total, in nanoseconds | | ||
| .CPUSystemNano | CPU Usage, kernel, in nanoseconds | | ||
| .Duration | Same as CPUNano (FIXME: why?) | | ||
| .MemLimit | Memory limit, in bytes | | ||
| .MemPerc | Memory percentage | | ||
| .NetIO | Network IO | | ||
| .BlockIO | Block IO | | ||
| .PIDS | Number of PIDs | | ||
| .NetInput | Network Input | | ||
| .NetOutput | Network Output | | ||
| .BlockInput | Block Input | | ||
| .BlockOutput | Block Output | | ||
| .PerCPU | FIXME: empty array? | | ||
| .PIDs | Number of PIDs | | ||
| .SystemNano | Current system datetime, nanoseconds since epoch | | ||
| .UpTime | WTF? This is Duration (CPUNano) in human-readable form?? | | ||
| .Up | Same as UpTime (FIXME: why?) | |
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.
The rest of the man pages can be slowly filled in if/when people like, but this set here bothers me a little: some of the fields are duplicated for no clear reason; some (Duration?) seem misleading to my untrained eye. I wonder if someone familiar with podman stats
would mind taking a look and confirming that these fields all do what's desired?
Autocomplete is awesome. It offers us a programmatic way to determine the set of values for a given --format option. Use that to make sure the man pages document reality. Signed-off-by: Ed Santiago <[email protected]>
Since these can be way too many to mention, allow '.Field ...' (ellipsis) in man page to indicate "don't bother warning me about fields that show up in completion but not the man page" For those that _are_ enumerable, allow '.Foo.Bar' in the man page table itself. Everything in this commit is iffy (even iffier than the first commit). It might be a very bad idea to recurse deeply into options. OTOH it might offer nice possibilities for man pages. Signed-off-by: Ed Santiago <[email protected]>
Baby steps toward merging containers#14046: document a few of the Go format command-line options. Signed-off-by: Ed Santiago <[email protected]>
As part of work done in containers#14046, fix bugs found in man pages, basically just moving a few descriptions to the right place and removing some undesired asterisks. Signed-off-by: Ed Santiago <[email protected]>
@edsantiago Are you intending on merging this at some point? |
I'm feeling very lost. The PR you just closed was a subset of this one. How can this one be acceptable, but a tiny-subset not be? Looking back at the discussion on that PR, you objected to some duplicate fields (which are also present in this PR, because the underlying completion code is the same). IIUC the completion code cannot easily be fixed to remove the duplication or to hide a subset of fields. So there doesn't seem to be anything I can do: either I document everything, including useless confusing stuff, or I document nothing (which is what we have now). I can't do a middle ground. |
I think we should do this and document all options. Right now we have zero idea about the stability of these options. Removing or renaming fields in structs that are exposed via a template are breaking changes to users. We are very bad a catching stuff like this at review time. If there is a reason to hide some fields from the shell completion then this is a technical problem which can be solved. But I still think we should never expose the internal structs to the fronted, instead use stable (template only) structs and copy the data (and convert where needed) from the internal struct to the template struct. |
Using template-exclusive structs would be a big change, but I agree that it's necessary. Tying our internal data representations to Docker's formats is not sensible or sane in the long run. |
I will not stand in the way of implementing this. My fear is the noice to signal ratio could get out of control. But catching bugs and documenting things like format would be useful. |
A friendly reminder that this PR had no activity for 30 days. |
@edsantiago Going to move forward on this after the consolidation is done? |
@rhatdan I would like to proceed with this one day, but it seems like we still need to have deep conversations about what that would look like, and perhaps do some internal work to mark some formats as hidden. |
Baby steps toward merging containers#14046: document a few of the Go format command-line options. Signed-off-by: Ed Santiago <[email protected]>
@edsantiago: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Baby steps toward merging containers#14046: document Go format options for podman events. This is deliberately imperfect. I am not the right person to document these. I am simply the person who is getting a skeleton framework in place. Signed-off-by: Ed Santiago <[email protected]>
Baby steps toward merging containers#14046: document Go format options for podman images. Signed-off-by: Ed Santiago <[email protected]>
Very belated successor to containers#14046. I don't know why this is so important to me. Probably because we're doing a halfhearted sloppy job of documenting, and new options get added, and not documented, and that's just wrong. I've given up on documenting internal structs. This iteration has a $Format_Exceptions table defined at the top of the xref script, enumerating a hardcoded defined set of podman commands and fields that should remain undocumented. This iteration also forgives completely-undocumented formats. If podman-foo has a --format, but podman-foo.1.md does not list *any* valid fields, the script warns but does not fail. This at least is better than documenting a random mix of fields. This version of the xref script is much slower: 10s vs 4. I think we can live with that in a CI-only script. Signed-off-by: Ed Santiago <[email protected]>
Autocomplete is awesome. It offers us a programmatic way to
determine the set of values for a given --format option.
Use that to make sure the man pages document reality.
Signed-off-by: Ed Santiago [email protected]