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
Extend Kettle build fields to be used for determining flakes #18197
Extend Kettle build fields to be used for determining flakes #18197
Conversation
…uild This is based on spiffxp's proposal off issue kubernetes#14643
Hi @MushuEE. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
/assign @spiffxp |
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.
A few suggestions/questions
kettle/make_json.py
Outdated
build['repo_commit'] = started.get('repo-commit', started.get('repo-version')) | ||
build['repos'] = started.get('repos') |
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 recognize there is a dearth of comments here already, so you're just following the pattern. But I think it might be useful for future maintainers to comment where these are expected to come from, eg: a link back to the testgrid metadata struct or something
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.
+1 I will try to make some back reference.
kettle/make_json.py
Outdated
|
||
metadata = get_metadata() | ||
metadata = get_metadata(build) |
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.
not sure I understand why this refactor?
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 I didn't like doing this but I want to access the metadata repos
key. I have access to all key-value pairs outside of this internal method but I would have to iterate over them because I no longer have a direct map to the repos
value. The quickest solution I saw was to edit the map object while handling the metadata.
kettle/make_json.py
Outdated
if metadata: | ||
if not build.get('repos'): | ||
build['repos'] = metadata.get('repos') |
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.
updating build
in a function named get_metadata
feels surprising, maybe we could do this after the get_metadata
call below?
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.
Yeah ^ above comment kinda covers it. Just feels a little ugly to iterate over the list of pairs. I could return both the list AND the repos from get_metadata and assign that second value to build['repos']
. Also in your doc you mention that Repos needs to be a nullable string. Do I need to join these repos with commas?
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 majorly refactored. I decided to stay on the safe side and just remove all keys for None
attrs so that there isn't anything crazy that might happen with nullable fields. I think this cleans things up and creates a structure for the build object so it is easier to map to the TestGrid Schema
This removes all None attrs to behaive like orginal where nullable values don't exist
ce52daa
to
b13c387
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
/approve
this is much cleaner
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MushuEE, spiffxp 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 |
I'm going to caution that right now, restarting kettle takes for. ev. er. So while part of me wants to say we should redeploy to verify this works, another part of me wants to suggest holding off until you've take a look at what startup involves. Your call. |
You can see #17069 for a depiction of what restarting looked like the last time we had to |
@MushuEE could you in the future please try to avoid merging a lot of tiny fixup commits that are not useful in the
|
@alvaroaleman, yes thank you. I will save these options in my notes. |
#14643
Based on @spiffxp 's proposal for enabling flake detection on POD-Util jobs I am going through the process of adding new build fields. This will require a redeploy of kettle.
Also some boy-scouting of code