Repository: kubernetes/release
Pull request #891 (2019-10-09 05:47:45)

bazel: Update dependencies and add verify/update scripts
~The [new verify test](https://github.com/kubernetes/release/pull/889) is [failing](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/release/884/pull-release-test/1181725169161342976) because the `BUILD.bazel` files are out of date. This should fix it.~

@fejta fixed this ^^ in #892. 

Error:
```bazel
ERROR: /home/prow/go/src/k8s.io/release/build/debs/BUILD.bazel:11:1: GoCompilePkg build/debs/linux_amd64_stripped/debian%/k8s.io/release/build/debs.a failed (Exit 1) builder failed: error executing command 
  (cd /root/.cache/bazel/_bazel_root/92c657af61c81ec6a823dc4627a93ca5/sandbox/processwrapper-sandbox/268/execroot/io_k8s_release && \
  exec env - \
    CGO_ENABLED=1 \
    GOARCH=amd64 \
    GOOS=linux \
    GOROOT=external/go_sdk \
    GOROOT_FINAL=GOROOT \
    PATH=/usr/bin:/usr/local/bin:/bin \
  bazel-out/host/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src build/debs/build.go -arc 'github.com/blang/semver=github.com/blang/semver=bazel-out/k8-fastbuild/bin/external/com_github_blang_semver/linux_amd64_stripped/go_default_library%/github.com/blang/semver.a=' -importpath k8s.io/release/debian -p main -package_list bazel-out/host/bin/external/go_sdk/packages.txt -o bazel-out/k8-fastbuild/bin/build/debs/linux_amd64_stripped/debian%/k8s.io/release/build/debs.a -gcflags '' -asmflags '')
Execution platform: @bazel_tools//platforms:host_platform
Use --sandbox_debug to see verbose messages from the sandbox
compilepkg: missing strict dependencies:
	/root/.cache/bazel/_bazel_root/92c657af61c81ec6a823dc4627a93ca5/sandbox/processwrapper-sandbox/268/execroot/io_k8s_release/build/debs/build.go: import of "github.com/google/go-github/v28/github"
No dependencies were provided.
Check that imports in Go sources match importpath attributes in deps.
INFO: Elapsed time: 168.079s, Critical Path: 19.98s
INFO: 264 processes: 264 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
```

Signed-off-by: Stephen Augustus <saugustus@vmware.com>

/assign @fejta @tpepper @hoegaarden 

k8s-ci-robot: @justaugustus: Adding label: `do-not-merge/blocked-paths` because PR changes a protected file.

<details>

#### Reasons for blocking this PR:
[Changes to certain release tools can affect our ability to test, build, and release Kubernetes. This PR must be explicitly approved by SIG Release repo admins.]
- [build/debs/BUILD.bazel](https://github.com/kubernetes/release/blob/3eb55648c01c8fa5268942d5e1eb88599ec1a5d6/build/debs/BUILD.bazel)



Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes/release/pull/891#" title="Author self-approved">justaugustus</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes%2Frelease).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[build/debs/OWNERS](https://github.com/kubernetes/release/blob/master/build/debs/OWNERS)~~ [justaugustus]
- ~~[cmd/release-notes/OWNERS](https://github.com/kubernetes/release/blob/master/cmd/release-notes/OWNERS)~~ [justaugustus]
- ~~[pkg/notes/OWNERS](https://github.com/kubernetes/release/blob/master/pkg/notes/OWNERS)~~ [justaugustus]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
k8s-ci-robot: @justaugustus: The following test **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-release-test | 3eb55648c01c8fa5268942d5e1eb88599ec1a5d6 | [link](https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/release/891/pull-release-test/1181808535466414081) | `/test pull-release-test`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes&repo=release&pr=891). [Your PR dashboard](https://gubernator.k8s.io/pr/justaugustus). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes/release/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
justaugustus: (I had low expectations that I'd get that right on the first commit. Send help.)
fejta: 1) Can you submit a PR that either renames build/debs to build/deb-builder or else fix go.mod to make it declare a k8s.io/release/build/debs module?

https://github.com/kubernetes/release/blob/015c48d145d93296624049e1ba3c5643298b001a/build/debs/go.mod#L1

```console
$ bazel run @io_k8s_repo_infra//hack:update-deps                                                                                                                                                                        
go: k8s.io/release/build/debs@v0.0.0-20191009044250-015c48d145d9: parsing go.mod:
        module declares its path as: k8s.io/release/build/deb-builder
                but was required as: k8s.io/release/build/debs
FAILED
```
fejta: You'll also need to make k8s.io/release depend on k8s.io/release/build/debs via a tools.go file, for example: https://github.com/kubernetes/test-infra/blob/master/hack/tools.go

at this point `go mod tidy` or `bazel run @io_k8s_repo_infra//hack:update-deps` will demonstrate the problem

Patch:
diff --git a/build/debs/BUILD.bazel b/build/debs/BUILD.bazel
index b08a2ee3..2749492a 100644
--- a/build/debs/BUILD.bazel
+++ b/build/debs/BUILD.bazel
@@ -12,9 +12,8 @@ go_library(
 )
 
 go_binary(
-    name = "debian",
+    name = "debs",
     embed = [":go_default_library"],
-    importpath = "k8s.io/release/debian",
     visibility = ["//visibility:public"],
 )
 
@@ -22,7 +21,6 @@ go_test(
     name = "go_default_test",
     srcs = ["build_test.go"],
     embed = [":go_default_library"],
-    importpath = "k8s.io/release/debian",
 )
 
 filegroup(
diff --git a/cmd/release-notes/BUILD.bazel b/cmd/release-notes/BUILD.bazel
index d3e1256c..543ab3a7 100644
--- a/cmd/release-notes/BUILD.bazel
+++ b/cmd/release-notes/BUILD.bazel
@@ -9,7 +9,7 @@ go_library(
         "//pkg/notes:go_default_library",
         "@com_github_go_kit_kit//log:go_default_library",
         "@com_github_go_kit_kit//log/level:go_default_library",
-        "@com_github_google_go_github_v27//github:go_default_library",
+        "@com_github_google_go_github_v28//github:go_default_library",
         "@com_github_kolide_kit//env:go_default_library",
         "@org_golang_x_oauth2//:go_default_library",
     ],
diff --git a/cmd/release-notes/main.go b/cmd/release-notes/main.go
index 262a84c5..57fd07a9 100644
--- a/cmd/release-notes/main.go
+++ b/cmd/release-notes/main.go
@@ -11,7 +11,7 @@ import (
 
 	"github.com/go-kit/kit/log"
 	"github.com/go-kit/kit/log/level"
-	"github.com/google/go-github/v27/github"
+	"github.com/google/go-github/v28/github"
 	"github.com/kolide/kit/env"
 	"golang.org/x/oauth2"
 
diff --git a/go.mod b/go.mod
index d52972d8..766e87c5 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,6 @@ go 1.12
 require (
 	github.com/blang/semver v3.5.1+incompatible
 	github.com/go-kit/kit v0.9.0
-	github.com/google/go-github/v27 v27.0.6
 	github.com/google/go-github/v28 v28.1.1
 	github.com/kolide/kit v0.0.0-20190123023048-c155a91098e3
 	github.com/pkg/errors v0.8.1
diff --git a/go.sum b/go.sum
index 7f58a568..9a68cad5 100644
--- a/go.sum
+++ b/go.sum
@@ -125,8 +125,6 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
 github.com/google/go-containerregistry v0.0.0-20190401215819-f1df91a4a813/go.mod h1:yZAFP63pRshzrEYLXLGPmUt0Ay+2zdjmMN1loCnRLUk=
 github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
 github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
-github.com/google/go-github/v27 v27.0.6 h1:oiOZuBmGHvrGM1X9uNUAUlLgp5r1UUO/M/KnbHnLRlQ=
-github.com/google/go-github/v27 v27.0.6/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0=
 github.com/google/go-github/v28 v28.1.1 h1:kORf5ekX5qwXO2mGzXXOjMe/g6ap8ahVe0sBEulhSxo=
 github.com/google/go-github/v28 v28.1.1/go.mod h1:bsqJWQX05omyWVmc00nEUql9mhQyv38lDZ8kPZcQVoM=
 github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
diff --git a/hack/update-all.sh b/hack/update-all.sh
new file mode 100755
index 00000000..3dac6884
--- /dev/null
+++ b/hack/update-all.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+# Copyright 2017 The Kubernetes Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -o errexit
+set -o nounset
+set -o pipefail
+set -o xtrace
+
+cd "$(git rev-parse --show-toplevel)"
+bazel run @io_k8s_repo_infra//hack:update-gofmt
+bazel run @io_k8s_repo_infra//hack:update-deps
diff --git a/hack/verify-all.sh b/hack/verify-all.sh
new file mode 100755
index 00000000..23881c49
--- /dev/null
+++ b/hack/verify-all.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+# Copyright 2017 The Kubernetes Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -o errexit
+set -o nounset
+set -o pipefail
+set -o xtrace
+
+cd "$(git rev-parse --show-toplevel)"
+bazel test //:verify-all
diff --git a/pkg/notes/BUILD.bazel b/pkg/notes/BUILD.bazel
index c3523186..5a5dd4e7 100644
--- a/pkg/notes/BUILD.bazel
+++ b/pkg/notes/BUILD.bazel
@@ -12,7 +12,7 @@ go_library(
     deps = [
         "@com_github_go_kit_kit//log:go_default_library",
         "@com_github_go_kit_kit//log/level:go_default_library",
-        "@com_github_google_go_github_v27//github:go_default_library",
+        "@com_github_google_go_github_v28//github:go_default_library",
         "@com_github_pkg_errors//:go_default_library",
         "@in_gopkg_src_d_go_git_v4//:go_default_library",
         "@in_gopkg_src_d_go_git_v4//plumbing:go_default_library",
@@ -27,7 +27,7 @@ go_test(
     ],
     embed = [":go_default_library"],
     deps = [
-        "@com_github_google_go_github_v27//github:go_default_library",
+        "@com_github_google_go_github_v28//github:go_default_library",
         "@com_github_stretchr_testify//require:go_default_library",
         "@org_golang_x_oauth2//:go_default_library",
     ],
diff --git a/pkg/notes/notes.go b/pkg/notes/notes.go
index 40aa9ae2..160ea80d 100644
--- a/pkg/notes/notes.go
+++ b/pkg/notes/notes.go
@@ -25,7 +25,7 @@ import (
 
 	"github.com/go-kit/kit/log"
 	"github.com/go-kit/kit/log/level"
-	"github.com/google/go-github/v27/github"
+	"github.com/google/go-github/v28/github"
 	"github.com/pkg/errors"
 )
 
diff --git a/repos.bzl b/repos.bzl
index e5191237..0f98f352 100644
--- a/repos.bzl
+++ b/repos.bzl
@@ -718,14 +718,7 @@ def go_repositories():
         sum = "h1:p6kvQYhOQUpogpCn1p/XI/A9UClYVyNTkYkKIijnl7M=",
         version = "v0.0.0-20190401215819-f1df91a4a813",
     )
-    go_repository(
-        name = "com_github_google_go_github_v27",
-        build_file_generation = "on",
-        build_file_proto_mode = "disable",
-        importpath = "github.com/google/go-github/v27",
-        sum = "h1:oiOZuBmGHvrGM1X9uNUAUlLgp5r1UUO/M/KnbHnLRlQ=",
-        version = "v27.0.6",
-    )
+
     go_repository(
         name = "com_github_google_gofuzz",
         build_file_generation = "on",


Test patch:
diff --git a/pkg/notes/notes_test.go b/pkg/notes/notes_test.go
index fe85cef6..d1297917 100644
--- a/pkg/notes/notes_test.go
+++ b/pkg/notes/notes_test.go
@@ -7,7 +7,7 @@ import (
 	"os"
 	"testing"
 
-	"github.com/google/go-github/v27/github"
+	"github.com/google/go-github/v28/github"
 	"github.com/stretchr/testify/require"
 	"golang.org/x/oauth2"
 )