-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Switch helloworld-go with kn #2807
Conversation
f9a2790
to
c36b2aa
Compare
@abrennan89 @rhuss I did a similar thing in this PR with |
c36b2aa
to
461cb5b
Compare
461cb5b
to
bf1668c
Compare
Ok, this sample is RFAL here: https://docs-2807.default.docs-on-the-rocks.io/docs/serving/samples/hello-world/helloworld-go/#building-and-deploying-the-sample I updated the tab default to |
I created https://docs.google.com/spreadsheets/d/1Nbp1nb0V1l-8ZfdGnXZMfrcgt6POS9ZbT94Sa8GGFhc/edit#gid=0 to crowd-source going wide on these samples once we have a canonical one landed. |
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.
@mattmoor left a bunch of comments.
In terms of doc structure, I'm really not sure everything in one big doc like this with tabs for samples is the way to go.
I think it's less readable than just creating one focused procedure for each, e.g.
- "Using the
helloworld-go
sample app withkn
CLI" - "Using the
helloworld-go
sample app with YAML"
that live in the same page under the heading of helloworld-go
sample.
Even the prerequisites doc'd this way aren't really correct because they don't mention installing kn
and that is a pre-req but only if you use the procedure using kn
, so I think they should be separate.
A simple web app written in Go that you can use for testing. It reads in an env | ||
variable `TARGET` and prints `Hello ${TARGET}!`. If `TARGET` is not specified, | ||
it will use `World` as the `TARGET`. | ||
|
||
Follow the steps below to create the sample code and then deploy the app to your | ||
cluster. You can also download a working copy of the sample, by running the | ||
following commands: | ||
|
||
```shell | ||
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs | ||
cd knative-docs/docs/serving/samples/hello-world/helloworld-go | ||
``` |
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 simple web app written in Go that you can use for testing. It reads in an env | |
variable `TARGET` and prints `Hello ${TARGET}!`. If `TARGET` is not specified, | |
it will use `World` as the `TARGET`. | |
Follow the steps below to create the sample code and then deploy the app to your | |
cluster. You can also download a working copy of the sample, by running the | |
following commands: | |
```shell | |
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs | |
cd knative-docs/docs/serving/samples/hello-world/helloworld-go | |
``` | |
This guide describes the steps required to to create the `helloworld-go` sample app and deploy it to your | |
cluster. | |
The sample app reads a `TARGET` environment variable, and prints `Hello ${TARGET}!`. | |
If `TARGET` is not specified, `World` is used as the default value. | |
You can also download a working copy of the sample, by running the | |
following commands: | |
```shell | |
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs | |
cd knative-docs/docs/serving/samples/hello-world/helloworld-go |
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 move this part about the working copy to the procedure part, maybe split 1. into two options, i.e. you can copy/paste the code or you can use the "working copy" - also I'd make it clearer what the distinction is here, it's not really clear how stable or unstable each option is
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 I got it all, but LMK if I missed anything.
cd knative-docs/docs/serving/samples/hello-world/helloworld-go | ||
``` | ||
|
||
## Before you begin |
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 do folks feel about standardizing headings for these samples as follows:
Prerequisites
Procedure
Verification steps
Deleting the sample code
?
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.
+1 for the same document structure across all examples. The suggestion looks good to me.
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 followed the headings from @rhuss PR, which I now realize are difference from here. +1 for consistency, I just need to know what we want the shape to be 😅
Run the following command to find the domain URL for your service: | ||
|
||
```shell | ||
kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,URL:.status.url | ||
``` | ||
|
||
Example: | ||
|
||
```shell | ||
NAME URL | ||
helloworld-go http://helloworld-go.default.1.2.3.4.xip.io | ||
``` |
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.
No. 4; also I feel like this should be a verification step instead.
I'm not sure that tabs are the best way to display this info at all tbh...
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 do you suggest? We'd been talking about tabs for a while, which is why I'd bit the bullet here. Definitely open to suggestions.
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.
Looks good, but I would like to add the following suggestions:
- Kn should be added to the prerequisites.
- The command to show the URL can be also performed with
kn describe service helloworld-go -o url
- The service can be deleted with
kn service delete helloworld-go
The latter two commands can be also added as tabs. I'm just preparing an example for the shell sample, which could be used here as blueprint, too.
I really wonder why the test is passing as README.md is removed but /test pull-knative-docs-unit-tests |
ah, here we go ;-) test fails now, too. I'm going to fix this issue / check along with #2832 |
bf1668c
to
6b73224
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
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 think I got all the feedback incorporated. A lot of this was carryover from README.md -> index.md, so we may want to do a pass over the other languages to ensure we're consistently applying the feedback to all of them.
I just pushed a new commit with the changes, and I've rebased this on #2832 where @rhuss fixed the test. I'll check the staged site shortly and make sure things look alright.
A simple web app written in Go that you can use for testing. It reads in an env | ||
variable `TARGET` and prints `Hello ${TARGET}!`. If `TARGET` is not specified, | ||
it will use `World` as the `TARGET`. | ||
|
||
Follow the steps below to create the sample code and then deploy the app to your | ||
cluster. You can also download a working copy of the sample, by running the | ||
following commands: | ||
|
||
```shell | ||
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs | ||
cd knative-docs/docs/serving/samples/hello-world/helloworld-go | ||
``` |
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 I got it all, but LMK if I missed anything.
Run the following command to find the domain URL for your service: | ||
|
||
```shell | ||
kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,URL:.status.url | ||
``` | ||
|
||
Example: | ||
|
||
```shell | ||
NAME URL | ||
helloworld-go http://helloworld-go.default.1.2.3.4.xip.io | ||
``` |
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 do you suggest? We'd been talking about tabs for a while, which is why I'd bit the bullet here. Definitely open to suggestions.
# Build the container on your local machine | ||
docker build -t {username}/helloworld-go . | ||
|
||
# Push the container to docker registry | ||
docker push {username}/helloworld-go |
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, we probably need to update the other samples.
2c45a74
to
f205b7b
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
f205b7b
to
197024a
Compare
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Needs #3004 to fix the local build, but when I pulled it up it looked fine (after some tweaks). |
197024a
to
0f22cfd
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.
Minor suggestions, otherwise lgtm :)
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.
/hold
/lgtm
Thanks Matt! I'm fine with merging this now 🙂 sticking a hold on it to make sure you're done with commits first, but feel free to remove
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abrennan89, mattmoor 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 |
/unhold Yep, done for now. Thanks, @abrennan89 and sorry this took so long for me to circle back 😅 |
lol no problem at all, thank you! |
* Try helloworld-go with kn * Add kn as a prereq. * Incorporate Ashleigh's feedback * Fix @abrennan89 feedback
WIP as this is based on #2805