fix(ci-failures): avoid removing non matching expressions#108
Merged
dhiller merged 2 commits intokubevirt:mainfrom Mar 10, 2026
Merged
fix(ci-failures): avoid removing non matching expressions#108dhiller merged 2 commits intokubevirt:mainfrom
dhiller merged 2 commits intokubevirt:mainfrom
Conversation
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- ShowCIFailureJobs now aborts on the first HEAD error, whereas previously those were treated like a missing junit and iteration continued; if transient GCS or network issues are common, consider logging the error and skipping that URL (or aggregating errors) instead of failing the entire call.
- checkJunitFuncTestXMLExists hardcodes the prow-to-GCS URL replacement logic; consider extracting the prefix constants or sharing existing helpers so future changes to prow or storage paths don’t require updating this function in isolation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- ShowCIFailureJobs now aborts on the first HEAD error, whereas previously those were treated like a missing junit and iteration continued; if transient GCS or network issues are common, consider logging the error and skipping that URL (or aggregating errors) instead of failing the entire call.
- checkJunitFuncTestXMLExists hardcodes the prow-to-GCS URL replacement logic; consider extracting the prefix constants or sharing existing helpers so future changes to prow or storage paths don’t require updating this function in isolation.
## Individual Comments
### Comment 1
<location path="pkg/ci-failures/main.go" line_range="33" />
<code_context>
-// It then returns only the URLs for which the junit.functest.xml artifact does not exist.
+// ShowCIFailureJobs fetches URLs for the CI failure runs from the data of the latest run.
+// It returns only those URLs for which the junit.functest.xml artifact does not exist.
func ShowCIFailureJobs() ([]string, error) {
// 1. Read and parse the JSON file
jsonFile, err := os.Open("./output/kubevirt/kubevirt/results.json")
</code_context>
<issue_to_address>
**question (bug_risk):** Removing the sort changes the determinism of the returned URL order.
Without `JobFailureData` and `sort.Slice`, the URLs now follow whatever ordering `FailedJobLeaderBoard` and its `FailureURLs` happen to use. If callers (including people comparing runs) rely on stable ordering, this may introduce noisy diffs or inconsistent behavior. If we still want determinism but no longer need `sig/id`, consider sorting directly by URL or another stable key.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| // It then returns only the URLs for which the junit.functest.xml artifact does not exist. | ||
| // ShowCIFailureJobs fetches URLs for the CI failure runs from the data of the latest run. | ||
| // It returns only those URLs for which the junit.functest.xml artifact does not exist. | ||
| func ShowCIFailureJobs() ([]string, error) { |
There was a problem hiding this comment.
question (bug_risk): Removing the sort changes the determinism of the returned URL order.
Without JobFailureData and sort.Slice, the URLs now follow whatever ordering FailedJobLeaderBoard and its FailureURLs happen to use. If callers (including people comparing runs) rely on stable ordering, this may introduce noisy diffs or inconsistent behavior. If we still want determinism but no longer need sig/id, consider sorting directly by URL or another stable key.
The regular expression silently filtered some urls that weren't matching (i.e. pull-kubevirt-e2e-kind-sriov) was not matching. Since we basically don't need the sorting it's removed, now we are directly checking whether the junit is present. Also any HEAD error was treated as a non-existing junit xml which might cover some errors - these are now returned. Finally min and max are removed in favor of the built-ins. Signed-off-by: Daniel Hiller <dhiller@redhat.com>
4137d34 to
99ea87a
Compare
Contributor
Author
|
@dollierp rebased - PTAL, thank you ! |
dollierp
reviewed
Mar 10, 2026
Addresses a review comment, where it was mentioned that we might retry the http HEAD in certain occasions. Thus the logic was broadened and now also supports http.Head requests. Signed-off-by: Daniel Hiller <dhiller@redhat.com>
Contributor
Author
|
@dollierp addressed your comments, PTAL 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The regular expression silently filtered some urls that weren't matching (i.e. pull-kubevirt-e2e-kind-sriov) was not matching.
Since we basically don't need the sorting it's removed, now we are directly checking whether the junit is present.
Also any HEAD error was treated as a non-existing junit xml which might cover some errors - these are now returned.
Finally min and max are removed in favor of the built-ins.
/kind bug
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
/cc @dollierp