Skip to content

Conversation

@RadekManak
Copy link
Contributor

@RadekManak RadekManak commented Dec 9, 2025

Update rebasebot hook script to write PROVIDER_VERSION to a .mk file that can be included by provider Makefiles allowing the version to be reused.

Summary by CodeRabbit

  • Chores
    • Build script now generates a provider-version manifest before OpenShift manifest generation and removes a stray trailing whitespace in the script.

✏️ Tip: You can customize this high-level summary in your review settings.

@openshift-ci-robot
Copy link

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 Dec 9, 2025
@openshift-ci-robot
Copy link

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

In response to this:

Update rebasebot hook script to write PROVIDER_VERSION to a .mk file that can be included by provider Makefiles allowing the version to be reused.

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
Copy link

coderabbitai bot commented Dec 9, 2025

Walkthrough

The generate-ocp-manifests.sh script now writes openshift/provider-version.mk containing PROVIDER_VERSION set from REBASEBOT_SOURCE before running the existing manifest build; also removes trailing whitespace from a comment line.

Changes

Cohort / File(s) Summary
Build Script Enhancement
hack/rebasebot-hook-scripts/generate-ocp-manifests.sh
Adds creation of openshift/provider-version.mk with PROVIDER_VERSION set to REBASEBOT_SOURCE; trims trailing whitespace on a comment line.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

  • Single-file change with a small, self-contained here-document and no other control-flow changes.

Poem

🐰 A tiny script, a careful scribe,
Writes a version for builds to vibe,
A line trimmed clean, a file made true,
Manifests follow — hop, review!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: writing the provider version to a .mk file in the rebasebot hook script.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 91fffdd and d8f8d83.

📒 Files selected for processing (1)
  • hack/rebasebot-hook-scripts/generate-ocp-manifests.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • hack/rebasebot-hook-scripts/generate-ocp-manifests.sh

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

@openshift-ci openshift-ci bot requested review from mdbooth and racheljpg December 9, 2025 11:34
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 9, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
hack/rebasebot-hook-scripts/generate-ocp-manifests.sh (1)

35-39: Add directory existence check before writing generated file.

The script attempts to write openshift/provider-version.mk without verifying that the openshift directory exists. While the script will fail with set -e, adding an explicit check improves clarity and error messages.

Apply this diff to verify the directory exists:

     # Write provider version to a .mk file that can be included by Makefiles
+    if [[ ! -d "openshift" ]]; then
+        echo "Error: openshift directory does not exist" >&2
+        exit 1
+    fi
+
     cat > openshift/provider-version.mk <<EOF
     # This file is generated by rebasebot. Do not edit.
     PROVIDER_VERSION := ${PROVIDER_VERSION}
     EOF
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a52cfc1 and 91fffdd.

📒 Files selected for processing (1)
  • hack/rebasebot-hook-scripts/generate-ocp-manifests.sh (1 hunks)
🔇 Additional comments (1)
hack/rebasebot-hook-scripts/generate-ocp-manifests.sh (1)

32-39: Verify downstream Makefiles can include the generated .mk file.

The generated file is written to openshift/provider-version.mk from the repository root, then later the script changes into the openshift directory to run make ocp-manifests. Ensure that any Makefiles in the openshift directory that need to reference PROVIDER_VERSION correctly include this file (e.g., include provider-version.mk).

To verify this integration, check that the Makefiles in the openshift directory have appropriate include statements and that PROVIDER_VERSION is properly referenced.

Update rebasebot hook script to write PROVIDER_VERSION to a .mk file
that can be included by provider Makefiles allowing the version to
be reused.
@RadekManak RadekManak force-pushed the rebasebot-provider-version-mk branch from 91fffdd to d8f8d83 Compare December 9, 2025 13:56
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 9, 2025

@RadekManak: 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.

Comment on lines +35 to +39
# Write provider version to a .mk file that can be included by Makefiles
cat > openshift/provider-version.mk <<EOF
# This file is generated by rebasebot. Do not edit.
PROVIDER_VERSION ?= ${PROVIDER_VERSION}
EOF
Copy link
Member

Choose a reason for hiding this comment

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

Is this an idiomatic pattern?

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.

3 participants