Skip to content

fix(hack): enhance hack/propagate.sh with git optimization, support custom argocd-operator branch, and inclusion in Makefile targets#1196

Open
chengfang wants to merge 1 commit into
redhat-developer:masterfrom
chengfang:hack.propagate.sh
Open

fix(hack): enhance hack/propagate.sh with git optimization, support custom argocd-operator branch, and inclusion in Makefile targets#1196
chengfang wants to merge 1 commit into
redhat-developer:masterfrom
chengfang:hack.propagate.sh

Conversation

@chengfang

@chengfang chengfang commented Jun 29, 2026

Copy link
Copy Markdown

What type of PR is this?
/kind enhancement

What does this PR do / why we need it:
enhance hack/propagate.sh to detect any manifest drift between argocd-operator and gitops-operator

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes #?
https://redhat.atlassian.net/browse/GITOPS-10196

Test acceptance criteria:

  • Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:

…ustom argocd-operator branch, and inclusion in Makefile targets

Signed-off-by: Cheng Fang <cfang@redhat.com>

Co-authored-by: Claude <noreply@anthropic.com>
@openshift-ci openshift-ci Bot added the kind/enhancement New feature or request label Jun 29, 2026
@openshift-ci openshift-ci Bot requested review from chetan-rns and varshab1210 June 29, 2026 19:57
@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

[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 jgwest 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 Jun 29, 2026

Copy link
Copy Markdown

Hi @chengfang. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a manifest propagation step before bundle generation, helping ensure published bundle metadata stays in sync.
    • Bundle generation can now use a configurable source branch, with a default fallback for convenience.
  • Bug Fixes

    • Improved manifest copying behavior to better handle changes from the selected source branch.
    • Added an option to skip rebuilding during propagation, speeding up the workflow when a rebuild isn’t needed.

Walkthrough

The bundle Makefile target gains a propagate-manifests prerequisite backed by a new configurable target using ARGOCD_OPERATOR_BRANCH. The hack/propagate.sh script adds --from-branch and --skip-make argument parsing, switches to a shallow single-branch clone, and conditionally skips make bundle.

Changes

Manifest Propagation Enhancement

Layer / File(s) Summary
propagate.sh argument parsing, clone, and conditional build
hack/propagate.sh
Adds FROM_BRANCH/SKIP_MAKE variables, a usage() helper, while/case CLI parsing, shallow --depth 1 --branch "$FROM_BRANCH" clone, and conditional make bundle execution guarded by SKIP_MAKE.
Makefile propagate-manifests target and bundle dependency
Makefile
Adds ARGOCD_OPERATOR_BRANCH ?= master, a propagate-manifests phony target that calls ./hack/propagate.sh --skip-make --from-branch $(ARGOCD_OPERATOR_BRANCH), and adds propagate-manifests to the bundle prerequisite list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and matches the main changes to propagate.sh and Makefile targets.
Description check ✅ Passed The description is clearly related to the manifest drift and script changes in this pull request.
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@chengfang

Copy link
Copy Markdown
Author

/ok-to-test

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown

@chengfang: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Line 270: The default bundle generation path is too tightly coupled to remote
manifest syncing because the bundle target invokes propagate-manifests, which
shells into the live git clone flow in hack/propagate.sh. Update the Makefile so
bundle only performs local, reproducible generation steps (operator-sdk,
manifests, kustomize), and move the remote sync behavior behind a separate
explicit target or opt-in step. Keep the existing bundle-related targets
consistent by adjusting any adjacent bundle/propagate-manifests definitions so
make bundle no longer depends on GitHub availability or upstream branch tip.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: b935e3b2-694b-44fa-b487-102e637d23af

📥 Commits

Reviewing files that changed from the base of the PR and between 93a8216 and aa61962.

📒 Files selected for processing (2)
  • Makefile
  • hack/propagate.sh
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

Comment thread Makefile

.PHONY: bundle
bundle: operator-sdk manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
bundle: operator-sdk propagate-manifests manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Decouple remote manifest sync from the default bundle target.

Because this target now shells into hack/propagate.sh, and that script does a live git clone from argocd-operator (Line 42 in hack/propagate.sh), every make bundle depends on GitHub availability and the current tip of $(ARGOCD_OPERATOR_BRANCH)/master. That makes bundle generation non-reproducible and can break existing CI/E2E/docs workflows that already call make bundle as a normal local generation step.

Possible fix
-bundle: operator-sdk propagate-manifests manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
+bundle: operator-sdk manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
@@
 .PHONY: propagate-manifests
 propagate-manifests: ## compare and propagate manifests from argocd-operator repo
 	./hack/propagate.sh --skip-make --from-branch $(ARGOCD_OPERATOR_BRANCH)
+
+.PHONY: bundle-with-propagation
+bundle-with-propagation: propagate-manifests bundle

Also applies to: 284-293

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` at line 270, The default bundle generation path is too tightly
coupled to remote manifest syncing because the bundle target invokes
propagate-manifests, which shells into the live git clone flow in
hack/propagate.sh. Update the Makefile so bundle only performs local,
reproducible generation steps (operator-sdk, manifests, kustomize), and move the
remote sync behavior behind a separate explicit target or opt-in step. Keep the
existing bundle-related targets consistent by adjusting any adjacent
bundle/propagate-manifests definitions so make bundle no longer depends on
GitHub availability or upstream branch tip.

Source: Linked repositories

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant