Skip to content

Latest commit

 

History

History
122 lines (86 loc) · 3.59 KB

DEVELOPMENT.md

File metadata and controls

122 lines (86 loc) · 3.59 KB

Development

This doc explains how to setup a development environment so you can get started contributing to Knative Eventing. Also take a look at the development workflow and the test docs.

Getting started

  1. Setup Knative Serving
  2. Create and checkout a repo fork

Once you meet these requirements, you can install the GitHub Source!

Before submitting a PR, see also CONTRIBUTING.md.

Requirements

You must have the core of Knative Serving running on your cluster.

You must have ko installed.

Checkout your fork

The Go tools require that you clone the repository to the src/knative.dev/eventing-github directory in your GOPATH.

To check out this repository:

  1. Create your own fork of this repo
  2. Clone it to your machine:
mkdir -p ${GOPATH}/src/knative.dev
cd ${GOPATH}/src/knative.dev
git clone [email protected]:${YOUR_GITHUB_USERNAME}/eventing-github.git
cd eventing-github
git remote add upstream [email protected]:knative/eventing-github.git
git remote set-url --push upstream no_push

Adding the upstream remote sets you up nicely for regularly syncing your fork.

Once you reach this point you are ready to do a full build and deploy as follows.

Installing Source

Once you've setup your development environment, install the Github Source with:

ko apply -f config

These commands are idempotent, so you can run them at any time to update your deployment.

If you applied the GitHub Source, you can see things running with:

$ kubectl -n knative-sources get pods
NAME                          READY     STATUS    RESTARTS   AGE
github-controller-manager-0   1/1       Running   0          2h

You can access the Github eventing manager's logs with:

kubectl -n knative-sources logs \
    $(kubectl \
        -n knative-sources \
        get pods \
        -l control-plane=github-controller-manager \
        -o name \
    )

Iterating

As you make changes to the code-base:

These are both idempotent, and we expect that running these in the master branch to produce no diffs.

To verify that your generated code is correct with the new type definition you can run ./hack/verify-codegen.sh. On OSX you will need GNU diff version 3.7 that you can install from brew with brew install diffutils.

To check that the build and tests passes please see the test documentation or simply run ./test/presubmit-tests.sh.

Once the codegen and dependency information is correct, redeploy using the same ko apply command you used Installing a Source.

Or you can clean it up completely and start again.

Tests

Running tests as you make changes to the code-base is pretty simple. See the test docs.

Clean up

You can delete Knative Sources with:

ko delete -f config/