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

Make use of record.FinalSHA and overwrite it in started.json #11407

Merged
merged 1 commit into from
Feb 21, 2019

Conversation

krzyzacy
Copy link
Member

Something like this?
We still need to teach our apps to understand RepoVersion 🤷‍♂️ but at least our metadata has all the info now.

/assign @cjwagner @stevekuznetsov @fejta

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: krzyzacy

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 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. labels Feb 20, 2019
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/prow Issues or PRs related to prow area/prow/initupload Issues or PRs related to prow's initupload component area/prow/pod-utilities Issues or PRs related to prow's pod-utilities component sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Feb 20, 2019
Copy link
Contributor

@fejta fejta left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

started := gcs.Started{
Timestamp: time.Now().Unix(),
RepoVersion: downwardapi.GetRevisionFromSpec(spec),
}

// TODO(krzyzacy): we still need to resolve a ref into a sha
if mainRefSHA != "" {
started.RepoVersion = mainRefSHA
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this different from downwardapi.GetRevisionFromSpec?

Copy link
Member Author

Choose a reason for hiding this comment

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

So if I have a ref that's {"k8s.io/test-infra": "master"}, downwardapi.GetRevisionFromSpec will gives "master", which results in https://testgrid.k8s.io/sig-testing-maintenance#ci-janitor (see the big-O "master" in commit column header) and breaks testgrid search 😂

mainRefSHA is from a git rev-parse from cloneref which is the final SHA for a given ref, and we can have a valid display SHA in testgrid..

ref #10359

started := specToStarted(spec)
uploadTargets := map[string]gcs.UploadFunc{}

failed := false
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: var failed bool

Copy link
Member Author

Choose a reason for hiding this comment

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

humm sure, is that recommended from go code style?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

Choose a reason for hiding this comment

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

Joe told me that when you want it to default to the default value, use var foo int rather than foo := 0, whereas you'd do foo := 1

@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 3e41a98d06efa3ab37deda4ceeb5ad142ff31dc7

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Feb 21, 2019
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Feb 21, 2019
Copy link
Contributor

@fejta fejta left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 17d60e83efb3844520535485c5a7c1a74d868bba

@krzyzacy
Copy link
Member Author

krzyzacy commented Feb 21, 2019

k8s-ci-robot added lgtm and removed lgtm labels 23 minutes ago - lol

@krzyzacy
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 21, 2019
@k8s-ci-robot k8s-ci-robot merged commit eb64675 into kubernetes:master Feb 21, 2019
@krzyzacy krzyzacy deleted the fill-in-jobversion branch February 22, 2019 00:13
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. area/prow/initupload Issues or PRs related to prow's initupload component area/prow/pod-utilities Issues or PRs related to prow's pod-utilities component area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

5 participants