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

Extend Kettle build fields to be used for determining flakes #18197

Merged
merged 7 commits into from Jul 10, 2020

Conversation

MushuEE
Copy link
Contributor

@MushuEE MushuEE commented Jul 7, 2020

#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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 7, 2020
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/config Issues or PRs related to code in /config area/jobs area/kettle area/testgrid sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jul 7, 2020
@krzyzacy
Copy link
Member

krzyzacy commented Jul 7, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 7, 2020
@krzyzacy
Copy link
Member

krzyzacy commented Jul 7, 2020

/assign @spiffxp

Copy link
Member

@spiffxp spiffxp left a 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

Comment on lines 150 to 151
build['repo_commit'] = started.get('repo-commit', started.get('repo-version'))
build['repos'] = started.get('repos')
Copy link
Member

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

Copy link
Contributor Author

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.


metadata = get_metadata()
metadata = get_metadata(build)
Copy link
Member

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?

Copy link
Contributor Author

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.

if metadata:
if not build.get('repos'):
build['repos'] = metadata.get('repos')
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 8, 2020
@chases2 chases2 removed their request for review July 8, 2020 18:26
@MushuEE MushuEE force-pushed the feature/add_new_kettle_fields branch from ce52daa to b13c387 Compare July 8, 2020 20:34
Copy link
Member

@spiffxp spiffxp 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
this is much cleaner

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 10, 2020
@k8s-ci-robot
Copy link
Contributor

[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 /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 Jul 10, 2020
@spiffxp
Copy link
Member

spiffxp commented Jul 10, 2020

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.

@spiffxp
Copy link
Member

spiffxp commented Jul 10, 2020

You can see #17069 for a depiction of what restarting looked like the last time we had to

@k8s-ci-robot k8s-ci-robot merged commit 1b90b9c into kubernetes:master Jul 10, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jul 10, 2020
@alvaroaleman
Copy link
Member

@MushuEE could you in the future please try to avoid merging a lot of tiny fixup commits that are not useful in the master branch history by either:

@MushuEE
Copy link
Contributor Author

MushuEE commented Jul 13, 2020

@alvaroaleman, yes thank you. I will save these options in my notes.

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/config Issues or PRs related to code in /config area/jobs area/kettle area/metrics area/testgrid 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants