Skip to content

Commit

Permalink
chore(swagger): Update Release 1.27 with latest Gate 1.27 (#338)
Browse files Browse the repository at this point in the history
* chore(swagger): Update Release 1.27 with latest Gate 1.27

* docs(contrib): Update contributing steps

* fix(ci): remove old GHA

* fix(ci): bump version of Golangci-lint
  • Loading branch information
kskewes-sf authored Apr 28, 2022
1 parent 56c5e74 commit 3cc2703
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Ensure code formatting and style is consistent
uses: golangci/golangci-lint-action@v2
with:
version: v1.32
version: v1.45.2

branch-build:
# Only run this on repositories in the 'spinnaker' org, not on forks.
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Ensure code formatting and style is consistent
uses: golangci/golangci-lint-action@v2
with:
version: v1.32
version: v1.45.2

build:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Ensure code formatting and style is consistent
uses: golangci/golangci-lint-action@v2
with:
version: v1.32
version: v1.45.2

release:
runs-on: ubuntu-latest
Expand Down
49 changes: 23 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ Interested in contributing to Spinnaker? Please review the [contribution documen

### Go

[Install Go 1.15.x](https://golang.org/doc/install).
[Install Go 1.17.x](https://golang.org/doc/install).

### Go modules

Clone the repository to a directory outside of your GOPATH:
Clone the repository:

```bash
$ git clone https://github.com/spinnaker/spin
Expand Down Expand Up @@ -38,53 +36,52 @@ Run using

## Running tests

Test using
From the root `spin/` directory run:

```bash
go test -v ./...
```

from the root `spin/` directory.

## Updating the Gate API

Spin CLI uses [Swagger](https://swagger.io/) to generate the API client library for [Gate](https://github.com/spinnaker/gate).

Spin CLI's `master` should be using Gate's `master` swagger definition.

Similarly, each [spin release version](https://github.com/spinnaker/spin/tags) `v{major}.{minor}.{patch}` SemVer should match [Gate's tag](https://github.com/spinnaker/gate/tags) `version-{major}.{minor}`.

Example:
Spin CLI's `master` branch should be using Gate's `master` swagger definition.

| 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 |
Spin CLI's `release-{major}-{minor}.x` branch should be using Gate's
corresponding `release-{major}-{minor}.x` swagger definition.

To update the client library:

- Use the Swagger Codegen to generate the new library and drop it into the spin project

```bash
GATE_REPO_ABSPATH=$(readlink -f ../gate)
cd $GATE_REPO_ABSPATH
# decide branch to update
branch=release-1.##.x

# checkout release branch at tag, eg: v1.22.1
TAG=v1.22.1
git checkout $TAG
# check out appropriate Gate branch
# assuming Gate checked out in same parent directory as spin and up to date
cd ../gate
git checkout "$branch"

# generate Gate swagger client library branch
swagger/generate_swagger.sh

# check out appropriate Spin branch
cd ../spin
git checkout "$branch"

# set Swagger Codegen tool version
SWAGGER_CODEGEN_VERSION=$(cat gateapi/.swagger-codegen/VERSION)

rm -rf gateapi/ \
&& docker run -it \
--user $(id -u):$(id -g) \
-v "${GATE_REPO_ABSPATH}/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/
-v "$PWD/../gate/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/

# create branch off $branch and PR changes
git checkout -b "$branch-swagger"
```

- Commit the changes and open a PR.
2 changes: 1 addition & 1 deletion gateapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Class | Method | HTTP request | Description
*PipelineControllerApi* | [**DeletePipelineUsingDELETE1**](docs/PipelineControllerApi.md#deletepipelineusingdelete1) | **Delete** /pipelines/{id} | Delete a pipeline execution
*PipelineControllerApi* | [**EvaluateExpressionForExecutionAtStageUsingGET**](docs/PipelineControllerApi.md#evaluateexpressionforexecutionatstageusingget) | **Get** /pipelines/{id}/{stageId}/evaluateExpression | Evaluate a pipeline expression at a specific stage using the provided execution as context
*PipelineControllerApi* | [**EvaluateExpressionForExecutionUsingGET**](docs/PipelineControllerApi.md#evaluateexpressionforexecutionusingget) | **Get** /pipelines/{id}/evaluateExpression | Evaluate a pipeline expression using the provided execution as context
*PipelineControllerApi* | [**EvaluateExpressionForExecutionViaPOSTUsingPOST**](docs/PipelineControllerApi.md#evaluateexpressionforexecutionviapostusingpost) | **Post** /pipelines/{id}/evaluateExpression | Evaluate a pipeline expression using the provided execution as context
*PipelineControllerApi* | [**EvaluateExpressionForExecutionViaPOSTUsingPOST1**](docs/PipelineControllerApi.md#evaluateexpressionforexecutionviapostusingpost1) | **Post** /pipelines/{id}/evaluateExpression | Evaluate a pipeline expression using the provided execution as context
*PipelineControllerApi* | [**EvaluateVariablesUsingPOST**](docs/PipelineControllerApi.md#evaluatevariablesusingpost) | **Post** /pipelines/{id}/evaluateVariables | Evaluate variables same as Evaluate Variables stage using the provided execution as context
*PipelineControllerApi* | [**GetPipelineUsingGET**](docs/PipelineControllerApi.md#getpipelineusingget) | **Get** /pipelines/{id} | Retrieve a pipeline execution
*PipelineControllerApi* | [**InvokePipelineConfigUsingPOST1**](docs/PipelineControllerApi.md#invokepipelineconfigusingpost1) | **Post** /pipelines/{application}/{pipelineNameOrId} | Trigger a pipeline execution
Expand Down
2 changes: 1 addition & 1 deletion gateapi/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6168,7 +6168,7 @@ paths:
tags:
- "pipeline-controller"
summary: "Evaluate a pipeline expression using the provided execution as context"
operationId: "evaluateExpressionForExecutionViaPOSTUsingPOST"
operationId: "evaluateExpressionForExecutionViaPOSTUsingPOST_1"
consumes:
- "application/json"
produces:
Expand Down
2 changes: 1 addition & 1 deletion gateapi/api_pipeline_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ PipelineControllerApiService Evaluate a pipeline expression using the provided e
@return map[string]interface{}
*/
func (a *PipelineControllerApiService) EvaluateExpressionForExecutionViaPOSTUsingPOST(ctx context.Context, id string, pipelineExpression interface{}) (map[string]interface{}, *http.Response, error) {
func (a *PipelineControllerApiService) EvaluateExpressionForExecutionViaPOSTUsingPOST1(ctx context.Context, id string, pipelineExpression interface{}) (map[string]interface{}, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
Expand Down
6 changes: 3 additions & 3 deletions gateapi/docs/PipelineControllerApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Method | HTTP request | Description
[**DeletePipelineUsingDELETE1**](PipelineControllerApi.md#DeletePipelineUsingDELETE1) | **Delete** /pipelines/{id} | Delete a pipeline execution
[**EvaluateExpressionForExecutionAtStageUsingGET**](PipelineControllerApi.md#EvaluateExpressionForExecutionAtStageUsingGET) | **Get** /pipelines/{id}/{stageId}/evaluateExpression | Evaluate a pipeline expression at a specific stage using the provided execution as context
[**EvaluateExpressionForExecutionUsingGET**](PipelineControllerApi.md#EvaluateExpressionForExecutionUsingGET) | **Get** /pipelines/{id}/evaluateExpression | Evaluate a pipeline expression using the provided execution as context
[**EvaluateExpressionForExecutionViaPOSTUsingPOST**](PipelineControllerApi.md#EvaluateExpressionForExecutionViaPOSTUsingPOST) | **Post** /pipelines/{id}/evaluateExpression | Evaluate a pipeline expression using the provided execution as context
[**EvaluateExpressionForExecutionViaPOSTUsingPOST1**](PipelineControllerApi.md#EvaluateExpressionForExecutionViaPOSTUsingPOST1) | **Post** /pipelines/{id}/evaluateExpression | Evaluate a pipeline expression using the provided execution as context
[**EvaluateVariablesUsingPOST**](PipelineControllerApi.md#EvaluateVariablesUsingPOST) | **Post** /pipelines/{id}/evaluateVariables | Evaluate variables same as Evaluate Variables stage using the provided execution as context
[**GetPipelineUsingGET**](PipelineControllerApi.md#GetPipelineUsingGET) | **Get** /pipelines/{id} | Retrieve a pipeline execution
[**InvokePipelineConfigUsingPOST1**](PipelineControllerApi.md#InvokePipelineConfigUsingPOST1) | **Post** /pipelines/{application}/{pipelineNameOrId} | Trigger a pipeline execution
Expand Down Expand Up @@ -168,8 +168,8 @@ No authorization required

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **EvaluateExpressionForExecutionViaPOSTUsingPOST**
> map[string]interface{} EvaluateExpressionForExecutionViaPOSTUsingPOST(ctx, id, pipelineExpression)
# **EvaluateExpressionForExecutionViaPOSTUsingPOST1**
> map[string]interface{} EvaluateExpressionForExecutionViaPOSTUsingPOST1(ctx, id, pipelineExpression)
Evaluate a pipeline expression using the provided execution as context

### Required Parameters
Expand Down

0 comments on commit 3cc2703

Please sign in to comment.