Skip to content

mongodb: vendor chart via git subtree (alternative to #2420)#2423

Closed
delthas wants to merge 17 commits into
development/2.14from
improvement/ZENKO-5281/vendor-bitnami-charts-from-git-subtree
Closed

mongodb: vendor chart via git subtree (alternative to #2420)#2423
delthas wants to merge 17 commits into
development/2.14from
improvement/ZENKO-5281/vendor-bitnami-charts-from-git-subtree

Conversation

@delthas
Copy link
Copy Markdown
Contributor

@delthas delthas commented May 22, 2026

Draft — alternative implementation of ZENKO-5281; the team will pick this or #2420 and close the other.

Summary

Switch solution-base/mongodb/Makefile from helm fetch against charts.bitnami.com to vendoring the chart sources from the bitnami/charts GitHub repository via git subtree, mirroring the pattern that ZENKO-5110 already established for vendored Bitnami images in solution-base/images/Makefile. All 11 local modifications previously expressed as .patch files now live as ordinary git commits on top of the subtree merge.

Why this exists alongside #2420

The first PR for ZENKO-5281 (#2420) implemented the same goal via curl | tar of the GitHub release tarball. PR reviewer @francoisferrand suggested git subtree instead, both to match the solution-base/images/ precedent and to make future upstream merges produce real three-way merge conflicts rather than silent patch overwrites. This PR is that alternative; we'll compare locally and merge whichever the team prefers.

What changes

  • solution-base/mongodb/Makefile — full rewrite. New targets create-remote, fetch-remote, update-vendor-branch, vendor-sync, deps. The single maintainer command is make -C solution-base/mongodb vendor-sync (~4 minutes — fetches bitnami/charts history, runs git subtree split, merges as squash, re-resolves common).
  • solution-base/mongodb/charts/mongodb-sharded/ — re-introduced as a git subtree --squash of upstream tag mongodb-sharded/9.4.4. The common library chart is resolved via helm dependency build and extracted into charts/common/ so solution-base/build.sh's helm template finds it as a sub-chart.
  • 11 patch files → 11 individual commits. Each one's effect is reproduced verbatim; the commit message references the original patch filename for traceability.
  • solution-base/mongodb/patches/ deleted entirely.
  • solution-base/mongodb/how_to_upgrade.md rewritten to describe the new flow.
  • .github/workflows/end2end.yamlcheck-mongo-patches job removed (it verified make fetch + make patch produced no drift; with patches gone there is nothing to verify, and conflicts now surface as ordinary git merge conflicts during make vendor-sync).
  • .github/copilot-instructions.md — the Chart upgrade-path row now points at Makefile + make vendor-sync instead of patches/ + make patch.

What does NOT change

  • Pinned chart version stays at 9.4.4 — pure infrastructure switch. ZENKO-5276 becomes a CHART_VERSION bump + make vendor-sync whose merge brings in upstream's pgrep -x liveness probe fix.
  • solution-base/deps.yaml is untouched — image references are independent and addressed under ZENKO-5110.
  • solution-base/build.sh is untouched — it expects charts/common/ as an extracted directory, which the new Makefile preserves.

Verification

  • helm template against this branch and against mongodb: vendor chart via git subtree from bitnami/charts #2420's branch produce identical manifests (modulo helm-generated random Secret values per invocation).
  • make -C solution-base/mongodb vendor-sync is idempotent against mongodb-sharded/9.4.4: re-running on a clean tree produces no diff.
  • Each of the 17 commits is reviewable in isolation.

Costs

  • Maintainer-side make vendor-sync is a ~4-minute coffee break (subtree split walks 36 599 upstream commits).
  • One-time .git growth of ~41 MB in the maintainer's clone from the synthesized subdir commits; not pushed to origin.
  • bitnami-charts remote needs to be configured (Makefile does this automatically on first run).

Issue: ZENKO-5281

delthas added 4 commits May 22, 2026 15:58
Required because `git subtree add` cannot run against an existing
prefix. The next commit will re-introduce the chart at the same prefix
as a `git subtree add --squash` of upstream bitnami/charts at tag
mongodb-sharded/9.4.4.

Issue: ZENKO-5281
… commit d2eb70018d

git-subtree-dir: solution-base/mongodb/charts/mongodb-sharded
git-subtree-split: d2eb70018dc4de99fb5c7074265830307470367b
The bitnami packager bundles `bitnami/common` inline under `charts/common/`
in the OCI-published chart, but the git source tree does not include it.
`helm dependency build` resolves it from
oci://registry-1.docker.io/bitnamicharts/common per the `Chart.lock`-pinned
version, and we extract the resulting tarball to a directory so
`solution-base/build.sh`'s `helm template` invocation finds it as a
sub-chart at `charts/common/`.

Issue: ZENKO-5281
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 22, 2026

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 22, 2026

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@delthas delthas force-pushed the improvement/ZENKO-5281/vendor-bitnami-charts-from-git-subtree branch from 20db1d3 to a2f47ce Compare May 22, 2026 14:19
delthas added 13 commits May 22, 2026 17:22
Migrated from solution-base/mongodb/patches/mongodb-sharded-add-configsvr-service-file.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/update-default-values.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/mongodb-exporter-configuration.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/mongodb-sharded-add-configsvr-service.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/mongodb-sharded-add-pv-selector.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/mongodb-sharded-fix-podmonitor.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/mongos-dep-sts.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/replicaset-entrypoint-configmap.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/statefulset-permissions.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/redirect-logs-to-stdout.patch.

Issue: ZENKO-5281
Migrated from solution-base/mongodb/patches/mongodb-exporter-disable-collect-all.patch.

Issue: ZENKO-5281
All local modifications previously expressed as .patch files in this
directory have been migrated to individual git commits applied on top
of the `git subtree merge` of upstream `bitnami/mongodb-sharded/9.4.4`.
Future upstream merges will produce real three-way merge conflicts
against those commits, instead of silent `patch` failures.

Issue: ZENKO-5281
Replace the old `helm fetch` + `make patch` flow with `git subtree`-
based vendoring of the bitnami/charts GitHub repository:

* `solution-base/mongodb/Makefile` — adds the standard subtree
  machinery (`create-remote`, `fetch-remote`, `update-vendor-branch`,
  `vendor-sync`) mirroring `solution-base/images/Makefile`. The single
  maintainer-facing command is `make -C solution-base/mongodb
  vendor-sync`. `deps` is split out so a fresh clone with a stale
  `charts/common-*.tgz` can be re-resolved without re-running the
  ~4-minute subtree split.

* `solution-base/mongodb/how_to_upgrade.md` — rewritten to describe the
  new flow: bump `CHART_VERSION`, run `make vendor-sync`, resolve any
  three-way merge conflicts as ordinary git conflicts, and keep local
  tweaks as follow-up commits.

* `.github/workflows/end2end.yaml` — remove the `check-mongo-patches`
  job. Its purpose (verify `make fetch && make patch` produces no
  drift) no longer applies; there is no `make patch` to verify. Local
  modifications are now ordinary commits with their own review history,
  and upstream-vs-local conflicts surface during `git subtree merge`
  directly.

* `.github/copilot-instructions.md` — point the "Chart upgrade path"
  row at the new flow.

Issue: ZENKO-5281
@delthas delthas force-pushed the improvement/ZENKO-5281/vendor-bitnami-charts-from-git-subtree branch from a2f47ce to 9fed52a Compare May 22, 2026 15:23
@delthas
Copy link
Copy Markdown
Contributor Author

delthas commented May 22, 2026

Closing — the subtree implementation has been force-pushed onto #2420, which keeps the original review history. The branch this PR points at will be deleted shortly.

@delthas delthas closed this May 22, 2026
@delthas delthas deleted the improvement/ZENKO-5281/vendor-bitnami-charts-from-git-subtree branch May 22, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants