Skip to content

NO-ISSUE: Restore deepcopy generation - #3109

Open
skitt wants to merge 1 commit into
openshift:masterfrom
skitt:restore-deepcopy-gen
Open

NO-ISSUE: Restore deepcopy generation#3109
skitt wants to merge 1 commit into
openshift:masterfrom
skitt:restore-deepcopy-gen

Conversation

@skitt

@skitt skitt commented Aug 5, 2026

Copy link
Copy Markdown
Member

kube_codegen.sh no longer does anything when invoked; it's intended to be sourced, and defines functions to call for various code generation features.

This adjusts hack/update-codegen.sh to match: kube_codegen.sh is sourced, and kube::codegen::gen_helpers is used to generate deepcopy functions. This requires GOFLAGS=-mod=readonly because kube_codegen.sh expects "go install" to work, and the default -mod=vendor (because the vendor directory is present) doesn't work for that.

To verify this, delete pkg/apis/network/v1/zz_generated.deepcopy.go; the current hack/update-codegen.sh won’t regenerate it, whereas the updated version will.

kube_codegen.sh no longer does anything when invoked; it's intended to
be sourced, and defines functions to call for various code generation
features.

This adjusts hack/update-codegen.sh to match: kube_codegen.sh is
sourced, and kube::codegen::gen_helpers is used to generate deepcopy
functions. This requires GOFLAGS=-mod=readonly because kube_codegen.sh
expects "go install" to work, and the default -mod=vendor (because the
vendor directory is present) doesn't work for that.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 5, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@skitt: This pull request explicitly references no jira issue.

Details

In response to this:

kube_codegen.sh no longer does anything when invoked; it's intended to be sourced, and defines functions to call for various code generation features.

This adjusts hack/update-codegen.sh to match: kube_codegen.sh is sourced, and kube::codegen::gen_helpers is used to generate deepcopy functions. This requires GOFLAGS=-mod=readonly because kube_codegen.sh expects "go install" to work, and the default -mod=vendor (because the vendor directory is present) doesn't work for that.

To verify this, delete pkg/apis/network/v1/zz_generated.deepcopy.go; the current hack/update-codegen.sh won’t regenerate it, whereas the updated version will.

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.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Chores
    • Updated the code-generation process to use the vendored Kubernetes helpers and project boilerplate.
    • Removed the previous direct deep-copy generation step.

Walkthrough

The code-generation script now sources Kubernetes code-generation helpers and calls kube::codegen::gen_helpers with the project boilerplate file and ./pkg/apis. The direct deepcopy generator invocation was removed.

Changes

Code generation update

Layer / File(s) Summary
Use Kubernetes code-generation helpers
hack/update-codegen.sh
The script sources the vendored Kubernetes helpers and runs kube::codegen::gen_helpers with the project boilerplate and API package path.

Estimated code review effort: 1 (Trivial) | ~2 minutes


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 1 inconclusive)

Check name Status Explanation Resolution
Pr Quality ❌ Error PR lacks required testing documentation specifying which CI jobs run for this change. Manual verification step provided, but no mention of automated CI platforms/lanes. Bugfix restoration also lack... Add section documenting which CI jobs validate this change (e.g., which .ci-operator.yaml steps or Prow jobs run verify-update-codegen on which platforms). Optionally add a bug/issue link if available.
Commit Message Quality ❓ Inconclusive Custom check execution failed before a final verdict was produced. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (22 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Unit Tests For Go Changes ✅ Passed The PR changes only hack/update-codegen.sh, a script. No non-test Go files under pkg/ or cmd/, bindata templates, or test files changed.
E2e Tests For Feature Changes ✅ Passed The PR changes only hack/update-codegen.sh; no Go files under pkg/ or cmd/ changed, so the E2E criteria do not apply.
Rbac Least Privilege ✅ Passed The pull request changes only hack/update-codegen.sh; no YAML files under bindata/ or manifests/ are changed.
Docs For Feature And Behavior Changes ✅ Passed Only hack/update-codegen.sh changed; the PR restores internal deepcopy generation and changes no CNO user-facing behavior or architecture.
Stale Project Docs And Config ✅ Passed The commit changes only hack/update-codegen.sh. The scoped docs and .coderabbit.yaml contain no affected code-generation references or stale paths.
Go And Test Code Quality ✅ Passed The pull request modifies only hack/update-codegen.sh; it adds no new or modified Go code, so none of the nine Go/test checks apply.
Ai-Generated Code Smell ✅ Passed The commit changes only hack/update-codegen.sh by three concise functional lines; no added comments, tests, unnecessary blocks, or AI/tool references are present.
Stable And Deterministic Test Names ✅ Passed PR modifies only hack/update-codegen.sh, a code generation script. No test files or Ginkgo test names are added or changed.
Test Structure And Quality ✅ Passed The custom check applies to Ginkgo test code quality. The PR modifies only hack/update-codegen.sh, a shell script, with no test files changed. The check is inapplicable.
Microshift Test Compatibility ✅ Passed This PR modifies only hack/update-codegen.sh, a build script for code generation. No new Ginkgo e2e tests (It, Describe, Context, When) are added, so the MicroShift test compatibility check does no...
Single Node Openshift (Sno) Test Compatibility ✅ Passed The pull request changes only hack/update-codegen.sh and adds no Ginkgo e2e tests or test assumptions requiring multiple nodes.
Topology-Aware Scheduling Compatibility ✅ Passed The pull request modifies only hack/update-codegen.sh; it adds no deployment manifests, operator code, controllers, replicas, affinity, topology spread, selectors, or PDBs.
Ote Binary Stdout Contract ✅ Passed The PR changes only hack/update-codegen.sh; the repository has no openshift-tests or OTE suite integration, so this JSON-stdout check is not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The pull request changes only hack/update-codegen.sh and adds no Ginkgo e2e tests or IPv4/external-connectivity assumptions.
No-Weak-Crypto ✅ Passed The sole changed file is code-generation shell logic; added lines only source Kubernetes helpers and invoke gen_helpers, with no weak-crypto algorithms, crypto code, or secret comparisons.
Container-Privileges ✅ Passed The pull request changes only hack/update-codegen.sh; it adds no container or Kubernetes manifest privilege settings.
No-Sensitive-Data-In-Logs ✅ Passed The changed script logs only generation status and fixed headers; the sourced helper logs target counts, package paths, and argument errors, with no passwords, tokens, keys, PII, or customer data.
Title check ✅ Passed The title uses the imperative mood, is 37 characters long, and accurately describes restoring deepcopy generation.
Description check ✅ Passed The description clearly explains the code-generation script changes and provides a verification method.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from kyrtapz and tssurya August 5, 2026 16:22
@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: skitt
Once this PR has been reviewed and has the lgtm label, please assign abhat for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@skitt: The following test 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/5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-upgrade 9270c80 link false /test 5.0-upgrade-from-stable-4.22-e2e-gcp-ovn-upgrade

Full PR test history. Your PR dashboard.

Details

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants