-
Notifications
You must be signed in to change notification settings - Fork 244
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
Refactor machine output code #4948
Refactor machine output code #4948
Conversation
✔️ Deploy Preview for odo-docusaurus-preview ready! 🔨 Explore the source changes: 48e1261 🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/612de797c21e620008441c67 😎 Browse the preview: https://deploy-preview-4948--odo-docusaurus-preview.netlify.app |
e10a1ac
to
273ef99
Compare
/test v4.8-integration-e2e |
273ef99
to
f610a55
Compare
cd8aa02
to
1f9242c
Compare
1f9242c
to
8718326
Compare
8718326
to
6ee2bb6
Compare
5fc79f8
to
a8b1aaf
Compare
a8b1aaf
to
a0fd065
Compare
/test v4.8-integration-e2e
|
/test v4.8-integration-e2e
|
/test v4.8-integration-e2e (passes locally)
|
a0fd065
to
7045a40
Compare
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.
Only reviewed the documentation changes.
@@ -0,0 +1,43 @@ | |||
--- | |||
title: JSON Output | |||
sidebar_position: 2 |
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're planning to put Spring Boot + Postgres in the "Using odo" section such that it'll show the complete flow starting from creating a component to creating URL, storage, services, and linking with services, components, etc. In that context, putting JSON Output doc under "Using odo" seems out of place to me.
For a few guides that we're importing from old website which don't make sense to be put in "Using odo" section, we are putting them under "Tutorials". A PR is open for it #4934.
I'm inclined to put this under "Tutorials" as well. What do you feel?
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 would prefer to place this page under a "Reference" section
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.
Yes, that makes a lot of sense. Where do you think we could put up that section? Current sections:
- Introduction (no sub-sections)
- Getting Started
- Using odo
- Command Reference
- Tutorials
- Architecture
- Contributing to odo
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.
This page could appear at the end of the Command Reference section
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.
Ack. 👍🏾
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.
@feloy can you create a new page and move this to the Command Reference
section, or do you intend to do this in another PR?
| odo application list | List (odo.dev/v1alpha1) | Application (odo.dev/v1alpha1) | ? | | ||
| odo catalog list components | List (odo.dev/v1alpha1) | ComponentType (odo.dev/v1alpha1) (s2i) / *missing* (devfile) | yes (s2i) / yes (devfile) | | ||
| odo catalog list services | List (odo.dev/v1alpha1) | ClusterServiceVersion (operators.coreos.com/v1alpha1) | ? | | ||
| odo catalog describe component | *missing* | *n/a* | yes | |
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.
How's "missing" different from "n/a"?
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.
"missing" indicates that the output does not contain the kind/version information, but should contain it.
| commands | Kind (version) | Kind (version) of list items | Complete content? | | ||
|--------------------------------|-----------------------------------------|--------------------------------------------------------------|---------------------------| | ||
| odo application describe | Application (odo.dev/v1alpha1) | *n/a* |no | | ||
| odo application list | List (odo.dev/v1alpha1) | Application (odo.dev/v1alpha1) | ? | |
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.
What's the difference between "n/a" and "?" ?
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.
n/a (not applicable) indicates that this information (Kind (version) of list items) if not applicable, because the discussed resource is not a list
"?" is a request for comment from the team, to discuss if the content is useful and complete, or if we should work on it
|
||
The exhaustive list of commands accepting the `-o json` flag is currently: | ||
|
||
| commands | Kind (version) | Kind (version) of list items | Complete content? | |
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.
What does "Complete content" mean? Are there any commands where it's incomplete? I'd expect this to be binary - either JSON output is present or not present. But "Complete" makes me think it's about something else.
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.
Does the content contains all the data present in the human readale output (or more), and is equivalent to it.
/retest-required Please review the full test history for this PR and help us cut down flakes. |
6 similar comments
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
Co-authored-by: Dharmit Shah <shahdharmit@gmail.com>
48e1261
to
584b34a
Compare
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
psi-kubernetes-integration-e2e:
|
/test psi-kubernetes-integration-e2e |
@feloy: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
/lgtm Adding again; removed due to rebase. |
/test psi-kubernetes-integration-e2e |
What type of PR is this?
/kind feature
What does this PR do / why we need it:
Refactored the code for the JSON output of the following commands:
odo debug info
odo env view
odo project create
odo project delete
odo project get
odo project list
odo storage create
odo storage delete
odo url create
odo url list
odo component list
Main changes:
project.GetMachineReadableFormat
function renamed toproject.NewProject
(and similar for other kinds)project.getMachineReadableFormatForList
renamed toproject.NewProjectList
(and similar for other kinds)(o Project) HumanReadableOutput
created (and similar for other kinds)Kinds are capitalized:
Messages are not included in the returned value:
There are no
message
fields in the odo objects (Project, Storage, etc).$ odo project create test1 -o json
{
"kind": "Project",
"apiVersion": "odo.dev/v1alpha1",
"metadata": {
"name": "test1",
"namespace": "test1",
"creationTimestamp": null
},
"message": "Project 'test1' is ready for use"}
Delete commands return a
Status
object:APIs generally does not return the deleted object. If we want to try to be compatible with other Kubernetes CLIs/APIs, we could use the
Status
kind returned by calls to the Kubernetes API DELETE endpoints (example: https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/deployment-v1/#delete-delete-a-deployment).Which issue(s) this PR fixes:
Related to #2784
PR acceptance criteria:
Unit test
Integration test
Documentation
Update changelog
I have read the test guidelines
How to test changes / Special notes to the reviewer: