Skip to content

Latest commit

 

History

History
77 lines (49 loc) · 2 KB

CONTRIBUTING.md

File metadata and controls

77 lines (49 loc) · 2 KB

Contributing

Interested in contributing to Spinnaker? Please review the contribution documentation.

Setup

Go

Install Go 1.13.x.

Go modules

Clone the repository to a directory outside of your GOPATH:

$ git clone https://github.com/spinnaker/spin

Afterward, use go build to build the program. This will automatically fetch dependencies.

$ go build

Upon first build, you may see output while the go tool fetches dependencies.

To verify dependencies match checksums under go.sum, run go mod verify.

To clean up any old, unused go.mod or go.sum lines, run go mod tidy.

Running Spin

Run using

./spin <cmds> <flags>

Running tests

Test using

go test -v ./...

from the root spin/ directory.

Updating the Gate API

Spin CLI uses Swagger to generate the API client library for Gate.

Spin CLI's master should be using Gate's master swagger definition. Similarly, each spin release version v{major}.{minor}.{patch} semver should match Gate's tag version-{major}.{minor}.

Example:

Spin CLI version Gate version
v1.17.3 version-1.17.0
v1.17.2 version-1.17.0
v1.17.1 version-1.17.0

To update the client library:

  • Use the Swagger Codegen to generate the new library and drop it into the spin project
    GATE_REPO_PATH=PATH_TO_YOUR_GATE_REPO
    SWAGGER_CODEGEN_VERSION=$(cat gateapi/.swagger-codegen/VERSION)
    rm -rf gateapi/ \
    && docker run -it \
        -v "${GATE_REPO_PATH}/swagger/:/tmp/gate" \
        -v "$PWD/gateapi/:/tmp/go/" \
        "swaggerapi/swagger-codegen-cli:${SWAGGER_CODEGEN_VERSION}" generate -i /tmp/gate/swagger.json -l go -o /tmp/go/
  • Commit the changes and open a PR.