Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork godep to fix inconsistent abbreviation size #70718

Merged
merged 9 commits into from
Nov 8, 2018

Conversation

cblecker
Copy link
Member

@cblecker cblecker commented Nov 7, 2018

What this PR does / why we need it:
This forks godep instead of vendoring it, and applies a fix to the abbreviation size.

Lots of tiny changes here. Best reviewed on a commit by commit basis.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #70686

Special notes for your reviewer:
This is just might be crazy enough to work.

Does this PR introduce a user-facing change?:

NONE

cblecker and others added 4 commits November 6, 2018 11:44
Currently, this setting depends on whatever the user of `godep` has in
their `git config --get core.abbrev`, if it is set.

Even when it is not set, the number of characters used in the shortened
git commit will depend on whether there are collisions for that prefix
on the local repository (which in large part depends on how much
activity exists there.)

As a result, when multiple users are maintaining Godeps/ for a single
project, many spurious changes to Godeps/Godeps.json are generated due
to the lack of stability in the length of the abbreviated commit in
output of `git describe`.

Let's fix this by enforcing a reasonable abbreviation length in godep's
use of `git describe`. 14 characters is very unlikely to result in
collisions for prefixes.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 7, 2018
@cblecker cblecker changed the title Godep round a million Fork godep to fix inconsistent abbreviation size Nov 7, 2018
@k8s-ci-robot k8s-ci-robot added area/apiserver area/code-generation kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 7, 2018
@cblecker
Copy link
Member Author

cblecker commented Nov 7, 2018

/cc @dims @thockin @neolit123 @cofyc

@cblecker cblecker added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Nov 7, 2018
@k8s-ci-robot k8s-ci-robot added area/apiserver area/code-generation kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels Nov 7, 2018
@cblecker cblecker removed area/apiserver area/code-generation kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels Nov 7, 2018
@cblecker
Copy link
Member Author

cblecker commented Nov 7, 2018

/test pull-kubernetes-e2e-kops-aws

@thockin
Copy link
Member

thockin commented Nov 7, 2018

Should we rename it so there's no ambiguity about which binary is being run? Maybe not important. Looking now.

@cblecker
Copy link
Member Author

cblecker commented Nov 7, 2018

@thockin I changed the "version" to something we can verify and ensure we're running the right version, but we could easily rename the binary too. I'm indifferent.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2018
Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@@ -57,7 +57,6 @@ fi
REQUIRED_BINS=(
"github.com/onsi/ginkgo/ginkgo"
"github.com/jteeuwen/go-bindata/go-bindata"
"github.com/tools/godep"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not want to ensure that the binary gets built?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list is the "additional go repos to vendor that aren't explicit code dependencies" list. It's not exceptionally well named.

kube::log::error " PATH: ${PATH}"
# Otherwise, install forked godep
kube::log::status "Installing godep version ${godep_target_version}"
# Run in hermetic GOPATH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have implications for callers of this function who might find themselves in a new directory?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I've found in my testing. It doesn't impact the CWD or environment once the calling bash script itself exits out (either godep-restore or godep-save).

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cblecker, thockin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2018
@ixdy
Copy link
Member

ixdy commented Nov 8, 2018

Should we rename it so there's no ambiguity about which binary is being run?

kodep? :)

@neolit123
Copy link
Member

neolit123 commented Nov 8, 2018

ANAT (all names are taken)

@k8s-ci-robot k8s-ci-robot merged commit e998d6c into kubernetes:master Nov 8, 2018
@cblecker cblecker deleted the godep-round-a-million branch November 8, 2018 04:48
# Otherwise, install forked godep
kube::log::status "Installing godep version ${godep_target_version}"
# Run in hermetic GOPATH
kube::golang::setup_env
Copy link
Member

@ixdy ixdy Nov 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line is now causing GOPATH to be set to ${KUBE_GOPATH} (i.e. ${KUBE_ROOT}/_output/local/go) for the rest of the script invocation.

This means that hack/godep-restore.sh and hack/godep-save.sh are saving into _output/local/go now, which is maybe fine (the general recommendation is to run these under hack/run-in-gopath.sh), but it's also unexpected.

cc @apelisse

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, you're right. Fix in #71538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/release Categorizes an issue or PR as relevant to SIG Release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent Comment field conflicts in Godeps/Godeps.json
8 participants