Skip to content

feat: add sparse checkout to git-sync containers#81395

Draft
Prucek wants to merge 1 commit into
openshift:mainfrom
Prucek:git-sync-sparse-checkout
Draft

feat: add sparse checkout to git-sync containers#81395
Prucek wants to merge 1 commit into
openshift:mainfrom
Prucek:git-sync-sparse-checkout

Conversation

@Prucek

@Prucek Prucek commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Add --sparse-checkout-file to 31 git-sync sidecar deployments so each only checks out the subdirectories it actually reads
  • Two new ConfigMaps (git-sync-sparse-checkout in ci and ship-status namespaces) hold the sparse-checkout patterns per deployment group
  • 4 deployments excluded (dptp-controller-manager, ci-operator-configresolver, ephemeral-cluster, ci-images-mirror) because they need the full repo via --release-repo-git-sync-path

Sparse-checkout pattern groups

Pattern Deployments
ci-operator/jobs/ crier, horologium, pcm, tide, gangway, retester, tot, slack-bot, ci-chat-bot, origin-controller
core-services/prow/02_config/ needs-rebase
ci-operator/jobs/ + core-services/prow/02_config/ hook, deck, sinker, statusreconciler, 10 release-controllers
ci-operator/config/ payload-testing-prow-plugin, multi-pr-prow-plugin
ci-operator/jobs/ + core-services/sanitize-prow-jobs/ prowjob-dispatcher
ci-operator/jobs/ + core-services/pipeline-controller/ pipeline-controller
core-services/ship-status/ component-monitor, dashboard

Test plan

  • Verify YAML is valid (done locally)
  • Confirm git-sync v4.3.0 --sparse-checkout-file flag works with ConfigMap-mounted file
  • Spot-check a few deployments after rollout to confirm they still read their config correctly
  • Monitor for git-sync restart loops or errors in pod logs

🤖 Generated with Claude Code

Summary by CodeRabbit

This PR switches a large set of CI and release-controller deployments to use sparse checkout when syncing openshift/release, so each component only pulls the subdirectories it needs instead of the full repository. It introduces a shared git-sync-sparse-checkout ConfigMap with per-component path patterns, then mounts that config into the affected git-sync init and sidecar containers across Prow, release-controller, ship-status, ci-chat-bot, and slack-bot deployments.

Practically, this should reduce sync time, bandwidth, and disk usage for OpenShift CI infrastructure while keeping the existing deployment layout intact.

Most git-sync sidecars clone the full openshift/release repo (1.9 GB)
but only read 1-2 subdirectories. This adds --sparse-checkout-file
to limit the working tree to the paths each deployment actually needs,
reducing disk usage and checkout time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Jul 2, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@Prucek: no rehearsable tests are affected by this change

Note: If this PR includes changes to step registry files (ci-operator/step-registry/) and you expected jobs to be found, try rebasing your PR onto the base branch. This helps pj-rehearse accurately detect changes when the base branch has moved forward.

@openshift-ci

openshift-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Prucek

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

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 2, 2026
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR configures git-sync sparse checkout across app.ci deployments. New ConfigMaps (git-sync-sparse-checkout) define sparse-checkout path patterns in the ci and ship-status namespaces. Across ~30 Deployment/Template manifests, both git-sync-init and git-sync containers gain a --sparse-checkout-file argument and mount a new read-only sparse-checkout volume.

Changes

Git-sync sparse checkout rollout

Layer / File(s) Summary
Sparse-checkout ConfigMap definitions
clusters/app.ci/prow/03_deployment/git-sync-sparse-checkout_configmap.yaml, clusters/app.ci/ship-status-dash/git-sync-sparse-checkout_configmap.yaml
New ConfigMaps define sparse-checkout path patterns for jobs, prow-config, ci-config, pipeline, sanitize, and ship-status directories.
Bot deployments
clusters/app.ci/assets/slack-bot.yaml, clusters/app.ci/ci-chat-bot/ci-chat-bot.yaml
git-sync-init and git-sync containers add --sparse-checkout-file and mount a read-only sparse-checkout volume backed by the ConfigMap.
Prow core service deployments
clusters/app.ci/prow/03_deployment/{crier,deck,gangway,hook,horologium,multi-pr-prow-plugin,needs_rebase,payload-testing-prow-plugin,pipeline-controller,prow-controller-manager,prowjob-dispatcher,retester,sinker,statusreconciler,tide,tot}.yaml
17 prow service Deployments/Templates add sparse-checkout arguments, volume mounts, and ConfigMap-backed volumes with keys tailored per component (jobs, prow-config, ci-config, jobs-and-prow-config, etc.).
Release-controller deployments
clusters/app.ci/release-controller/deploy-*-controller.yaml
11 release-controller Deployments (ocp, arm64, multi, ppc64le, s390x, origin and their priv variants) add sparse-checkout arguments, volume mounts, and ConfigMap-backed volumes.
Ship-status-dash deployments
clusters/app.ci/ship-status-dash/{component-monitor,dashboard}/deployment.yaml
component-monitor and dashboard Deployments add sparse-checkout arguments and mount the ship-status ConfigMap key.

Estimated code review effort: 2 (Simple) | ~12 minutes

