Test-infra: gazelle moved to a new repo

Created on 22 Dec 2017  路  14Comments  路  Source: kubernetes/test-infra

per https://github.com/bazelbuild/rules_go/pull/1173, gazelle has moved out of rules_go into its own repo at https://github.com/bazelbuild/bazel-gazelle

I've put out a fix for test-infra, if we're happy with it there I can open up PR's for other affected repos

Other affected repos I've found:

  • kubernetes/cluster-registry: manages/uses gazelle through bazel, seems fine
  • kubernetes/federation: kubernetes/federation#172
  • kubernetes/kops: manages/uses gazelle through bazel, seems fine
  • kubernetes/kubernetes: kubernetes/kubernetes#57564
  • kubernetes/release: manages/uses gazelle through bazel, seems fine

The PR's I've done have been a little hacky, maybe the right path forward is to use bazel to manage gazelle in all repos?

kinbug prioritcritical-urgent

Most helpful comment

bazelbuild/rules_go#1173 has been rolled back.

All 14 comments

/cc @ixdy @BenTheElder

re-fixed in https://github.com/kubernetes/test-infra/pull/6074, we'll need a similar one in the other repos..

An example of the error encountered in kubernetes/test-infra: https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/test-infra/6071/pull-test-infra-verify-bazel/8701/build-log.txt

W1222 16:31:55.660] package github.com/bazelbuild/rules_go/go/tools/gazelle/gazelle: cannot find package "github.com/bazelbuild/rules_go/go/tools/gazelle/gazelle" in any of:
W1222 16:31:55.661]     /usr/local/go/src/github.com/bazelbuild/rules_go/go/tools/gazelle/gazelle (from $GOROOT)
W1222 16:31:55.661]     /tmp/tmp.QjyPrKkvzk/src/github.com/bazelbuild/rules_go/go/tools/gazelle/gazelle (from $GOPATH)

bazelbuild/rules_go#1173 has been rolled back.

@jayconrod many thanks!

Thank you!
We should definitely look to update all the kube repos to vendor the new gazelle location next.

Per the rules_go issue linking here, we need to deal with this within the next week or so. Fixing the hackish script was pretty straightforward, but the version of gazelle that k/k depends upon isn't available in the new repo. So we'd need to vendor it there, or fix k/k to work with the newer version of gazelle. We could also try taking the same tack as repos such as kops, which use bazel instead of vendor.

The master branch of k/k should be compatible with the newer gazelle. The release branches are more problematic, and we probably need to backport the hackish fix or vendor it.

Not sure if anyone is looking at this, but you might want to fix hack/go_install_from_commit.sh in any case. That errored out because the go/tools/gazelle/gazelle subdirectory was missing from master, not from the specified commit. Fixing that script may be simpler than vendoring Gazelle into old release branches.

I filed bazelbuild/rules_go#1199 to track the removal. I'd like to close that by the end of January, but I'll be sure to confirm with folks on this thread before doing so.

you might want to fix hack/go_install_from_commit.sh in any case

I did an ugly thing in k/k if it helps: https://github.com/kubernetes/kubernetes/pull/57564

I think all of the relevant kubernetes repos except kubernetes/federation are fixed now.

@ixdy Will removing the old Gazelle tree break previous Kubernetes releases? I'm not sure if Gazelle is ever run on old branches or tags, but I imagine it could cause problems.

Good call; the verify jobs would likely fail, if nothing else. I've opened cherry-pick PRs for release-1.9 and release-1.8. (Earlier branches did not use gazelle.)

I believe all of the various kubernetes repos and branches should be fixed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aisuko picture Aisuko  路  3Comments

stevekuznetsov picture stevekuznetsov  路  3Comments

xiangpengzhao picture xiangpengzhao  路  3Comments

BenTheElder picture BenTheElder  路  4Comments

BenTheElder picture BenTheElder  路  3Comments