Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Key paths:
- `solution/deps.yaml`, `solution-base/deps.yaml` — image/registry/tag manifests for every Zenko component
- `solution/zenkoversion.yaml` — `ZenkoVersion` CR template (dashboards, policies, feature flags, capabilities, location types)
- `solution/kafka/Dockerfile`, `solution/kafka-connect/Dockerfile` — Scality Kafka + Kafka Connect images
- `solution-base/mongodb/` — MongoDB Helm charts and patches
- `solution-base/mongodb/` — MongoDB Helm chart, vendored from `bitnami/charts` via `git subtree`
- `tests/functional/ctst/` — TypeScript Cucumber end-to-end tests
- `tests/workflows/` — TypeScript Jest tests for CI tooling
- `tests/zenko_tests/` — Python + Node.js integration tests
Expand All @@ -26,7 +26,7 @@ When reviewing a PR, analyze changes against the following. Post inline comments
| **Version coherence** | Bumps to `VERSION` / `deps.yaml` / `solution/zenkoversion.yaml` should stay mutually consistent. Feature flags or capabilities added in `zenkoversion.yaml` must correspond to service versions that actually support them. |
| **Dockerfiles** (`solution/kafka/`, `solution/kafka-connect/`...) | Base images pinned by tag or digest, no secrets baked in, no unnecessary `COPY . .`, reasonable layer count, user is non-root where possible. |
| **Helm charts & K8s manifests** (`solution-base/mongodb/charts/`, `monitoring/`) | Resource requests/limits set, label selectors match, no hard-coded namespaces, `securityContext` present, ServiceAccount scoping minimal. Any breaking chart-value renames documented in an upgrade note. |
| **Chart upgrade path** (`solution-base/mongodb/patches/`, `how_to_upgrade.md`) | If chart version or MongoDB version changes, upgrade notes are updated and patches still apply cleanly. |
| **Chart upgrade path** (`solution-base/mongodb/charts/`, `Makefile`, `how_to_upgrade.md`) | Changes under the vendored chart prefix arrive as a `git subtree` merge (squashed) plus discrete local-modification commits, not as ad-hoc edits to the tree. |
| **TypeScript tests** (`tests/functional/ctst/`, `tests/workflows/`) | Proper `async`/`await`, no swallowed promise rejections, Cucumber step definitions register correctly, no accidental `.only` / `.skip`, correct use of World context in ctst. |
| **Python tests** (`tests/zenko_tests/`) | No bare `except:`, specific exception types, consistency with existing style, `requirements.txt` kept in sync. |
| **CI workflows** (`.github/workflows/`) | Actions pinned (tag or SHA), secrets not echoed to logs, `permissions:` block scoped minimally, reusable-workflow inputs/secrets wired correctly, runner labels valid for Scality infra. |
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/end2end.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,27 +179,6 @@ jobs:
source: /tmp/artifacts
if: always()

check-mongo-patches:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: fetch mongo charts
run: make fetch-mongodb-sharded
working-directory: ./solution-base/mongodb
- name: apply patches to charts
run: make patch
working-directory: ./solution-base/mongodb
- name: compare with upstream charts and fail if diff exists
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Differences found between committed patches and applied patches:"
git diff
exit 1
else
echo "No differences found. All patches match their committed versions."
fi

build-doc:
runs-on: ubuntu-24.04
permissions:
Expand Down
65 changes: 47 additions & 18 deletions solution-base/mongodb/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,52 @@
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CHART_DIR:="${ROOT_DIR}/charts"
BITNAMI_REMOTE := bitnami-charts
BITNAMI_REPO := https://github.com/bitnami/charts.git

CHART_REPO:="https://charts.bitnami.com/bitnami"
CHART_MONGO_SHARDED_VERSION:="9.4.4"
CHART := mongodb-sharded
CHART_VERSION := 9.4.4
CHART_REF := $(CHART)/$(CHART_VERSION)

PATCH_DIR:="${ROOT_DIR}/patches"
PATCH_FILES:=$(shell ls -d ${PATCH_DIR}/*)
HELM=helm
# Repo-relative path of the vendored chart (needed by `git subtree`).
REPO_CHART_PREFIX := solution-base/mongodb/charts/$(CHART)
# Path relative to this Makefile's directory (where `helm` runs).
LOCAL_CHART_PREFIX := charts/$(CHART)

.PHONY: fetch patch
# Stable scratch branch name (no version) so `git subtree split` re-creates it
# in place each run; the merge base is resolved from the `git-subtree-split`
# trailer in history, not from this branch's identity.
VENDOR_BRANCH := vendor/charts/$(CHART)

fetch-mongodb-sharded:
@rm -rf ${CHART_DIR}
@${HELM} fetch mongodb-sharded \
--repo ${CHART_REPO} \
--version ${CHART_MONGO_SHARDED_VERSION} \
--untar \
--untardir ${CHART_DIR}
HELM := helm

patch:
@git apply --check ${PATCH_FILES}
@git apply ${PATCH_FILES}
.PHONY: create-remote fetch-remote update-vendor-branch vendor-sync deps

create-remote:
@git remote get-url $(BITNAMI_REMOTE) >/dev/null 2>&1 || \
git remote add $(BITNAMI_REMOTE) $(BITNAMI_REPO)

# Fetch full main + the target chart tag so `git subtree split` can synthesize
# the chart's history. `--no-tags` avoids importing bitnami/charts' ~1000 tags
# (one per chart-version bump across every chart) into the Zenko repo.
fetch-remote: create-remote
git fetch --no-tags $(BITNAMI_REMOTE) main
git fetch --no-tags $(BITNAMI_REMOTE) refs/tags/$(CHART_REF):refs/tags/$(CHART_REF)

update-vendor-branch: fetch-remote
-git branch -D $(VENDOR_BRANCH)
git subtree split --prefix=bitnami/$(CHART) $(CHART_REF) -b $(VENDOR_BRANCH)

# Maintainer-only: bump CHART_VERSION above, then `make vendor-sync` to merge
# upstream into our prefix. Resolves merge conflicts against our local commits
# the same way any git merge does.
vendor-sync: update-vendor-branch
git subtree merge --prefix=$(REPO_CHART_PREFIX) $(VENDOR_BRANCH) --squash
@$(MAKE) deps

# Resolve and extract the `bitnami/common` library chart so it appears as a
# subdirectory (required by `solution-base/build.sh`'s `helm template`).
Comment thread
delthas marked this conversation as resolved.
deps:
@$(HELM) dependency build $(LOCAL_CHART_PREFIX)
@cd $(LOCAL_CHART_PREFIX)/charts && \
for tgz in *.tgz; do \
[ -f "$$tgz" ] || continue; \
tar xzf "$$tgz" && rm "$$tgz"; \
done
Loading
Loading