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
Fill in more data for started.json in initupload #11304
Conversation
e2121f6
to
b26ff24
Compare
Love the direction here |
Looks good so far, the organization is great. |
I thought backfill means fill in something we are missing from before, but please bikeshed my English :-) I'll add a few more test cases and handle #10359 in a separate PR :-) |
b26ff24
to
7fc2fd7
Compare
7fc2fd7
to
d1c0e4c
Compare
d1c0e4c
to
7f85356
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
/hold
} else if len(spec.ExtraRefs) > 0 { | ||
finished.Revision = getRevisionFromRef(&spec.ExtraRefs[0]) | ||
} | ||
finished.Revision = downwardapi.GetRevisionFromSpec(spec) |
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.
I would like us to drop Revision as it is not useful:
- job-version in finished.json needs to be set to what the job configures at runtime and puts in metadata.json
- repo-version should be in started.json, set from the refs
- we should have some other field that does a more complex recording of the refs (either repos or else a new refs field).
Revision just duplicates repo-version in the wrong location.
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.
I added that when we were thinking we should only keep a timestamp in started.json. Since I also changed places like testgrid and gubernator, I need to make some clean-up PRs to follow up.
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.
- we should have some other field that does a more complex recording of the refs (either repos or else a new refs field).
Agreed, although I'm not sure that repos is sufficient. The complete ref data also includes ref names and any pull request numbers and SHAs. Including the complete serialized list of Refs
structs in a refs
field may be the best option.
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.
Does that mean testgrid need to know a prow struct? Note that we also need to handle other hand-crafted started.json :-)
Maybe we can dump the refs into metadata?
func specToStarted(spec *downwardapi.JobSpec) gcs.Started { | ||
started := gcs.Started{ | ||
Timestamp: time.Now().Unix(), | ||
RepoVersion: downwardapi.GetRevisionFromSpec(spec), |
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.
Looks like this should be RepoCommit, rather than RepoVersion?
test-infra/jenkins/bootstrap.py
Line 503 in 9bb0955
meta['repo-commit'] = commit.strip() |
Looks like I goofed here:
test-infra/testgrid/metadata/job.go
Line 31 in 60bca00
RepoVersion string `json:"repo-version,omitempty"` |
And checking testgrid's internal updater it has been looking for repo-commit, job-version and/or version since 2017. So we should use repo-commit, not repo-version.
which somewhat makes sense, as repo-commit is a git commit, whereas job-version is a random string set by the job.
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.
hold on hold on - this is not true at all - see
test-infra/jenkins/bootstrap.py
Line 322 in aa8d6d1
data['repo-version'] = version |
although this repo-version in started.json is 👎 (
test-infra/jenkins/bootstrap.py
Lines 596 to 621 in aa8d6d1
def find_version(call): | |
"""Determine and return the version of the build.""" | |
# TODO(fejta): once job-version is functional switch this to | |
# git rev-parse [--short=N] HEAD^{commit} | |
version_file = 'version' | |
if os.path.isfile(version_file): | |
# e2e tests which download kubernetes use this path: | |
with open(version_file) as fp: | |
return fp.read().strip() | |
version_script = 'hack/lib/version.sh' | |
if os.path.isfile(version_script): | |
cmd = [ | |
'bash', '-c', ( | |
""" | |
set -o errexit | |
set -o nounset | |
export KUBE_ROOT=. | |
source %s | |
kube::version::get_version_vars | |
echo $KUBE_GIT_VERSION | |
""" % version_script) | |
] | |
return call(cmd, output=True).strip() | |
return 'unknown' |
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.
Should link this thread to my "WTF are these fields even" issue 😆
LGTM label has been added. Git tree hash: bfa79f35e4144f12fdb42c972d252e94ad837b40
|
/hold |
08fbf9b
to
7f85356
Compare
[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 |
/hold cancel |
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: bfa79f35e4144f12fdb42c972d252e94ad837b40
|
/retest |
/retest |
(trying out the draft PR feature?)
/assign @fejta
cc @cjwagner @stevekuznetsov
resolve most of #10544 beside the node name