Rewriting the GitHub Event Sample README#343
Conversation
|
Grant for LGTM: Evan for Approval: |
|
/test pull-knative-eventing-integration-tests |
|
/cc @grantr (cc requests my review, so I can track this in a different email label) |
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that 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 here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
4f4487b to
427dd5a
Compare
|
CLAs look good, thanks! |
evankanderson
left a comment
There was a problem hiding this comment.
This looks pretty good, thanks for updating!
| ```shell | ||
| kubectl apply -f https://storage.googleapis.com/knative-releases/eventing/latest/release.yaml | ||
| ``` | ||
| - A custom domain is setup to allow for GitHub to be able to call into the cluster, |
| # This will show the available Subscriptions created from the Flow: | ||
| kubectl get subscriptions -o yaml | ||
| Because the `github` EventSource needs to create a `Service.serving.knative.dev` | ||
| and call the Kubernetes watch API on events, you'll need to provision a special |
There was a problem hiding this comment.
I don't think github needs to call the Kubernetes watch API, does it?
| ``` | ||
|
|
||
| Then create the secret so that you can see changes: | ||
| The `eventing/samples/github-events/auth.yaml` file provisions a service account, creates a role |
There was a problem hiding this comment.
I don't think you want eventing in this path.
In fact, I'd make this a relative path, so that it can be easily moved to knative/docs when ready.
There was a problem hiding this comment.
The docs are written to run from the root of the docs directory so I have already changed things to make that assumption: eventing/samples/github-events
|
|
||
| Then create the secret so that you can see changes: | ||
| The `eventing/samples/github-events/auth.yaml` file provisions a service account, creates a role | ||
| which can create Service in the `default` namespace and can view all |
|
|
||
| Then create the secret so that you can see changes: | ||
| The `eventing/samples/github-events/auth.yaml` file provisions a service account, creates a role | ||
| which can create Service in the `default` namespace and can view all |
There was a problem hiding this comment.
Why does it need to view kubernetes resources?
| legit True <none> | ||
| ``` | ||
|
|
||
| 1. Create a [personal access token](https://github.com/settings/tokens) to |
There was a problem hiding this comment.
This needs a little more detail. At a minimum:
- What scopes should be selected?
- Does the name matter?
- Mention that you'll need to copy the string once, and if you forget to/lose it, you'll need to generate a new one.
There was a problem hiding this comment.
A screenshot would be nice, feel free to leave as a TODO.
There was a problem hiding this comment.
Added a screenshot and a paragraph with the requested info.
| 1. Create a [personal access token](https://github.com/settings/tokens) to | ||
| GitHub repo that the GitHub source can use to register webhooks with the | ||
| GitHub API. Also decide on a token that your code will use to authenticate | ||
| the incoming webhooks from GitHub (*accessToken*). Update |
There was a problem hiding this comment.
What are the properties that this token should have? Just a unique string?
There was a problem hiding this comment.
Maybe there's an easy way to generate a unique 12-character alphanumeric string (pwgen or head -c 8 /dev/urandom | base64encode might work)?
| legit True <none> | ||
| ``` | ||
|
|
||
| 1. Create a [personal access token](https://github.com/settings/tokens) to |
There was a problem hiding this comment.
I'd also call out that we use the same token for both the flow (to set up the webhook) and the function (to read and update the PR title).
I'd also move this step up before step 2 (kubectl apply -f function.yaml), so that the secrets are in place and the service has everything it needs before step 3 (wait for service to become ready).
|
|
||
| ## Understanding what happened | ||
|
|
||
| ...TODO... |
There was a problem hiding this comment.
I'd make this more formal:
TODO: explain the resources and communication channels, as well as where the secret is used.
There was a problem hiding this comment.
In particular include a note to look at https://github.com/<owner>/<repo>/settings/hooks to see the webhook registered and then deleted.
| ``` | ||
|
|
||
| And you can check the repo and see the webhook has been removed | ||
| To clean up the function, `Flow`, auth, and secret: |
There was a problem hiding this comment.
Also mention deleting the github Personal Access Token from the github UI.
| FROM golang AS builder | ||
|
|
||
| WORKDIR /go/src/github.com/knative/docs/ | ||
| ADD . /go/src/github.com/knative/docs/ |
There was a problem hiding this comment.
Dockerfile pathing is relative to the dockerfile itself which causes two issues here:
- this github-events directory's contents gets placed under /go/src/github.com/knative/docs/ which results in an unable to find eventing/samples/github-events error when compiling. This can be fixed by changing the above command to
ADD . /go/src/github.com/knative/docs/eventing/samples/github-events - Because we are only copying the github-events dir we lack the deps for this example (which are in docs/vendor). ISTM we can either add them with go get or add dep to the docker image along with a Gopkg config and then run dep ensure.
There was a problem hiding this comment.
Thanks for the tip! I will be sure to fix this up.
|
Updated, PTAL @evankanderson |
|
Follow-up move to docs: knative/docs#339 |
|
Follow-up to delete the github samples from eventing repo: #383 |
| # This will show the Revision that was created by the Configuration: | ||
| kubectl get revisions -o yaml | ||
| ``` | ||
| - A Kubernetes cluster with Knative installed. Follow the |
There was a problem hiding this comment.
This should probably be with Knative serving installed.
| if you need to create one. | ||
| - [Docker](https://www.docker.com/) installed and running on your local machine, | ||
| and a Docker Hub account configured (you'll use it for a container registry). | ||
| - The core Knative eventing tools installed. You can install them with: |
There was a problem hiding this comment.
I don't think I'd call these "tools". Maybe The Knative eventing core installed.? Alternately, amend the above to say A Kubernetes cluster with Knative serving and eventing installed.
| ```shell | ||
| kubectl apply -f https://storage.googleapis.com/knative-releases/eventing/latest/release.yaml | ||
| ``` | ||
| - A custom domain is setup to allow for GitHub to be able to call into the cluster: |
There was a problem hiding this comment.
The grammar here doesn't line up with the other bullets. I'd rephrase this to A domain name that allows GitHub to call into the cluster.
| ko apply -f sample/github/flow.yaml | ||
| ``` | ||
| Because the `github` EventSource needs to create a | ||
| `Service.serving.knative.dev`, you'll need to provision a special |
There was a problem hiding this comment.
I'd recommend using the non-fully scoped name here: EventSource needs to create a Knative Service
| The token can be named anything you find convenient. This sample requires | ||
| full `repo` control to be able update the title of the _Pull Request_. | ||
| The Source requires `admin:repo_hook`, this allows it to create webhooks | ||
| into repos that your account is allowed to do so. Copy and save this token, |
There was a problem hiding this comment.
Replace the comma with a semicolon: Copy and save this token; GitHub will...
|
Updated both knative/docs#339 and here. |
|
/test pull-knative-eventing-integration-tests |
2 similar comments
|
/test pull-knative-eventing-integration-tests |
|
/test pull-knative-eventing-integration-tests |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: n3wscott If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/assign @evankanderson |
|
New changes are detected. LGTM label has been removed. |
|
Closed in favor of knative/docs#339 |
Based on feedback from https://github.com/knative/eventing/pull/276/files#diff-f9667ca3c88cf4316ebe5aab2d712207 I have updated the README to be more in-line with what the current docs repo does.
Note: I have also staged the commands for the move to
knative/docs/eventing/samples/github-events@evankanderson : I need guidance on how much of the "What just happened" second needs to be pulled from the k8s event or if we can point to that?
Related to #333
Dependent on #340