push-test-metrics: derive job names from prow config instead of hard-coding#4806
push-test-metrics: derive job names from prow config instead of hard-coding#4806Jaydeep869 wants to merge 2 commits into
Conversation
|
Hi @Jaydeep869. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
log.Infof("derived job names from config: %s", jobNamesToScan)call will not compile becausejobNamesis a[]string,%sexpects a string, and the type does not implementfmt.Stringerfor the value receiver; either use%v, calljobNamesToScan.String(), or adjust theStringmethod to be on the value receiver and use%swith that.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `log.Infof("derived job names from config: %s", jobNamesToScan)` call will not compile because `jobNames` is a `[]string`, `%s` expects a string, and the type does not implement `fmt.Stringer` for the value receiver; either use `%v`, call `jobNamesToScan.String()`, or adjust the `String` method to be on the value receiver and use `%s` with that.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…coding Replace the hard-coded list of periodic job names (stuck at k8s 1.29) with dynamic discovery from the prow periodics job config YAML using config.ReadJobConfig. - Add --job-config-path flag to read the periodics config - Add readJobNamesFromConfig() that parses the config and selects the latest k8s version for each main SIG lane (compute, storage, network, operator) using numeric version comparison - Fix the jobNames.Set() method which was silently discarding values, making the --job-name flag non-functional - Use pointer receiver on jobNames so flag.Var works correctly - Require either --job-name or --job-config-path (no more silent fallback to stale names) - Update periodic job YAML to pass --job-config-path - Add unit tests Fixes: kubevirt#4802 Signed-off-by: jaydeep869 <jaydeeppokhariya2106@gmail.com>
65c1157 to
8191105
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes push-test-metrics producing stale/incorrect Grafana metrics by replacing the hard-coded periodic job list with dynamic discovery from the Prow periodics job config (selecting the latest k8s version per main SIG lane), and by repairing the broken --job-name flag parsing.
Changes:
- Add
readJobNamesFromConfig()which loads the Prow job config YAML viaconfig.ReadJobConfigand derives the latest job per main SIG lane. - Fix
jobNames.Set()so repeated--job-nameflags actually accumulate values. - Update the Prow periodic job definition to pass
--job-config-path, and add unit tests for the new config parsing and flag behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| robots/push-test-metrics/main.go | Implements dynamic job discovery from Prow config and fixes the --job-name flag handling. |
| robots/push-test-metrics/main_test.go | Adds unit tests for derived job selection, filtering, error handling, and jobNames flag behavior. |
| github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-periodics.yaml | Updates the periodic invocation to provide --job-config-path for discovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/test all |
|
@brianmcarey Can you also review the pr as it need lgtm/approve label for all checks to pass. |
|
There has been no activity on this PR for 45 days. What you can do:
/lifecycle stale |
What this PR does / why we need it:
The
push-test-metricsrobot has a hard coded list of periodic job names stuck at k8s 1.29. Since those lanes no longer exist, the robot scans stale GCS paths and pushes incorrect metrics to the Grafana dashboard.This PR replaces the hard-coded default with dynamic discovery from the prow periodics job config YAML using
config.ReadJobConfig. It selects the latest k8s version for each of the four main SIG lanes (compute, storage, network, operator) automatically.Additionally fixes the
jobNames.Set()method which was silently discarding values, making the existing--job-nameflag non-functional.Which issue(s) this PR fixes
Fixes #4802
Special notes for your reviewer:
sig-compute,sig-storage,sig-network,sig-operator) and excludes variant lanes like-migrations,-root,-performance,ipv6-to preserve the original dashboard scope.kubevirt-periodics.yaml(config/,jobs/,github/ci/prow-deploy/files/) are hardlinked to the same inode, so the single file edit covers all three.--job-nameflags still work as a manual override if specified.Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note: