Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/release-controller/sync_verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (c *Controller) ensureVerificationJobs(release *releasecontroller.Release,
}
jobNameSuffix := ""
if jobRetries > 0 {
jobNameSuffix = fmt.Sprintf("%d", jobRetries)
jobNameSuffix = fmt.Sprintf("retry-%d", jobRetries)
}
jobLabels := map[string]string{
releasecontroller.ProwJobLabelCapability: "rce",
Expand Down
8 changes: 5 additions & 3 deletions cmd/release-controller/sync_verify_prow.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ func (c *Controller) ensureProwJobForReleaseTag(release *releasecontroller.Relea
jobName = defaultAggregateProwJobName
}
aggregatorSuffix := "aggregator"
if retry, err := strconv.Atoi(verifySuffix); err == nil {
klog.V(6).Infof("Aggregator job has failed. Retry count: %d", retry)
aggregatorSuffix = aggregatorSuffix + fmt.Sprintf("-%s", verifySuffix)
if after, ok := strings.CutPrefix(verifySuffix, "retry-"); ok {
if retry, err := strconv.Atoi(after); err == nil {
klog.V(6).Infof("Aggregator job has failed. Retry count: %d", retry)
aggregatorSuffix = aggregatorSuffix + fmt.Sprintf("-%s", verifySuffix)
}
}
// Postfix the name to differentiate it from the analysis jobs
prowJobName = prow.GenerateSafeProwJobName(fullProwJobName, aggregatorSuffix)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make sure that this function has tests for this new suffix? Specifically on really long job names because this is literally adding 6 more characters and we need to make sure they resolve properly (which they should, but warrants a test).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test.

Expand Down
20 changes: 16 additions & 4 deletions cmd/release-controller/sync_verify_prow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,26 @@ func TestGenerateSafeProwJobName(t *testing.T) {
{
name: "AggregatorJobWithRetry",
jobName: "4.16.0-0.nightly-2024-02-07-125310-aggregated-hypershift-ovn-conformance-4.16",
suffix: "aggregator-2",
expected: "4.16.0-0.nightly-2024-02-07-125310-aggrega-44j0w6k-aggregator-2",
suffix: "aggregator-retry-2",
expected: "4.16.0-0.nightly-2024-02-07-125310-a-44j0w6k-aggregator-retry-2",
},
{
name: "TruncationResultsInInvalidJobName",
jobName: "4.19.0-0.nightly-2025-06-19-224840-aws-ovn-upgrade-4.19-micro-fips",
suffix: "1",
expected: "4.19.0-0.nightly-2025-06-19-224840-aws-ovn-upgrade-4-mzdcpq2-1",
suffix: "retry-1",
expected: "4.19.0-0.nightly-2025-06-19-224840-aws-ovn-upgr-mzdcpq2-retry-1",
},
{
name: "RetryWithLongJobNameTriggersProperTruncation",
jobName: "5.0.0-0.nightly-2026-07-20-081439-driver-toolkit-rhel10",
suffix: "retry-2",
expected: "5.0.0-0.nightly-2026-07-20-081439-driver-toolkit-rhel10-retry-2",
},
{
name: "RetryWithMaxLengthJobNameTruncates",
jobName: "5.0.0-0.nightly-2026-07-20-081439-some-very-long-job-name-here",
suffix: "retry-10",
expected: "5.0.0-0.nightly-2026-07-20-081439-some-very-lo-jn7w8wk-retry-10",
},
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/releasepayload/utils/release-verification-job-details.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const (
var (
candidates = regexp.MustCompile(`[efr]c.\d+`)
expressions = []*regexp.Regexp{
regexp.MustCompile(`^(?P<prerelease>[\d-]+)\.(?P<stream>okd-scos|okd|\w+)-(?P<architecture>\w+)?-?(?P<timestamp>\d{4}-\d{2}-\d{2}-\d{6})-(?P<job>[\w-\\.]+?)(?:-(?P<count>\d+))?$`),
regexp.MustCompile(`^(?P<prerelease>[efr]c\.\d+)?-?upgrade-from-(?P<upgrade_from>[\d\\.]+(?:-[efr]c.\d+)?)-?(?P<job>\w+)-?(?P<count>\d+)?$`),
regexp.MustCompile(`^(?P<stream>okd-scos|okd)\.(?P<prerelease>(?:[erf]c\.\d+)+|\d+)-(?P<job>[\w-\\.]+?)(?:-(?P<count>\d+))?$`),
regexp.MustCompile(`^(?P<prerelease>(?:[erf]c|okd-scos|okd)\.\d+)-(?P<job>[\w-\\.]+?)(?:-(?P<count>\d+))?$`),
regexp.MustCompile(`^(?P<job>[\w-\\.]+?)(?:-(?P<count>\d+))?$`),
regexp.MustCompile(`^(?P<prerelease>[\d-]+)\.(?P<stream>okd-scos|okd|\w+)-(?P<architecture>\w+)?-?(?P<timestamp>\d{4}-\d{2}-\d{2}-\d{6})-(?P<job>[\w-\\.]+?)(?:-(?:retry-)?(?P<count>\d+))?$`),
regexp.MustCompile(`^(?P<prerelease>[efr]c\.\d+)?-?upgrade-from-(?P<upgrade_from>[\d\\.]+(?:-[efr]c.\d+)?)-?(?P<job>\w+)-?(?:retry-)?(?P<count>\d+)?$`),
regexp.MustCompile(`^(?P<stream>okd-scos|okd)\.(?P<prerelease>(?:[erf]c\.\d+)+|\d+)-(?P<job>[\w-\\.]+?)(?:-(?:retry-)?(?P<count>\d+))?$`),
regexp.MustCompile(`^(?P<prerelease>(?:[erf]c|okd-scos|okd)\.\d+)-(?P<job>[\w-\\.]+?)(?:-(?:retry-)?(?P<count>\d+))?$`),
regexp.MustCompile(`^(?P<job>[\w-\\.]+?)(?:-(?:retry-)?(?P<count>\d+))?$`),
}
)

Expand Down
Loading