Skip to content

Commit

Permalink
Remove linting and unit tests from release pipelines 🧹
Browse files Browse the repository at this point in the history
This might be a controversial choice but I think our release Pipelines
should only include Tasks that we expect to give us useful feedback
about the release.

Unit tests and linting should fail on pull requests; if they fail on a
release this means one of two things:

1. The linting/test didn't actually run against the merged version of the
  pull request
2. There is something flakey in the linting/test

In the case of (1) this means the pull request shouldn't have actually
been merged, and this failing at release time means anyone looking at
the releases will now be responsible for fixing this pull request's
problems, therefore we should be sure to run this on the pull request
before actually merging (this is I think what Tide is responsible for).

In the case of (2), why should this block a release?

So I think we should remove these steps entirely, especially in light
of tektoncd/plumbing#241 making these flake.

(I think we could remove "build" from this as well since it's not
actually used to build the resulting artifact, and the step that
actually does build the artifact would fail anyway.)
  • Loading branch information
bobcatfish committed Feb 21, 2020
1 parent 255e8d8 commit cba3ddf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 71 deletions.
2 changes: 0 additions & 2 deletions tekton/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ Install Task from plumbing too:

```bash
# Apply the Tasks we are using from the catalog
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/golang/lint.yaml
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/golang/build.yaml
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/golang/tests.yaml
kubectl apply -f https://raw.githubusercontent.com/tektoncd/plumbing/master/tekton/resources/release/
```

Expand Down
28 changes: 1 addition & 27 deletions tekton/release-pipeline-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,33 +39,7 @@ spec:
- name: notification
type: cloudEvent
tasks:
- name: lint
taskRef:
name: golangci-lint
params:
- name: package
value: $(params.package)
- name: version
value: v1.21
- name: flags
value: -v
resources:
inputs:
- name: source
resource: source-repo
- name: unit-tests
runAfter: [lint]
taskRef:
name: golang-test
params:
- name: package
value: $(params.package)
resources:
inputs:
- name: source
resource: source-repo
- name: build
runAfter: [lint]
taskRef:
name: golang-build
params:
Expand All @@ -76,7 +50,7 @@ spec:
- name: source
resource: source-repo
- name: publish-images
runAfter: [build, unit-tests]
runAfter: [build]
taskRef:
name: publish-tekton-pipelines
params:
Expand Down
43 changes: 1 addition & 42 deletions tekton/release-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,49 +54,8 @@ spec:
resource: bucket
- name: source-to-release
resource: source-repo
- name: lint
runAfter: [precheck]
taskRef:
name: golangci-lint
params:
- name: package
value: $(params.package)
- name: flags
value: -v
- name: version
value: v1.21
resources:
inputs:
- name: source
resource: source-repo
- name: unit-tests
runAfter: [lint]
taskRef:
name: golang-test
params:
- name: package
value: $(params.package)
- name: flags
value: -v -mod=vendor
resources:
inputs:
- name: source
resource: source-repo
- name: build
runAfter: [lint]
taskRef:
name: golang-build
params:
- name: package
value: $(params.package)
- name: flags
value: -mod=vendor -ldflags "-X github.com/tektoncd/pipeline/pkg/version.PipelineVersion=$(params.versionTag)"
resources:
inputs:
- name: source
resource: source-repo
- name: publish-images
runAfter: [build, unit-tests]
runAfter: [build, precheck]
taskRef:
name: publish-tekton-pipelines
params:
Expand Down

0 comments on commit cba3ddf

Please sign in to comment.