Suggested reviewers: psalajova

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding sparse checkout support to git-sync containers.
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.
Stable And Deterministic Test Names ✅ Passed The PR only changes YAML/ConfigMap manifests; no Ginkgo test files or titles are modified, so the naming rule isn't implicated.
Test Structure And Quality ✅ Passed Only YAML manifests changed; no *_test.go or Ginkgo tests are present in the touched areas, so the test-quality check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes YAML manifests and non-Ginkgo tooling/unit-test files, so MicroShift compatibility is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only touches Kubernetes YAML manifests for git-sync sparse checkout; no new Ginkgo e2e tests or SNO-sensitive logic were added.
Topology-Aware Scheduling Compatibility ✅ Passed Affected manifests only add git-sync sparse-checkout args/volumes; no new nodeSelectors, required anti-affinity, topology spread, or replica changes were introduced.
Ote Binary Stdout Contract ✅ Passed Only deployment YAML/ConfigMap sparse-checkout manifests changed; no process-level code (main/init/TestMain) or stdout writes were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The PR changes YAML manifests and utility Go code only; no new Ginkgo e2e tests or IPv4/external-network assumptions were added.
No-Weak-Crypto ✅ Passed PASS: The PR only adds git-sync sparse-checkout YAML/configMap updates; targeted search of all touched files found no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or custom crypto code.
Container-Privileges ✅ Passed Changed manifests only add sparse-checkout args and ConfigMap volumes; no privileged, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation settings were found.
No-Sensitive-Data-In-Logs ✅ Passed Changed manifests only add sparse-checkout args and ConfigMap paths; no new log statements or sensitive values were introduced.
✨ 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 jupierce and smg247 July 2, 2026 12:40
@Prucek Prucek marked this pull request as draft July 2, 2026 12:42
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 2, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
clusters/app.ci/release-controller/deploy-ocp-multi-priv-controller.yaml (1)

136-137: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Update hack/generators/release-controllers/content/osd_rc_deployments.py for sparse-checkout wiring.
This generated block will drift unless the generator also emits the new --sparse-checkout-file args, mount, and sparse-checkout volume.

🤖 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 `@clusters/app.ci/release-controller/deploy-ocp-multi-priv-controller.yaml`
around lines 136 - 137, The generated release-controller deployment block is
missing the new sparse-checkout wiring, so update osd_rc_deployments.py in the
generator path to emit the same changes here: add the --sparse-checkout-file
arguments, mount the sparse-checkout file into the container, and define the
sparse-checkout volume so the generated YAML stays in sync. Use the
osd_rc_deployments.py generator and the release-controller deployment resource
names in the diff to locate the relevant template/output logic.
🤖 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.

Outside diff comments:
In `@clusters/app.ci/release-controller/deploy-ocp-multi-priv-controller.yaml`:
- Around line 136-137: The generated release-controller deployment block is
missing the new sparse-checkout wiring, so update osd_rc_deployments.py in the
generator path to emit the same changes here: add the --sparse-checkout-file
arguments, mount the sparse-checkout file into the container, and define the
sparse-checkout volume so the generated YAML stays in sync. Use the
osd_rc_deployments.py generator and the release-controller deployment resource
names in the diff to locate the relevant template/output logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 96b74589-0b81-457a-b060-2c01d1be7cd5

📥 Commits

Reviewing files that changed from the base of the PR and between 1902f07 and 097452f.

📒 Files selected for processing (33)
  • clusters/app.ci/assets/slack-bot.yaml
  • clusters/app.ci/ci-chat-bot/ci-chat-bot.yaml
  • clusters/app.ci/prow/03_deployment/crier.yaml
  • clusters/app.ci/prow/03_deployment/deck.yaml
  • clusters/app.ci/prow/03_deployment/gangway.yaml
  • clusters/app.ci/prow/03_deployment/git-sync-sparse-checkout_configmap.yaml
  • clusters/app.ci/prow/03_deployment/hook.yaml
  • clusters/app.ci/prow/03_deployment/horologium.yaml
  • clusters/app.ci/prow/03_deployment/multi-pr-prow-plugin.yaml
  • clusters/app.ci/prow/03_deployment/needs_rebase.yaml
  • clusters/app.ci/prow/03_deployment/payload-testing-prow-plugin.yaml
  • clusters/app.ci/prow/03_deployment/pipeline-controller.yaml
  • clusters/app.ci/prow/03_deployment/prow-controller-manager.yaml
  • clusters/app.ci/prow/03_deployment/prowjob-dispatcher.yaml
  • clusters/app.ci/prow/03_deployment/retester.yaml
  • clusters/app.ci/prow/03_deployment/sinker.yaml
  • clusters/app.ci/prow/03_deployment/statusreconciler.yaml
  • clusters/app.ci/prow/03_deployment/tide.yaml
  • clusters/app.ci/prow/03_deployment/tot.yaml
  • clusters/app.ci/release-controller/deploy-ocp-arm64-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-arm64-priv-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-multi-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-multi-priv-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-ppc64le-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-ppc64le-priv-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-priv-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-s390x-controller.yaml
  • clusters/app.ci/release-controller/deploy-ocp-s390x-priv-controller.yaml
  • clusters/app.ci/release-controller/deploy-origin-controller.yaml
  • clusters/app.ci/ship-status-dash/component-monitor/deployment.yaml
  • clusters/app.ci/ship-status-dash/dashboard/deployment.yaml
  • clusters/app.ci/ship-status-dash/git-sync-sparse-checkout_configmap.yaml

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant