Skip to content

ci: pin documentdb build to chart documentDbVersion#373

Closed
WentingWu666666 wants to merge 5 commits intodocumentdb:mainfrom
WentingWu666666:developer/fix-ci-pin-documentdb-version
Closed

ci: pin documentdb build to chart documentDbVersion#373
WentingWu666666 wants to merge 5 commits intodocumentdb:mainfrom
WentingWu666666:developer/fix-ci-pin-documentdb-version

Conversation

@WentingWu666666
Copy link
Copy Markdown
Collaborator

What

Pin the build-packages job's documentdb checkout to the chart's default documentDbVersion instead of upstream main.

Why

The build-packages job in test-build-and-package.yml currently builds documentdb from documentdb/documentdb@main. That checkout includes the upstream regression suite (make check / override_dh_auto_test in debian/rules), which has rows that flip success/fail per upstream SHA most recently visible as setUnion / setDifference projection diffs caused by missing ORDER BY in regress expected output. See PR #364 for the resulting CI red.

The chart's values.yaml already pins the database version it ships (documentDbVersion: 0.109.0). Building from that exact tag rather than from a moving main means the operator-repo CI is testing the same documentdb the chart actually deploys, and immutable tags don't have the upstream-flake exposure.

What changed

  • test-build-and-package.yml now reads documentDbVersion from the chart values.yaml at workflow time and translates it to the upstream tag format (0.109.0 -> v0.109-0) before checking out documentdb.
  • The documentdb_ref input is preserved as a caller-supplied override; its default goes from 'main' to empty (which now means "derive from chart").

Why this is preferable to skipping regression tests

Earlier mitigation attempts on PR #364 disabled the upstream regression suite outright. That bypasses real signal and isn't the right long-term posture for the operator repo. Pinning to the chart's shipped version keeps the regression suite running, on a known-good immutable tag.

Validation

  • All workflows triggered by this PR are expected to pass; will mark Ready-for-Review once green.
  • If the chart's documentDbVersion is bumped in a future PR (e.g. PR chore: bump default DocumentDB version to 0.110.0 #364 -> 0.110.0), this workflow auto-follows; no separate workflow change is required.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

wentingwu000 and others added 5 commits May 8, 2026 10:28
The build-packages job currently checks out documentdb/documentdb@main, which exposes the operator repo's CI to unstable regression tests on upstream HEAD (e.g. setUnion / setDifference projection diffs caused by missing ORDER BY in regress expected output). The chart's values.yaml already pins documentDbVersion (currently 0.109.0), and that version is what the operator actually ships and validates.

Read documentDbVersion from values.yaml at workflow time and translate it to the matching upstream tag (e.g. 0.109.0 -> v0.109-0). The caller-supplied documentdb_ref input still takes precedence for ad-hoc dispatches; the empty default now means 'derive from chart', not 'use main'. This keeps CI builds in lock-step with the shipped chart version and avoids whole classes of upstream-flake outages.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Wenting Wu <wentingwu@microsoft.com>
Without this, edits to the reusable build workflow don't run through E2E and ship untested.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Wenting Wu <wentingwu@microsoft.com>
The gateway packaging script was moved upstream from ./packaging/build_gateway_packages.sh to ./packaging/gateway/build_gateway_packages.sh. With the workflow now pinned to the chart's documentDbVersion (e.g. v0.109-0), the older path is what's actually present at that tag. Probe for either path so this step works against both old tags and main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Wenting Wu <wentingwu@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Wenting Wu <wentingwu@microsoft.com>
Operator e2e tests on main require server behavior present in documentdb v0.110-0; v0.109-0 fails CRUD/update_ops with duplicate-key on _id_ index. Aligns chart with the version e2e expects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Wenting Wu <wentingwu@microsoft.com>
@documentdb-triage-tool
Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: CI/CD, enhancement, performance
Project fields suggested: Component ci · Priority P1 · Effort M · Status In Progress
Confidence: 0.92 (mixed)

Reasoning

component from path globs (ci); effort from diff stats (53+7 LOC, 3 files); LLM: Fixes a CI flakiness/red caused by unpinned upstream main checkout in test-build-and-package.yml, restoring reliable CI signal by pinning the documentdb build to the chart's deployed version tag.

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

@WentingWu666666 WentingWu666666 marked this pull request as ready for review May 8, 2026 16:12
@WentingWu666666 WentingWu666666 requested a review from xgerman as a code owner May 8, 2026 16:12
Copilot AI review requested due to automatic review settings May 8, 2026 16:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Pins the DocumentDB source checkout used by the CI package build to the Helm chart’s default documentDbVersion, so CI builds/tests the same upstream tag the chart ships (while keeping a caller override available).

Changes:

  • Bump the chart default documentDbVersion to 0.110.0.
  • Update test-build-and-package.yml to derive the DocumentDB git ref from values.yaml (translating 0.x.yv0.x-y) unless documentdb_ref is explicitly provided.
  • Extend E2E workflow path filters to include changes to the reusable build-and-package workflow.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
operator/documentdb-helm-chart/values.yaml Updates the chart’s default DocumentDB version used for image/tag selection.
.github/workflows/test-e2e.yml Ensures E2E runs when the reusable build workflow changes.
.github/workflows/test-build-and-package.yml Derives the DocumentDB checkout ref from the chart version and adds a gateway script path fallback.

Comment on lines +196 to +199
VERSION=$(grep -E '^documentDbVersion:' "$VALUES_FILE" \
| sed -E 's/^documentDbVersion:[[:space:]]*"?([^"[:space:]]+)"?.*/\1/')
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "ERROR: failed to parse documentDbVersion from $VALUES_FILE (got '$VERSION')" >&2
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.

3 participants