Skip to content

docs: update the release agent to match the actual release process - #509

Merged
hossain-rayhan merged 2 commits into
documentdb:mainfrom
hossain-rayhan:rayhan/release-agent-update
Nov 13, 2026
Merged

hossain-rayhan merged 2 commits into
documentdb:mainfrom
hossain-rayhan:rayhan/release-agent-update

Conversation

@hossain-rayhan

@hossain-rayhan hossain-rayhan commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Rewrites .github/agents/release-agent.md so it matches how releases are actually prepared (1.0.0, 1.1.0, 1.1.1 and the 1.2.0 release PR #506). The old agent only bumped Chart.yaml and the CHANGELOG, named the wrong workflows, and pushed unsigned commits to origin.

What changed in the agent

Area Before After
Files updated Chart.yaml, CHANGELOG.md only; "stage only these two" A table of every file that carries the operator version (Helm test image tags, index.md, before-you-start.md, release-strategy.md, upgrades.md), split by patch vs minor, plus git grep for leftovers
CHANGELOG Rebuilt from git log --since=<date> Promotes [Unreleased], then checks it against git log <last-tag>..origin/main so every shipped PR is listed. The 1.1.1 entry missed #496 and #493. Also checks the previous release date.
Version tracks Not covered Asks whether documentDbVersion changes. If it does, the database workflows run first and their auto PR is merged before the operator release.
CRDs Not covered Detects CRD changes. The CHANGELOG and release notes say "Apply the X.Y.Z CRDs before helm upgrade", and the upgrade-guide version ranges and rollback notes get updated.
Validation make test helm unittest, helm lint, a rendered-image check, mkdocs build --strict, and a kind test: upgrade from the published previous chart, rollback, roll forward and fresh install
Git release/vX.Y.Z pushed to origin, no sign-off Upstream and fork remotes found by URL; branch <user>/release-X.Y.Z from <upstream>/main, pushed to the fork, git commit -s
Post-merge "RELEASE - Build Candidate Images" / "RELEASE - Promote Candidate Images…" (wrong names, no inputs) Wait for E2E on the merge SHA. RELEASE - Build Operator Candidate Images (version), then RELEASE - Promote Operator Images and Publish Helm Chart (candidate_version: X.Y.Z-test, version, source_ref: <merge-sha>). Plain X.Y.Z tag and verification commands. Notes that the control-plane upgrade E2E spec is skipped in CI (it needs the run's built chart in E2E_UPGRADE_CURRENT_CHART), so the kind test is the chart-upgrade check.

Kept: the version-format validation (command-injection guard), the increment check, and the patch/minor/major bump commands.

Validation

Docs-only change. I checked that every path, workflow name, workflow input, Helm value and E2E variable the agent references exists on main.

The release agent only bumped Chart.yaml and the CHANGELOG, built the
CHANGELOG from date ranges, named the wrong workflows and pushed
unsigned commits to origin. Rewrite it to follow how the 1.0.0, 1.1.0,
1.1.1 and 1.2.0 releases were actually prepared:

- List every file that carries the operator version (Helm test image
  tags, index.md, before-you-start.md, release-strategy.md, upgrades.md)
  and grep for leftovers.
- Promote [Unreleased] and check it against git log <last-tag>..main so
  every shipped PR is listed.
- Ask whether documentDbVersion changes and hand that to the database
  release workflows.
- Detect CRD changes and require "apply CRDs before helm upgrade" plus
  upgrade-guide updates.
- Validate with helm unittest/lint, mkdocs build --strict and a kind
  upgrade, rollback and fresh-install test.
- Commit with -s, push to the fork, and give the correct post-merge
  steps (operator workflow names and inputs including source_ref,
  plain X.Y.Z tag, E2E_UPGRADE_PREVIOUS_VERSION).

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 9f1a71b4-9969-4456-9f65-8d19dd550d8e
Signed-off-by: Rayhan Hossain <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 18:14

Copilot AI 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.

🟡 Changes recommended

The release instructions omit required test setup and rollback configuration, can skip upgrade coverage, and may use a stale fork as the release base.

5 open issues
What changed in this PR

Updates the release agent’s documentation to reflect the operator’s current release process, using recent releases and the 1.2.0 release preparation as reference.

Changes:

  • Expands preparation to cover version references, changelog completeness, database-track coordination, and CRD upgrade guidance.
  • Documents Helm, documentation, and kind upgrade, rollback, and fresh-install validation.
  • Corrects fork-based PR creation, DCO sign-off, and post-merge workflow names, inputs, tagging, and verification.
File Description
.github/​agents/​release-agent.md Rewrites the operator release checklist from preparation through post-release verification.

Review effort: Balanced

Comment thread .github/agents/release-agent.md Outdated
### Bug Fixes
- Fix description from commit
```bash
git fetch origin main --tags

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 22fb046. Step 0 now identifies <upstream> (the remote whose URL is documentdb/documentdb-kubernetes-operator) and <fork-remote> by URL instead of assuming origin is upstream. The fetch, release-branch base, CRD diff, CHANGELOG range and rebase all use <upstream>/main.

Comment thread .github/agents/release-agent.md Outdated
2. Create a `DocumentDB` (and a `ScheduledBackup`) using the API version that release served, and insert test data through the gateway with `mongosh` (`mongodb://…@documentdb-service-<name>.<ns>.svc:10260/?directConnection=true&authMechanism=SCRAM-SHA-256&tls=true&tlsAllowInvalidCertificates=true`).
3. **Apply the new CRDs** with `kubectl apply --server-side --force-conflicts -f operator/documentdb-helm-chart/crds/`, and check that the old operator still works.
4. **`helm upgrade`** to the release-branch chart with `--set image.documentdbk8soperator.repository=localhost/documentdb-operator --set image.sidecarinjector.repository=localhost/documentdb-sidecar --set image.documentdbk8soperator.pullPolicy=Never --set image.sidecarinjector.pullPolicy=Never`.
5. **Verify**: the database pod UID is unchanged and has 0 restarts, the cluster is healthy, all data is intact, and the operator logs show no errors besides first-reconcile `object has been modified` retries. Create a new cluster with the current API version and do a read/write. If CRDs changed, check the webhook rejects an invalid change (for example a PVC shrink) through every served API version, and run any migration commands from the upgrade guide.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, fixed in 22fb046. The pod-identity check now applies only when database images and pod configuration are unchanged. If the default engine version or rendered pod spec changes, the agent expects unpinned clusters to roll: it checks for a normal rolling restart onto the new images with data intact, and that pinned clusters keep their images.

Comment thread .github/agents/release-agent.md Outdated
3. **Apply the new CRDs** with `kubectl apply --server-side --force-conflicts -f operator/documentdb-helm-chart/crds/`, and check that the old operator still works.
4. **`helm upgrade`** to the release-branch chart with `--set image.documentdbk8soperator.repository=localhost/documentdb-operator --set image.sidecarinjector.repository=localhost/documentdb-sidecar --set image.documentdbk8soperator.pullPolicy=Never --set image.sidecarinjector.pullPolicy=Never`.
5. **Verify**: the database pod UID is unchanged and has 0 restarts, the cluster is healthy, all data is intact, and the operator logs show no errors besides first-reconcile `object has been modified` retries. Create a new cluster with the current API version and do a read/write. If CRDs changed, check the webhook rejects an invalid change (for example a PVC shrink) through every served API version, and run any migration commands from the upgrade guide.
6. **Rollback**: `helm rollback documentdb-operator <first revision>` and check the previous operator still works against the new CRDs (existing clusters healthy, it can create a new cluster). Then roll forward again with `helm upgrade`.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 22fb046. The rollback step now runs helm history documentdb-operator -n documentdb-operator and then helm rollback documentdb-operator <first revision> -n documentdb-operator --wait.

Comment thread .github/agents/release-agent.md Outdated
4. **`helm upgrade`** to the release-branch chart with `--set image.documentdbk8soperator.repository=localhost/documentdb-operator --set image.sidecarinjector.repository=localhost/documentdb-sidecar --set image.documentdbk8soperator.pullPolicy=Never --set image.sidecarinjector.pullPolicy=Never`.
5. **Verify**: the database pod UID is unchanged and has 0 restarts, the cluster is healthy, all data is intact, and the operator logs show no errors besides first-reconcile `object has been modified` retries. Create a new cluster with the current API version and do a read/write. If CRDs changed, check the webhook rejects an invalid change (for example a PVC shrink) through every served API version, and run any migration commands from the upgrade guide.
6. **Rollback**: `helm rollback documentdb-operator <first revision>` and check the previous operator still works against the new CRDs (existing clusters healthy, it can create a new cluster). Then roll forward again with `helm upgrade`.
7. **Fresh install**: on a new kind cluster, `helm install` the release-branch chart and create a cluster with the current API version.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 22fb046. Cluster setup (create, load the local images, install cert-manager) is now a setup_kind function, and the image overrides are a shared LOCAL_IMAGES array. The fresh-install step runs setup_kind release-fresh and installs the release-branch chart with "${LOCAL_IMAGES[@]}".

Comment thread .github/agents/release-agent.md Outdated
curl -sfo /dev/null -w '%{http_code}\n' \
https://raw.githubusercontent.com/documentdb/documentdb-kubernetes-operator/X.Y.Z/operator/documentdb-helm-chart/crds/documentdb.io_dbs.yaml # 200
```
7. Set the repository variable `E2E_UPGRADE_PREVIOUS_VERSION` to `X.Y.Z`. The E2E control-plane upgrade spec (`test/e2e/tests/upgrade/upgrade_control_plane_test.go`) skips when it is unset; once set, it tests upgrades from this release.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, and the issue goes further: E2E_UPGRADE_CURRENT_CHART has to be the chart built by that CI run (a per-architecture artifact), so a repository variable cannot enable the spec. Fixed in 22fb046. I removed the advice to set E2E_UPGRADE_PREVIOUS_VERSION; Step 9 now says the control-plane upgrade spec is skipped in CI and a green E2E run is not chart-upgrade coverage (the Step 7 kind test is). The agent only counts CI coverage if the job log shows the spec ran, and flags the gap otherwise. Wiring the built chart into test-e2e.yml should be a separate change.

- Identify the upstream and fork remotes by URL and base everything on
  <upstream>/main instead of assuming origin is upstream.
- Kind test: share cluster setup and local-image overrides between the
  upgrade and fresh-install clusters, pass -n to helm rollback, and only
  require unchanged database pods when the release doesn't change the
  engine version or pod configuration.
- Post-merge: the control-plane upgrade E2E spec also needs
  E2E_UPGRADE_CURRENT_CHART, which CI leaves empty, so it is skipped;
  don't treat a green E2E run as chart-upgrade coverage.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 9f1a71b4-9969-4456-9f65-8d19dd550d8e
Signed-off-by: Rayhan Hossain <[email protected]>
@documentdb-triage-tool documentdb-triage-tool Bot added the documentation Improvements or additions to documentation label Nov 12, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: documentation
Project fields suggested: Component docs · Priority P2 · Effort L · Status Needs Review
Confidence: 0.95 (deterministic)

Reasoning

component from path globs (docs); effort from diff stats (206+316 LOC, 1 files)

If a label is wrong, ping @patty-chow so the rules can be tuned. Issues with component labels are left alone; PR component labels are reconciled from changed paths on every run.

@hossain-rayhan
hossain-rayhan merged commit f34c085 into documentdb:main Nov 13, 2026
1 check passed
hossain-rayhan added a commit to hossain-rayhan/documentdb-kubernetes-operator that referenced this pull request Nov 16, 2026
- Release date 2026-11-17.
- Add CHANGELOG entries for changes merged after the release PR was
  opened: OTel Collector outbound proxy (documentdb#476), documentdb_core upgraded
  with documentdb (documentdb#507), and stable documentation links and checks
  (documentdb#513, documentdb#514). documentdb#508 already added its own entry; documentdb#509 is internal.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 9f1a71b4-9969-4456-9f65-8d19dd550d8e
Signed-off-by: Rayhan Hossain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants