-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: Cross-Reference API Endpoints & CLI Commands; Include Command ACL Info #11031
Conversation
…nts and commands; including ACL info for commands.
🤔 This PR has changes in the |
@karl-cardenas-coding, @trujillo-adam, @blake : we should align on a consistent approach for one command/endpoint before I proceed any further. I've created some possible approaches for you to react to (that exist in this PR's diff and have been rendered into the images below). In all images, the light blue box shows the content that has been added / differs between options. Let me know what your thoughts on which options are best or other options to try. Cross-referencing HTTP API endpoints from command docsTLDR: pick option 1? I think option 1 is much more scannable, though it won't be visually consistent with its counterpoint cross-ref on the HTTP API endpoint docs page (see options below). Still, I think option 1 is better. Cross-referencing CLI Commands from HTTP API endpoints docsTLDR: pick option 1? But if we pick option 2 instead, we might want to pick option 2 above as well. Option 1 is more scannable. Unfortunately, by adding a column, there's less space for some other columns (like the endpoint). For some endpoints, the content may wrap onto two lines... though I'm not sure that's a big deal. Maybe there's a more concise, but still clear, column header than "Corresponding CLI Command". Option 2 can be made consistent with its counterpoint cross-ref on the command docs page (see option 2 above). Including ACL Info in CLI command docsTLDR: maybe the table from option 3, but decide whether/how we mention blocking queries, agent caching, and other consistency modes ( Options 1 and 2: I wanted to follow the same structure as on the HTTP API endpoint docs, but if we only have one column (because some of the other columns don't apply) ... it looks weird. I suppose we could just have a text line that says "ACL Required: Option 3: technically, some commands support the Option 4: gives the most complete information, but I find it very confusing to mix what's directly supported by the command versus what would be supported if the corresponding HTTP API endpoint was used instead. Included to have some variety to consider, but I don't think this is a good option. Options 2-4 try different approaches to mention blocking queries, agent caching, and other consistency modes ( Option 5: simple, but not visually consistent with how the HTTP API endpoint docs present this info. Also doesn't include consistency mode. |
I really like the options you have put together and thank you for making it easier for us all to review. Here are my thoughts. Cross-referencing HTTP API endpoints from command docs -> Option 1 Cross-referencing CLI Commands from HTTP API endpoints docs -> Option 1 Including ACL Info in CLI command docs -> Option 3 I agree with all the points you made. The ACL info was a bit tougher to choose, but I think adding too much detail increases the complicity and could result in practitioners getting intimidated. Option 3 seems to be a good sweet spot imo. |
@trujillo-adam, @blake : any different opinions? It seems like @karl-cardenas-coding and I are both thinking: Cross-referencing HTTP API endpoints from command docs -> Option 1 Cross-referencing CLI Commands from HTTP API endpoints docs -> Option 1 Including ACL Info in CLI command docs -> Option 3 |
Regarding the Cross-referencing HTTP API endpoints from command docs change, I like the endpoint cross-ref in a paragraph under the description because my assumption is that the users' primary goal is get information about the command; the API endpoint is secondary. Regarding the Cross-referencing CLI Commands from HTTP API endpoints docs change, I generally like adding the command to the table, but I wonder if we should take this opportunity to reconsider which columns we're standardizing on. would want to know what kind fo payloads a PUT or POST takes and what parameters are available, and which params are required. Does a table even make sense considering that there is only one row of data? I'me sure we've done it in the past, but it was probably driven by the context, i.e., done to maintain consistency within the same page of content. It's great that you are adding this info to the API refs, but it should be implemented as part of a larger improvement strategy. We should have that discussion outside of this PR. Regarding the Including ACL Info in CLI command docs change, while I think we should be using tables more often, I am not sure that a single-row of information in table format is better than a bulleted list. That said, I am onboard with providing complete information a la option #4. |
@trujillo-adam: thanks for the input! A few follow-ups.
I'd advocate for a good solution sooner rather than making no changes until we have a future, more perfect solution. I'm totally onboard with a larger improvement strategy to how we present that kind of information for APIs (existing docs) and commands (proposed in this PR). But if that may not happen soon, there's only upside in providing the information now:
Q: What are your thoughts? And if you agree, do you think option 1 or 2 makes more sense as an interim solution?
Q: What are your thoughts on option 3 (which only has two items)? It's the most "complete" in terms of what's available via the command.
Summary: lots of words to say "I'm on the fence about options 1 + 2". Based purely on my own experience (not based on any user observation/studies), I'm not sure it's always the case that the user's primary goal is to get information about the command. For example, when I've wanted to figure out how to create an intention in Consul, my workflow is typically to Google search "Consul create intention" and click on whatever link shows up that seems relevant. Sometimes I end up on the "Command" page when I really wanted the HTTP API, and vice-versa. Regardless of the percentage breakdown, we probably have a mix of people who:
I agree with you that option 2 is better for Case A. I think option 1 is better for Case B. But I think either option can be acceptable for both cases. If Case A is more common, option 2 is probably better... That said, it feels a bit strange (inconsistent) to choose option 2 for "CMD: CROSS-REFERENCING" but not option 2 for "API: CROSS-REFERENCING". |
Sorry for the long pause on this.
I'm kind of surprised we don't use swagger or some other API docs generator. Perhaps we can bring this up with the team putting together the new docs website.
I'm still struggling with the concept of bolting on a solution (albeit, an improvement) to the existing framework. Tables are awesome for organizing related info, but single-row and two-column tables might create too much maintenance overhead (especially in MD) because the code can get so ugly. That said, what if we go with something like this:
Rather than creating multiple single-row tables, we just do a two-column table with all components listed. Better yet, we can skip the table and just create a list. DescriptionThis endpoint returns all checks that are registered with the local agent. Details
It looks like we have some precedent for describing this info: I'm all for providing the most complete information, but if there isn't a compelling reason to describe the information in a table (two-column, single-row) we should just use a list. If the list items can't be stated concisely, then it usually indicates that a subsection should be created to keep the content scannable.
We know that people discover content the way you describe, but we should be logically consistent for the given context and assume that people accessed this page because they want to learn about the command. I prefer option 2.
I don't think this matters--they are completely different sections. |
Closing this unmerged. The work started here was carried forward in two other PRs since merged: |
Intended to close #3134. Meant to accomplish:
We should align on a consistent approach for one command/endpoint before applying the approach to all commands/endpoints.
Steps: