Skip to content

Conversation

everettraven
Copy link
Contributor

We noticed in #2492 that the crdify verification passed when we would have expected it to fail.

We noticed in the logs that it did properly return failed validation in the logs but still exited successfully.

This was because my original PR to add the crdify codegen generator did not count the errors from the comparison validations as an error to be returned and instead we only built out the generator results.

This PR updates the method where the comparison validations occur to consider errors in the validations result as a normal Go error as well, returning an aggregated error of all comparison validation errors that have occurred alongside the generator results.

Copy link
Contributor

openshift-ci bot commented Sep 22, 2025

Hello @everettraven! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@everettraven everettraven changed the title (bugfix): fix crdify generator to also return an aggregated error when validations fail (bugfix): crdify generator returns aggregated error when validations fail Sep 22, 2025
@openshift-ci openshift-ci bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 22, 2025
@openshift-ci openshift-ci bot requested review from deads2k and JoelSpeed September 22, 2025 18:46
results = append(results, result)
}

if errs != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not check directly against result.Errors? It's a list of errors already so could just check that's non zero and create an aggregate from that no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is after building the list of generator results. We would need to iterate through all the results and their errors instead of building the error list as we go.

That being said, this should actually be

Suggested change
if errs != nil {
if len(errs) > 0 {

@JoelSpeed
Copy link
Contributor

/lgtm
/verified bypass

Small tooling change, doesn't need a bypass

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Sep 23, 2025
@openshift-ci-robot
Copy link

@JoelSpeed: The verified label has been added.

In response to this:

/lgtm
/verified bypass

Small tooling change, doesn't need a bypass

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 23, 2025
@openshift-ci-robot
Copy link

/test remaining-required

Overriding unmatched contexts:
/override ci/prow/e2e-aws-ovn ci/prow/e2e-aws-ovn-hypershift ci/prow/e2e-aws-ovn-hypershift-conformance ci/prow/e2e-aws-ovn-techpreview ci/prow/e2e-aws-serial-1of2 ci/prow/e2e-aws-serial-2of2 ci/prow/e2e-aws-serial-techpreview-1of2 ci/prow/e2e-aws-serial-techpreview-2of2 ci/prow/e2e-azure ci/prow/e2e-gcp ci/prow/e2e-upgrade ci/prow/e2e-upgrade-out-of-change

Copy link
Contributor

openshift-ci bot commented Sep 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 23, 2025
Copy link
Contributor

openshift-ci bot commented Sep 23, 2025

@openshift-ci-robot: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test build
/test e2e-aws-ovn
/test e2e-aws-ovn-hypershift
/test e2e-aws-ovn-hypershift-conformance
/test e2e-aws-ovn-techpreview
/test e2e-aws-serial-1of2
/test e2e-aws-serial-2of2
/test e2e-aws-serial-techpreview-1of2
/test e2e-aws-serial-techpreview-2of2
/test e2e-azure
/test e2e-gcp
/test e2e-upgrade
/test e2e-upgrade-out-of-change
/test images
/test integration
/test lint
/test minor-e2e-upgrade-minor
/test minor-images
/test okd-scos-images
/test unit
/test verify
/test verify-client-go
/test verify-crd-schema
/test verify-crdify
/test verify-deps
/test verify-feature-promotion

The following commands are available to trigger optional jobs:

/test okd-scos-e2e-aws-ovn

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-api-master-build
pull-ci-openshift-api-master-images
pull-ci-openshift-api-master-integration
pull-ci-openshift-api-master-lint
pull-ci-openshift-api-master-minor-images
pull-ci-openshift-api-master-okd-scos-images
pull-ci-openshift-api-master-unit
pull-ci-openshift-api-master-verify
pull-ci-openshift-api-master-verify-client-go
pull-ci-openshift-api-master-verify-crd-schema
pull-ci-openshift-api-master-verify-crdify
pull-ci-openshift-api-master-verify-deps
pull-ci-openshift-api-master-verify-feature-promotion

In response to this:

/test remaining-required

Overriding unmatched contexts:
/override ci/prow/e2e-aws-ovn ci/prow/e2e-aws-ovn-hypershift ci/prow/e2e-aws-ovn-hypershift-conformance ci/prow/e2e-aws-ovn-techpreview ci/prow/e2e-aws-serial-1of2 ci/prow/e2e-aws-serial-2of2 ci/prow/e2e-aws-serial-techpreview-1of2 ci/prow/e2e-aws-serial-techpreview-2of2 ci/prow/e2e-azure ci/prow/e2e-gcp ci/prow/e2e-upgrade ci/prow/e2e-upgrade-out-of-change

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.

Copy link
Contributor

openshift-ci bot commented Sep 23, 2025

@openshift-ci-robot: Overrode contexts on behalf of openshift-ci-robot: ci/prow/e2e-aws-ovn, ci/prow/e2e-aws-ovn-hypershift, ci/prow/e2e-aws-ovn-hypershift-conformance, ci/prow/e2e-aws-ovn-techpreview, ci/prow/e2e-aws-serial-1of2, ci/prow/e2e-aws-serial-2of2, ci/prow/e2e-aws-serial-techpreview-1of2, ci/prow/e2e-aws-serial-techpreview-2of2, ci/prow/e2e-azure, ci/prow/e2e-gcp, ci/prow/e2e-upgrade, ci/prow/e2e-upgrade-out-of-change

In response to this:

/test remaining-required

Overriding unmatched contexts:
/override ci/prow/e2e-aws-ovn ci/prow/e2e-aws-ovn-hypershift ci/prow/e2e-aws-ovn-hypershift-conformance ci/prow/e2e-aws-ovn-techpreview ci/prow/e2e-aws-serial-1of2 ci/prow/e2e-aws-serial-2of2 ci/prow/e2e-aws-serial-techpreview-1of2 ci/prow/e2e-aws-serial-techpreview-2of2 ci/prow/e2e-azure ci/prow/e2e-gcp ci/prow/e2e-upgrade ci/prow/e2e-upgrade-out-of-change

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.

Copy link
Contributor

openshift-ci bot commented Sep 23, 2025

@everettraven: all tests passed!

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-merge-bot openshift-merge-bot bot merged commit 8a46f74 into openshift:master Sep 23, 2025
26 checks passed
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. verified Signifies that the PR passed pre-merge verification criteria
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants