Skip to content

Show the v0.116-0 package layout across the site - #151

Merged
guanzhousongmicrosoft merged 3 commits into
documentdb:mainfrom
GuanzhouSong:fix/packages-page-0116
Aug 24, 2026
Merged

Show the v0.116-0 package layout across the site#151
guanzhousongmicrosoft merged 3 commits into
documentdb:mainfrom
GuanzhouSong:fix/packages-page-0116

Conversation

@GuanzhouSong

Copy link
Copy Markdown
Contributor

Problem

The package repository now serves the v0.116-0 multi-package layout (#149), but the site still described the world before it.

/packages was stale and, in one place, wrong.

  • Versions were hardcoded: 0.114-0 for the download examples and 0.113-0 for the repository examples. Both were wrong — the repository serves 0.116-0.
  • It generated apt install postgresql-N-documentdb for every target, so the new stack was unreachable from the page.
  • It stated "the published package repository does not currently include a gateway package, setup helper, or systemd service" — no longer true for Ubuntu 24.04 and RHEL 9.
  • It defaulted to Ubuntu 22.04 + PostgreSQL 16, which is the extension-only path, so a first-time visitor saw the older, smaller experience.

The Linux Packages Quick Start presented building the gateway from Rust source as the only route to a mongosh endpoint.

The underlying cause: packages/release-info.json is already published on every deployment and describes exactly which release is mirrored — and nothing read it.

Changes

Read the version instead of repeating it

New app/lib/releaseInfo.ts derives the DEB, RPM and meta-package versions from real asset filenames in the release feed, so the page cannot advertise a package shape the release does not contain. Each field falls back independently, and a compiled-in release covers the first paint and any fetch failure, so install commands are never blank.

Generate the right command per target

buildAptInstallCommand / buildRpmInstallCommand now resolve the per-major stand-alone (documentdb-18) on targets where v0.116-0 published the full set, and keep postgresql-N-documentdb everywhere else — offering documentdb-N on an extension-only target would be an install command that cannot resolve. PostgreSQL 16 stays on the extension command even on Tier-1, because v0.116-0 narrowed the stack to 17/18 and 16 resolves the older build.

Explain the packages

  • The five package roles, shown when the selected target serves them.
  • The documentdb-setup wizard, including that it prompts for a password — so servers and CI need --admin-password-stdin --yes.
  • Connecting with mongosh, and that it is not shipped by the packages.
  • A warning that the gateway binds all interfaces (0.0.0.0:10260) while the connect example says 127.0.0.1.
  • Verification, per-major systemd unit names (documentdb-local@18.target), ports, logs, upgrading and removal in the quick start.
  • Default the selector to Ubuntu 24.04 + PostgreSQL 18.

Stop it rotting again

check_release_drift.js fails the deployment when the fallback compiled into the bundle names a different release than the one being mirrored, or declares a version the release's assets contradict. It skips cleanly when there is no release-info.json (site-only builds, forks without packaging secrets).

Verification

Test Files  3 passed (3)
     Tests  130 passed (130)
  • tsc --noEmit clean, eslint app tests clean, next build prerenders /packages successfully.
  • Rendered /packages contains only 0.116-0 / 0.116.0 — no 0.113/0.114 remain — and the false "does not include a gateway package" sentence is gone.
  • The new strings (documentdb-setup, documentdb-postgresql-tools, the package table, the exposure warning) and the packages/release-info.json fetch are present in the client bundle.

The drift guard was verified to fail, not just to pass. Against the live feed it reports Release fallback matches the mirrored release (v0.116-0); simulating a mirror bump to v0.117-0 and, separately, an aptVersion of 0.114-0 each exit non-zero with a specific message.

8 pre-existing tests failed on the first run — exactly the Tier-1 combinations (ubuntu24/rhel9 × PG 17/18), which is the intended behaviour change. They now assert the correct package per target, plus a new case pinning full-stack vs extension-only.

Notes for reviewers

  • app/data/samples.ts and tsconfig.json are deliberately not in this diff: npm run build rewrites both (the samples compiler pulls the gallery, Next patches tsconfig), and neither is part of this change.
  • The documentdb/docs repository has its own stale package page; that is handled separately in Document the v0.116-0 package layout docs#67.
  • Blog build (build:blogs) is untested locally — it needs Ruby/bundler, which CI provides.

GuanzhouSong and others added 2 commits August 24, 2026 16:16
The package repository now serves the multi-package layout, but the site still
described the world before it. /packages hardcoded 0.114-0 (and 0.113-0 for the
repository examples), generated an extension-only install command for every
target, and stated that "the published package repository does not currently
include a gateway package, setup helper, or systemd service" -- which stopped
being true for Ubuntu 24.04 and RHEL 9. The Linux Packages Quick Start presented
building the gateway from Rust source as the only route to an endpoint.

Read the version from the release feed instead of repeating it. The deployment
already publishes packages/release-info.json describing the release it mirrors,
and nothing consumed it; that is why the page went stale in the first place. The
new module derives the DEB, RPM and meta-package versions from real asset
filenames, so the page cannot advertise a shape the release does not contain,
and falls back to a compiled-in release when the feed is unreachable so the
install commands are never blank.

Generate the install command per target. Tier-1 targets resolve the per-major
stand-alone, which pulls the extension, gateway, tools and documentdb-common;
everywhere else keeps the extension command, because offering `documentdb-N`
there would be an install command that cannot resolve. PostgreSQL 16 stays on
the extension command even on Tier-1, since v0.116-0 narrowed the stack to
PostgreSQL 17 and 18 and 16 resolves the older build.

Default the selector to Ubuntu 24.04 + PostgreSQL 18. It is the target the
release is built and end-to-end tested against; defaulting to Ubuntu 22.04 and
PostgreSQL 16 showed first-time visitors the extension-only experience.

Document what the packages actually do: the five package roles, the
documentdb-setup wizard (including that it prompts for a password, so servers
need --admin-password-stdin --yes), connecting with mongosh, verification, the
per-major systemd unit names, logs and ports, upgrading, and removal. Also warn
that the gateway binds all interfaces by default while the connect example says
127.0.0.1, and how to restrict it.

Add a drift check so this cannot silently rot again: when a deployment mirrors a
release, the fallback compiled into the bundle must name the same one.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8df9084a-ccaf-432c-b015-2ccd8893a9d8
A cold read-the-site-and-install run surfaced two things the earlier pass
missed.

`apt remove documentdb` does not remove DocumentDB. The meta package only
owns the dependency on the per-major package, so removing it leaves
documentdb-18, documentdb-common, documentdb-gateway and
documentdb-postgresql-tools installed -- verified: 5 packages before, 4 after.
Remove the per-major package too and let autoremove reap the shared payload.

The /packages hero and package catalog still taught the old model. The hero
offered ""Linux packages for PostgreSQL extension installs"" and said the
generated command installs ""the DocumentDB extension package"", and the catalog
listed only the `postgresql-<pg>-documentdb` naming against a flat
distribution list. A visitor who read only the static part of that page would
conclude the extension package is all there is, which is exactly the
misunderstanding the release needs to clear up. Both now distinguish the
full-stack targets from the extension-only ones.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8df9084a-ccaf-432c-b015-2ccd8893a9d8
…source build

A second cold read-the-site-and-install run found three things.

The documented uninstall left a running, network-exposed database behind.
Verified on a clean container: after `apt remove --autoremove documentdb
documentdb-18`, apt reports `Package 'documentdb' is not installed` (the meta
is never pulled by installing `documentdb-18`), `postgresql-18-documentdb`
is still `ii` installed with its .so and .control files on disk, the other
four packages are left in `rc` state with their config, and -- because
package removal does not stop a service -- the gateway is still listening on
0.0.0.0:10260 and still answering queries. `apt purge --autoremove
documentdb-18 postgresql-18-documentdb` leaves nothing behind, so document
that, and tell people to stop the stack first.

The landing page told full-stack users to build the gateway from source: ""Linux
packages install the PostgreSQL extension; the Linux package guide adds the
extra source-gateway steps needed when you want a host install that still
exposes a MongoDB-compatible endpoint."" On Ubuntu 24.04 and RHEL 9 the gateway
is packaged and `documentdb-setup` starts it, so that sends people off to
build a Rust project they do not need.

The connection URI had no note about percent-encoding, so a password containing
`@` silently misparses. Add the note and the flag-based form that avoids the
problem entirely.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 8df9084a-ccaf-432c-b015-2ccd8893a9d8
@GuanzhouSong

Copy link
Copy Markdown
Contributor Author

Validation: two cold read-the-site-and-install runs

This branch was validated twice by a tester with no prior DocumentDB knowledge, allowed to use only the pages this PR builds, installing from the real documentdb.io repository on clean ubuntu:24.04 and rockylinux:9 containers.

Round 1 — 3/5. Installed and queried successfully on both distributions, and every runtime claim verified: versions, the 0.0.0.0:10260 gateway vs 127.0.0.1:9718 PostgreSQL split, log and config paths, the no-systemd nohup fallback, and the db.version() → 7.0.0 caveat. Two real defects found and fixed in 199afa7:

  • apt remove documentdb removed nothing useful — reproduced as 5 packages before, 4 after.
  • The static text on /packages still taught the extension-only model ("Linux packages for PostgreSQL extension installs", and a catalog listing only postgresql-<pg>-documentdb).

Round 2 — 4/5. The tester could now correctly answer, before installing, what the five packages are, that documentdb-18 is the right one for Ubuntu 24.04 + PG 18, and that documentdb-setup is required afterwards — all from the page, none inferred. Three more defects, fixed in 463e607:

  1. The uninstall left a live, exposed database. Verified: apt remove --autoremove documentdb documentdb-18 reports Package 'documentdb' is not installed (installing documentdb-18 never pulls the meta), leaves postgresql-18-documentdb ii installed with its .so/.control on disk, leaves the other four in rc with config, and — since package removal does not stop a service — the gateway was still listening on 0.0.0.0:10260 and still answering {ok:1}. Now documents stopping the stack first and apt purge --autoremove documentdb-18 postgresql-18-documentdb, verified to leave 0 packages and no files.
  2. The landing page sent full-stack users to a source build — it claimed the packages install only the extension and that the guide "adds the extra source-gateway steps". On Ubuntu 24.04/RHEL 9 the gateway is packaged and documentdb-setup starts it.
  3. No percent-encoding note on the connection URI, so a password containing @ silently misparses. Added, plus the flag-based form that sidesteps it.

Remaining known gap, not addressed here: without JavaScript /packages shows no copy-pasteable APT/RPM command (only the Docker one is inline), so a visitor must reach the Quick Start for the install command.

@guanzhousongmicrosoft
guanzhousongmicrosoft merged commit d83cc3e into documentdb:main Aug 24, 2026
2 checks passed
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