Skip to content

Conversation

@bradmwilliams
Copy link
Collaborator

Adding initial support for Release Qualifying Jobs. This introduces the Qualifiers stanza into the ReleaseVerification definitions. It also adds support for specifying the --release-qualifiers-config-path option to specify the location of the file holding the supported Release Qualifier definitions.

In order for a ReleaseQualifier to be applied to a ReleaseVerificationJob, it must be specified as part of the job definition in the respective ReleaseConfig, like:

    "osd-aws": {
      "optional": true,
      "maxRetries": 2,
      "prowJob": {
        "name": "periodic-ci-openshift-release-master-nightly-4.19-osd-aws"
      },  
      "qualifiers": {
        "rosa": {}, 
        "hcm": {}
      }   
    },

Any parameter that are provided will override their corresponding values in the ReleaseQualifiersConfig (specified via the --release-qualifiers-config-path option), like:

    "osd-aws": {
      "optional": true,
      "maxRetries": 2,
      "prowJob": {
        "name": "periodic-ci-openshift-release-master-nightly-4.19-osd-aws"
      },  
      "qualifiers": {
        "rosa": {}, 
        "hcm": {
           "enabled": false,
           "badgeName": "HCM",
           "summary": "Hybrid Cloud Management",
           "description": "A longer description when displaying badge details",
           "payloadBadge": "Yes"
        }
      }   
    },

The ReleaseQualifiersConfig will be a YAML file located in the openshift/release repository and contains all the available Qualifiers for use in the Release Verification Process, like:

---
qualifiers:
  rosa:
    enabled: true
    badgeName: "ROSA"
    summary: "RedHat OpenShift on AWS"
    description: "A longer description when displaying badge details"
    payloadBadge: "Yes"
  hcm:
    enabled: true
    badgeName: "HCM"
    summary: "Hybrid Cloud Management"
    description: "A longer description when displaying badge details"
    payloadBadge: "Yes"
    notifications:
      slack:
        escalations:
          - name: "monitor"
            period: "24h"
            minFailures: 2
            channel: "#forum-..."
            mentions:
              - "@ocm-support"
              - "@patch-manager"
          - name: "high"
            period: "72h"
            minFailures: 8
            channel: "#forum-..."
            mentions:
              - "@hcm-escalation-manager"

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2025
@bradmwilliams
Copy link
Collaborator Author

/cc @jupierce

@openshift-ci openshift-ci bot requested a review from jupierce November 4, 2025 19:45
@bradmwilliams bradmwilliams force-pushed the qualifying-jobs-refactor branch from 1fd87c4 to 2a3c688 Compare November 4, 2025 20:47
@bradmwilliams
Copy link
Collaborator Author

/hold
Want to watch this roll out

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 5, 2025
@bradmwilliams bradmwilliams force-pushed the qualifying-jobs-refactor branch 3 times, most recently from 1854cea to 01de19f Compare November 6, 2025 17:47
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@bradmwilliams bradmwilliams force-pushed the qualifying-jobs-refactor branch from 01de19f to 7b6bebc Compare November 6, 2025 17:59
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added these changes, specifically, to leverage the pre-existing presubmit job, in openshift/release, to validate the new release qualifiers config file.

Comment on lines 383 to 422
{
name: "Good config with nil qualifier",
configs: []releasecontroller.ReleaseConfig{{
Name: "4.19.0-0.nightly",
Verify: map[string]releasecontroller.ReleaseVerification{
"osd-aws": {
Optional: true,
MaxRetries: 2,
ProwJob: &releasecontroller.ProwJobVerification{
Name: "periodic-ci-openshift-release-master-nightly-4.19-osd-aws",
},
Qualifiers: releasequalifiers.ReleaseQualifiers{
"rosa": {},
},
},
},
},
},
expectedErr: false,
},
{
name: "Good config with empty qualifier",
configs: []releasecontroller.ReleaseConfig{{
Name: "4.19.0-0.nightly",
Verify: map[string]releasecontroller.ReleaseVerification{
"osd-aws": {
Optional: true,
MaxRetries: 2,
ProwJob: &releasecontroller.ProwJobVerification{
Name: "periodic-ci-openshift-release-master-nightly-4.19-osd-aws",
},
Qualifiers: releasequalifiers.ReleaseQualifiers{
"rosa": {},
},
},
},
},
},
expectedErr: false,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests are identical

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! I was originally using pointers and just blindly refactored everything when I switched over.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

},
},
{
name: "nil base with notifications",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
name: "nil base with notifications",
name: "empty base with notifications",

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

Copy link
Contributor

Choose a reason for hiding this comment

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

This file seems overly complicated to me. Golang's JSON marshal function already sorts keys for maps, so if we copy ReleaseQualifiers to a map[string]any, all that really needs to be sorted is the slices. Here's another method of pretty-print that passes the unit test. It does a json.Marshal->json.Unmarshal to create a full copy of the original data and then sorts Notifications.Jira.Escalations and Notifications.Slack.Escalations for each qualifier while copying to a generic map[string]any and then running json.MarshalIndent:

// PrettyPrint returns a pretty-printed JSON representation of ReleaseQualifiers
// with alphabetically sorted keys for consistent output
func (rqs ReleaseQualifiers) PrettyPrint() (string, error) {
	// use json marshaller to convert all structs to maps
	json1, err := json.Marshal(rqs)
	if err != nil {
		return "", err
	}
	qualiMap := make(ReleaseQualifiers)
	if err := json.Unmarshal(json1, &qualiMap); err != nil {
		return "", err
	}
	genericMap := make(map[string]any)
	for id, qualifier := range qualiMap {
		// unset labels
		qualifier.Labels = nil
		// sort escalation slices
		if qualifier.Notifications != nil {
			if qualifier.Notifications.Jira != nil {
				sort.Slice(qualifier.Notifications.Jira.Escalations, func(i, j int) bool {
					return qualifier.Notifications.Jira.Escalations[i].Name < qualifier.Notifications.Jira.Escalations[j].Name
				})
			}
			if qualifier.Notifications.Slack != nil {
				sort.Slice(qualifier.Notifications.Slack.Escalations, func(i, j int) bool {
					return qualifier.Notifications.Slack.Escalations[i].Name < qualifier.Notifications.Slack.Escalations[j].Name
				})
			}
		}
		genericMap[string(id)] = qualifier
	}

	// Marshal with pretty printing
	jsonData, err := json.MarshalIndent(genericMap, "", "  ")
	if err != nil {
		return "", err
	}

	return string(jsonData), nil
}
}

Your function is faster as it doesn't do the extra json conversions, but IMO the above is easier to read/maintain.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The prettyprint stuff was all AI. I just wanted a nice way to read the objects as I was developing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@bradmwilliams
Copy link
Collaborator Author

/label tide/merge-method-squash

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Nov 7, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2025

@bradmwilliams: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/govulncheck 1e4904b link false /test govulncheck
ci/prow/security 1e4904b link false /test security

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AlexNPavel, bradmwilliams

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:
  • OWNERS [AlexNPavel,bradmwilliams]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@bradmwilliams
Copy link
Collaborator Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 7, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit dc6c135 into openshift:main Nov 7, 2025
6 of 8 checks passed
@bradmwilliams bradmwilliams deleted the qualifying-jobs-refactor branch November 7, 2025 20:30
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. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants