-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
[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 |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
prow/initupload/run.go
Outdated
started := specToStarted(spec) | ||
uploadTargets := map[string]gcs.UploadFunc{} | ||
|
||
failed := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: var failed bool
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/kubernetes/test-infra/blob/master/prow/initupload/run.go#L117-L123
also that confused me a bit... 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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
LGTM label has been added. Git tree hash: 3e41a98d06efa3ab37deda4ceeb5ad142ff31dc7
|
a3364aa
to
e9bbdbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: 17d60e83efb3844520535485c5a7c1a74d868bba
|
k8s-ci-robot added lgtm and removed lgtm labels 23 minutes ago - lol |
/hold cancel |
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