diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7d1da68..18dc3b6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -96,9 +96,9 @@ jobs: run: | sudo apt-get update sudo apt-get install -y createrepo-c dpkg-dev rpm python3 - - name: Generate repository from v1.0-0 + - name: Generate repository from v1.2-0 env: - DOCUMENTDB_VERSION: v1.0-0 + DOCUMENTDB_VERSION: v1.2-0 run: .github/scripts/download_packages.sh - name: Verify release inventory and metadata run: python3 .github/scripts/verify_package_inventory.py diff --git a/PACKAGE-INSTALL.md b/PACKAGE-INSTALL.md index 85c7c19..b622ff7 100644 --- a/PACKAGE-INSTALL.md +++ b/PACKAGE-INSTALL.md @@ -2,7 +2,7 @@ Repository-backed installation commands for DocumentDB. -> This repository serves v1.0-0. +> This repository serves v1.2-0. ## Clean-host installer @@ -13,9 +13,9 @@ curl -fsSLo documentdb-install.sh https://documentdb.io/install.sh && sudo sh documentdb-install.sh ``` -This installs v1.0-0 from this repository on PostgreSQL 18; add `--pg-major 17` +This installs v1.2-0 from this repository on PostgreSQL 18; add `--pg-major 17` for 17. On a host where DocumentDB is already set up, it only reports that instance's status -and doesn't upgrade it; to move an existing install to 1.0, see +and doesn't upgrade it; to move an existing install to 1.2, see [Upgrading an existing install](#upgrading-an-existing-install). The site serves the `install.sh` attached to the release named in @@ -225,7 +225,7 @@ Before using this anywhere but a private machine: ```bash sudo documentdb-setup --status # gateway listener, service states, resolved paths -documentdb-gateway --version # DocumentDB version (1.0.0) +documentdb-gateway --version # DocumentDB version (1.2.0) dpkg -l | grep documentdb # or: rpm -qa | grep documentdb ``` @@ -368,9 +368,11 @@ The current release publishes PostgreSQL 17 and 18. Install `documentdb-17` or ## Upgrading an existing install -Package installs from v0.116 or v0.117 upgrade in place to 1.0. Move the entire stack +Package installs from 1.0.0 upgrade in place to 1.2. Move the entire stack together; upgrading only `postgresql-N-documentdb` does not update the gateway, tools, common payload, or `documentdb-N`. These steps use systemd; upgrading a host without it isn't covered here. +There is no downgrade: an older release starts on the updated catalog, but some commands then fail, +so back up the data directory first if you may need to go back. On a package-managed private PostgreSQL 18 instance: > **Warning:** A host that ran a 1.0 release candidate (RC1 or RC2) has no upgrade path. Use a @@ -391,18 +393,17 @@ sudo dnf upgrade documentdb-18 postgresql18-documentdb \ documentdb-common documentdb-gateway documentdb-postgresql-tools ``` -Upgrading the packages does not update the database catalog. The simplest way is to restart -PostgreSQL so it loads the new libraries, then re-run setup with the options you installed with. -Setup updates the extensions and then starts the gateway: +Upgrading the packages does not update the database catalog. Re-run setup with the PostgreSQL +major, plus any `--data-dir` or `--pg-port` you installed with. It restarts PostgreSQL once to +load the new libraries, updates the extensions, and then starts the gateway: ```bash -sudo systemctl restart documentdb-postgresql@18.service && -sudo documentdb-setup --pg-version 18 --use-new-postgres-instance --admin-user admin +sudo documentdb-setup --pg-version 18 --yes ``` -Setup adds any missing `shared_preload_libraries` entries and updates the extensions, but only in -the `postgres` database. If your gateway uses another database, take the manual route below. It also asks for the admin password and sets it on the existing admin -user: enter the current password to keep it. +Without `--admin-user`, setup asks for no password and keeps every admin user and password as +they are. It adds any missing `shared_preload_libraries` entries and updates the extensions, but only in +the `postgres` database. If your gateway uses another database, take the manual route below. To update by hand, or for every other database that has DocumentDB installed, first check that the extended RUM library is preloaded: @@ -411,7 +412,7 @@ the extended RUM library is preloaded: sudo -u documentdb-local psql -h /run/documentdb-local/18/postgresql -p 9718 -d postgres -X -Atc "SHOW shared_preload_libraries;" ``` -If `pg_documentdb_extended_rum` is missing (possible on a 0.116 install), add it before updating; +If `pg_documentdb_extended_rum` is missing (possible on a host first set up with 0.116), add it before updating; the update below would succeed without it, and index builds would fail later. If the gateway uses `postgres`, re-run setup as above. If it uses another database, add the library to `shared_preload_libraries` in the instance's `postgresql.conf` yourself: setup would point the @@ -439,12 +440,11 @@ On a host with both PostgreSQL 17 and 18, `documentdb-common`, `documentdb-gatew (`documentdb-gateway-local@17.service` and `@18.service`) before upgrading, then update each major. For an adopted PostgreSQL instance, setup never restarts PostgreSQL. Stop the gateway -(`documentdb-gateway-local@18.service`) before upgrading, restart the operator-managed PostgreSQL -service yourself, then re-run -`documentdb-setup --pg-version 18 --target-postgres-instance 18/main --admin-user admin` (with your cluster name); it -updates the extensions and then starts the gateway. If -setup has to change `shared_preload_libraries`, it exits without updating the extensions: restart -PostgreSQL and run it once more. By hand, use that instance's own `psql` connection. +(`documentdb-gateway-local@18.service`) before upgrading, then run +`sudo documentdb-setup --target-postgres-instance 18/main --yes` (with your cluster name). It +prints the command that restarts your PostgreSQL service and the setup command to run after it, +then exits without updating the extensions. Run both; the second run updates the extensions and +starts the gateway. By hand, use that instance's own `psql` connection. Confirm afterwards with: @@ -479,17 +479,17 @@ published in the documentdb.io package repositories. Community builds are welcom For example, after checking out the matching release tag, build an extension package with: ```bash -./packaging/build_packages.sh --os deb12 --pg 16 --version 1.0.0 +./packaging/build_packages.sh --os deb12 --pg 16 --version 1.2.0 ``` -`v1.0-0` and `v1.0-RC2` are on the same commit, so pass `--version`; without it the scripts can build RC-versioned packages. That command builds only `postgresql-N-documentdb`. A custom full-stack package set uses +Without `--version`, the script takes the version from the checked-out release tag, or else from the control file; at `v1.2-0` both give 1.2.0. That command builds only `postgresql-N-documentdb`. A custom full-stack package set uses three entry points: - `packaging/build_packages.sh` — PostgreSQL extension - `packaging/gateway/build_gateway_packages.sh` — wire-protocol gateway - `packaging/build_extra_packages.sh` — tools, common payload, `documentdb-N`, and meta package -The [v1.0 packaging guide](https://github.com/documentdb/documentdb/blob/v1.0-0/packaging/README.md) +The [v1.2 packaging guide](https://github.com/documentdb/documentdb/blob/v1.2-0/packaging/README.md) documents their required arguments, version formats, prerequisites, and accepted targets. PostgreSQL 15 remains extension-only for package-managed installs because the setup tools require PostgreSQL 16 or newer. @@ -504,9 +504,9 @@ they do not retain packages from older releases. Examples: ```text -ubuntu24.04-documentdb_1.0.0_all.deb -ubuntu24.04-postgresql-18-documentdb_1.0-0_amd64.deb -rhel9-postgresql18-documentdb-1.0.0-1.el9.x86_64.rpm +ubuntu24.04-documentdb_1.2.0_all.deb +ubuntu24.04-postgresql-18-documentdb_1.2-0_amd64.deb +rhel9-postgresql18-documentdb-1.2.0-1.el9.x86_64.rpm ``` For a full stack, pass the five packages for the selected PostgreSQL major to one command: diff --git a/app/lib/releaseInfo.ts b/app/lib/releaseInfo.ts index 52e45f6..0bddc09 100644 --- a/app/lib/releaseInfo.ts +++ b/app/lib/releaseInfo.ts @@ -36,12 +36,12 @@ export type ReleaseInfo = { // A reference release, not evidence of current repository availability. export const FALLBACK_RELEASE: ReleaseInfo = { - tagName: "v1.0-0", - aptVersion: "1.0-0", - rpmVersion: "1.0.0-1.el9", - metaVersion: "1.0.0", - metaRpmVersion: "1.0.0-1", - releaseUrl: "https://github.com/documentdb/documentdb/releases/tag/v1.0-0", + tagName: "v1.2-0", + aptVersion: "1.2-0", + rpmVersion: "1.2.0-1.el9", + metaVersion: "1.2.0", + metaRpmVersion: "1.2.0-1", + releaseUrl: "https://github.com/documentdb/documentdb/releases/tag/v1.2-0", assetNames: [], }; diff --git a/app/services/articleService.ts b/app/services/articleService.ts index 36bbad9..856ddaa 100644 --- a/app/services/articleService.ts +++ b/app/services/articleService.ts @@ -32,7 +32,7 @@ const virtualSections: Record [!NOTE] -> The DocumentDB Local image sends usage telemetry by default. To turn it off, add \`-e DOCUMENTDB_USAGE_TELEMETRY=false\` before the image name. See [Usage telemetry](/docs/documentdb-local#usage-telemetry) and the [privacy statement](https://github.com/documentdb/documentdb/blob/v1.0-0/documentdb-local/PRIVACY.md).`; +> The DocumentDB Local image sends usage telemetry by default. To turn it off, add \`-e DOCUMENTDB_USAGE_TELEMETRY=false\` before the image name. See [Usage telemetry](/docs/documentdb-local#usage-telemetry) and the [privacy statement](https://github.com/documentdb/documentdb/blob/v1.2-0/documentdb-local/PRIVACY.md).`; const dockerGuideContent = `# Docker Quick Start @@ -73,7 +73,7 @@ ${documentdbLocalTelemetryNote} > \`--init-data true\` seeds the built-in sample data into \`StoreData\`, which the > verification step below queries. It is **not** enabled by default — without it the > container starts with no \`StoreData\` database and \`use StoreData\` returns nothing. The data is -> seeded once per data volume. Existing volumes are not migrated automatically; +> seeded once per data volume. Existing volumes keep the sample data they were seeded with; > re-create the volume to seed again. See > [DocumentDB Local](/docs/documentdb-local) for \`--init-data-path\`, certificate setup, > and additional runtime options. @@ -161,10 +161,13 @@ Until you remove it, re-running \`docker run --name documentdb\` fails with \`Conflict. The container name "/documentdb" is already in use\`. Mount a named volume (\`-v documentdb-data:/data\`) before storing anything you want to keep. -A newer image on an existing data volume does not update the DocumentDB schema in that -volume ([documentdb#773](https://github.com/documentdb/documentdb/issues/773)). To move data -from an earlier release or a 1.0 release candidate to 1.0, start the 1.0 image on a new -volume and reload your data, for example with \`mongodump\` and \`mongorestore\`. +From 1.2, the image updates the DocumentDB extensions on an existing 1.0 or later data volume +when it starts, and logs \`Updating the DocumentDB extensions on this data volume\`. If the +update fails, it is rolled back and the container exits with the volume unchanged. This only +goes forward: an older image starts on the updated volume, but some commands then fail, so back +up the volume first if you may need to go back. To move data from a release before 1.0 or a 1.0 +release candidate, start the image on a new volume and reload your data, for example with +\`mongodump\` and \`mongorestore\`. ## Troubleshooting and debugging @@ -196,10 +199,10 @@ The current official release publishes the full stack — extension, gateway, se **Recommended:** install the complete stack, then create a new private PostgreSQL 18 instance. The commands detect architecture on the Linux host where you run them. For containers or macOS/Windows evaluation, choose [Docker installation](/packages?method=docker). > [!IMPORTANT] -> Already running v0.116 or v0.117 from packages? Follow [Upgrading](/docs/linux-packages#upgrading) instead of installing again. Hosts that ran a 1.0 release candidate have no upgrade path; use a clean host. Removing packages preserves database files; reinstalling is not a data reset. +> Already running 1.0 from packages? Follow [Upgrading](/docs/linux-packages#upgrading) instead of installing again. Hosts that ran a 1.0 release candidate have no upgrade path; use a clean host. Removing packages preserves database files; reinstalling is not a data reset. > [!NOTE] -> Need another distribution or PostgreSQL major? We welcome community builds. Check out the \`v1.0-0\` tag, pass \`--version 1.0.0\`, and use the version-parameterized [packaging scripts](https://github.com/documentdb/documentdb/blob/v1.0-0/packaging/README.md). \`build_packages.sh\` builds the extension, \`gateway/build_gateway_packages.sh\` builds the gateway, and \`build_extra_packages.sh\` builds the common, tools, stand-alone, and meta packages. PostgreSQL 15 is extension-only because the setup tools require PostgreSQL 16 or newer. These builds are on demand and are not official release assets hosted by documentdb.io. +> Need another distribution or PostgreSQL major? We welcome community builds. Check out the \`v1.2-0\` tag, pass \`--version 1.2.0\`, and use the version-parameterized [packaging scripts](https://github.com/documentdb/documentdb/blob/v1.2-0/packaging/README.md). \`build_packages.sh\` builds the extension, \`gateway/build_gateway_packages.sh\` builds the gateway, and \`build_extra_packages.sh\` builds the common, tools, stand-alone, and meta packages. PostgreSQL 15 is extension-only because the setup tools require PostgreSQL 16 or newer. These builds are on demand and are not official release assets hosted by documentdb.io. You do not need PostgreSQL already installed — the setup wizard creates and manages its own instance. The install does add the PGDG repository and pull PostgreSQL, PostGIS and around 160 packages (about 140 MB), so pick a host you are willing to have PGDG on. @@ -212,8 +215,8 @@ curl -fsSLo documentdb-install.sh https://documentdb.io/install.sh && sudo sh documentdb-install.sh \`\`\` -This installs the current release (v1.0-0) from the package repository on PostgreSQL 18; add \`--pg-major 17\` for 17. -On a host where DocumentDB is already set up, the installer only reports its status and doesn't upgrade it; to move an existing install to 1.0, follow [Upgrading](/docs/linux-packages#upgrading). +This installs the current release (v1.2-0) from the package repository on PostgreSQL 18; add \`--pg-major 17\` for 17. +On a host where DocumentDB is already set up, the installer only reports its status and doesn't upgrade it; to move an existing install to 1.2, follow [Upgrading](/docs/linux-packages#upgrading). ## Install @@ -417,7 +420,7 @@ Use the extension package for your PostgreSQL major: \`postgresql-N-documentdb\` or \`postgresqlN-documentdb\` on EL9. You own PostgreSQL configuration, extension activation, and service restarts. Create \`documentdb_extended_rum\` as well as \`documentdb\`: \`CREATE EXTENSION documentdb CASCADE\` does not pull it in, and without it every index -creation fails. Follow the matching release's [manual package instructions](https://github.com/documentdb/documentdb/blob/v1.0-0/packaging/README.md), +creation fails. Follow the matching release's [manual package instructions](https://github.com/documentdb/documentdb/blob/v1.2-0/packaging/README.md), or the [extension-only offline instructions](/docs/linux-packages/offline#smaller-offline-cases) when PostgreSQL and all extension dependencies are already installed. @@ -438,9 +441,11 @@ For an adopted instance, use the operator's existing PostgreSQL connection inste ## Upgrading -Package installs from v0.116 or v0.117 upgrade in place to 1.0. Move the entire stack +Package installs from 1.0.0 upgrade in place to 1.2. Move the entire stack together; upgrading only \`postgresql-N-documentdb\` does not update the gateway, tools, common payload, or \`documentdb-N\`. These steps use systemd; upgrading a host without it isn't covered here. +There is no downgrade: an older release starts on the updated catalog, but some commands then fail, +so back up the data directory first if you may need to go back. On a package-managed private PostgreSQL 18 instance: > [!WARNING] @@ -463,18 +468,17 @@ sudo dnf upgrade documentdb-18 postgresql18-documentdb \\ documentdb-common documentdb-gateway documentdb-postgresql-tools \`\`\` -Upgrading the packages does not update the database catalog. The simplest way is to restart -PostgreSQL so it loads the new libraries, then re-run setup with the options you installed with. -Setup updates the extensions and then starts the gateway: +Upgrading the packages does not update the database catalog. Re-run setup with the PostgreSQL +major, plus any \`--data-dir\` or \`--pg-port\` you installed with. It restarts PostgreSQL once to +load the new libraries, updates the extensions, and then starts the gateway: \`\`\`bash -sudo systemctl restart documentdb-postgresql@18.service && -sudo documentdb-setup --pg-version 18 --use-new-postgres-instance --admin-user admin +sudo documentdb-setup --pg-version 18 --yes \`\`\` -Setup adds any missing \`shared_preload_libraries\` entries and updates the extensions, but only in -the \`postgres\` database. If your gateway uses another database, take the manual route below. It also asks for the admin password and sets it on the existing admin -user: enter the current password to keep it. +Without \`--admin-user\`, setup asks for no password and keeps every admin user and password as +they are. It adds any missing \`shared_preload_libraries\` entries and updates the extensions, but only in +the \`postgres\` database. If your gateway uses another database, take the manual route below. To update by hand, or for every other database that has DocumentDB installed, first check that the extended RUM library is preloaded: @@ -483,7 +487,7 @@ the extended RUM library is preloaded: sudo -u documentdb-local psql -h /run/documentdb-local/18/postgresql -p 9718 -d postgres -X -Atc "SHOW shared_preload_libraries;" \`\`\` -If \`pg_documentdb_extended_rum\` is missing (possible on a 0.116 install), add it before updating; +If \`pg_documentdb_extended_rum\` is missing (possible on a host first set up with 0.116), add it before updating; the update below would succeed without it, and index builds would fail later. If the gateway uses \`postgres\`, re-run setup as above. If it uses another database, add the library to \`shared_preload_libraries\` in the instance's \`postgresql.conf\` yourself: setup would point the @@ -511,12 +515,11 @@ On a host with both PostgreSQL 17 and 18, \`documentdb-common\`, \`documentdb-ga (\`documentdb-gateway-local@17.service\` and \`@18.service\`) before upgrading, then update each major. For an adopted PostgreSQL instance, setup never restarts PostgreSQL. Stop the gateway -(\`documentdb-gateway-local@18.service\`) before upgrading, restart the operator-managed PostgreSQL -service yourself, then re-run -\`documentdb-setup --pg-version 18 --target-postgres-instance 18/main --admin-user admin\` (with your cluster name); it -updates the extensions and then starts the gateway. If -setup has to change \`shared_preload_libraries\`, it exits without updating the extensions: restart -PostgreSQL and run it once more. By hand, use that instance's own \`psql\` connection. +(\`documentdb-gateway-local@18.service\`) before upgrading, then run +\`sudo documentdb-setup --target-postgres-instance 18/main --yes\` (with your cluster name). It +prints the command that restarts your PostgreSQL service and the setup command to run after it, +then exits without updating the extensions. Run both; the second run updates the extensions and +starts the gateway. By hand, use that instance's own \`psql\` connection. ## Remove or reset @@ -699,7 +702,7 @@ Then continue with [Set up and connect](/docs/getting-started/packages#set-up-an If the target already has PostgreSQL, the PGDG extension dependencies (\`postgresql-N-cron\`, \`-pgvector\`, \`-postgis-3\`) and \`jq\`, you do not need a bundle: -- **Extension only, one file** — \`sudo apt install ./ubuntu24.04-postgresql-18-documentdb_1.0-0_amd64.deb\`. No gateway and no \`documentdb-setup\`. +- **Extension only, one file** — \`sudo apt install ./ubuntu24.04-postgresql-18-documentdb_1.2-0_amd64.deb\`. No gateway and no \`documentdb-setup\`. - **Full stack from the release assets** — pass the five packages for the selected PostgreSQL major to a *single* \`apt install\` / \`dnf install\`: \`documentdb-N\`, the matching \`postgresql-N-documentdb\` / \`postgresqlN-documentdb\` extension, \`documentdb-common\`, \`documentdb-gateway\`, and \`documentdb-postgresql-tools\`. For PostgreSQL 18 only, the optional \`documentdb\` meta package may be included; it selects \`documentdb-18\`. Local files resolve dependencies only against enabled repositories, so a package whose dependencies are not included still fails. `; @@ -1528,7 +1531,7 @@ function updatePrebuiltPackagesContent(content: string): string { const legacyClaim = 'Everything else — PostgreSQL 15/16, Debian 11/12/13, Ubuntu 22.04, RHEL-compatible 8 — is not built by first-party CI for this release. The [package repository](https://documentdb.io/packages) serves those targets the extension package from an earlier release, or build from the tag with the scripts in [`packaging/`](https://github.com/documentdb/documentdb/blob/main/packaging/README.md). PostgreSQL 15 is extension-only: `documentdb-setup` needs 16 or newer.'; const currentPolicy = - 'Everything else — PostgreSQL 15/16, Debian 11/12/13, Ubuntu 22.04, RHEL-compatible 8 — is not built by first-party CI or hosted by documentdb.io for this release. Starting with v0.116, packages from earlier releases are not carried forward. Build from the matching tag with the [`packaging/` scripts](https://github.com/documentdb/documentdb/blob/v1.0-0/packaging/README.md); PostgreSQL 15 remains extension-only because `documentdb-setup` requires 16 or newer.'; + 'Everything else — PostgreSQL 15/16, Debian 11/12/13, Ubuntu 22.04, RHEL-compatible 8 — is not built by first-party CI or hosted by documentdb.io for this release. Starting with v0.116, packages from earlier releases are not carried forward. Build from the matching tag with the [`packaging/` scripts](https://github.com/documentdb/documentdb/blob/v1.2-0/packaging/README.md); PostgreSQL 15 remains extension-only because `documentdb-setup` requires 16 or newer.'; return content.replace(legacyClaim, currentPolicy); } diff --git a/app/services/externalLinks.ts b/app/services/externalLinks.ts index eaafb4a..79885da 100644 --- a/app/services/externalLinks.ts +++ b/app/services/externalLinks.ts @@ -26,4 +26,4 @@ export const documentdbReleaseAnnouncementUrl = '/blogs/posts/documentdb-1-0/'; export const documentdbReleasePageUrl = '/v1/'; export const documentdbLocalPrivacyUrl = - 'https://github.com/documentdb/documentdb/blob/v1.0-0/documentdb-local/PRIVACY.md'; + 'https://github.com/documentdb/documentdb/blob/v1.2-0/documentdb-local/PRIVACY.md'; diff --git a/tests/installSelection.test.ts b/tests/installSelection.test.ts index 4ede569..20af7b7 100644 --- a/tests/installSelection.test.ts +++ b/tests/installSelection.test.ts @@ -116,16 +116,16 @@ describe("install selection links", () => { describe("published package availability", () => { const assetNames = [ ...["documentdb-18", "documentdb-common", "documentdb-postgresql-tools"].flatMap((name) => [ - `ubuntu24.04-${name}_1.0.0_all.deb`, - `${name}-1.0.0-1.noarch.rpm`, + `ubuntu24.04-${name}_1.2.0_all.deb`, + `${name}-1.2.0-1.noarch.rpm`, ]), ...["amd64", "arm64"].flatMap((arch) => [ - `ubuntu24.04-documentdb-gateway_1.0.0_${arch}.deb`, - `ubuntu24.04-postgresql-18-documentdb_1.0-0_${arch}.deb`, + `ubuntu24.04-documentdb-gateway_1.2.0_${arch}.deb`, + `ubuntu24.04-postgresql-18-documentdb_1.2-0_${arch}.deb`, ]), ...["x86_64", "aarch64"].flatMap((arch) => [ - `documentdb-gateway-1.0.0-1.el9.${arch}.rpm`, - `rhel9-postgresql18-documentdb-1.0.0-1.el9.${arch}.rpm`, + `documentdb-gateway-1.2.0-1.el9.${arch}.rpm`, + `rhel9-postgresql18-documentdb-1.2.0-1.el9.${arch}.rpm`, ]), ]; const release = { ...FALLBACK_RELEASE, assetNames }; @@ -151,7 +151,7 @@ describe("published package availability", () => { expect(releaseHasPackages(partial, defaultInstallSelection.packages)).toBe(false); }); - it.each([null, {}, { tag_name: "v1.0-0", assets: [] }, { tag_name: "../other", assets: [] }])( + it.each([null, {}, { tag_name: "v1.2-0", assets: [] }, { tag_name: "../other", assets: [] }])( "surfaces malformed or incomplete metadata instead of inventing current versions", (payload) => { expect(() => parseReleaseInfo(payload)).toThrow(); diff --git a/tests/packageArticles.test.ts b/tests/packageArticles.test.ts index af1a9e9..6b73908 100644 --- a/tests/packageArticles.test.ts +++ b/tests/packageArticles.test.ts @@ -298,9 +298,9 @@ describe('Linux package articles', () => { it('serves the stable installer without a pinned or RC version', () => { expect(linuxPackagesGuideContent).toContain('https://documentdb.io/install.sh'); - expect(linuxPackagesGuideContent).toContain('installs the current release (v1.0-0) from the package repository'); - // install.sh rejects --version v1.0-0, and RCs are retired at GA. - expect(linuxPackagesGuideContent).not.toContain('--version v1.0'); + expect(linuxPackagesGuideContent).toContain('installs the current release (v1.2-0) from the package repository'); + // install.sh rejects --version v1.2-0, and RCs are retired at GA. + expect(linuxPackagesGuideContent).not.toMatch(/--version v1\./); expect(linuxPackagesGuideContent).not.toMatch(/RC2|release-candidate/); }); @@ -308,13 +308,13 @@ describe('Linux package articles', () => { const offlineGuide = getArticleByPath('linux-packages', ['offline']); expect(linuxPackagesGuideContent).toContain( - 'documentdb/blob/v1.0-0/packaging/README.md', + 'documentdb/blob/v1.2-0/packaging/README.md', ); expect(linuxPackagesGuideContent).toContain( '`--load-sample-data` to the setup command to seed the `StoreData` database', ); expect(offlineGuide?.content).toContain( - 'ubuntu24.04-postgresql-18-documentdb_1.0-0_amd64.deb', + 'ubuntu24.04-postgresql-18-documentdb_1.2-0_amd64.deb', ); expect(offlineGuide?.content).toContain( 'pass the five packages for the selected PostgreSQL major', @@ -388,9 +388,15 @@ describe('Linux package articles', () => { '41,505 documents in `stores` and 2 documents in `ratings`', ); expect(dockerGuide?.content).toContain( - 'Existing volumes are not migrated automatically', + 'Existing volumes keep the sample data they were seeded with', ); expect(dockerGuide?.content).not.toContain('use sampledb'); + // The 1.2 image updates the extensions on a 1.0 or later volume at start, one way. + expect(dockerGuide?.content).toContain( + 'the image updates the DocumentDB extensions on an existing 1.0 or later data volume', + ); + expect(dockerGuide?.content).toContain('This only\ngoes forward'); + expect(dockerGuide?.content).not.toContain('does not update the DocumentDB schema'); const { readFile } = await import('node:fs/promises'); const { fileURLToPath } = await import('node:url'); @@ -589,9 +595,13 @@ describe('manual extension upgrade SQL', () => { // Setup repoints the gateway at `postgres`, so a gateway on another database must not re-run it. expect(text).toMatch(/If your gateway uses another database, take the manual route below\./); expect(text).toMatch(/If it uses another database, add the library to\s+`shared_preload_libraries`[\s\S]*?setup would point the\s+gateway back at `postgres`/); - // Restarting the whole target would start the gateway before setup updates the extensions. - expect(text).toMatch(/restart documentdb-postgresql@18\.service &&\nsudo documentdb-setup/); + // Setup restarts PostgreSQL itself; restarting the target first would start the gateway on the old catalog. + expect(text).toContain('```bash\nsudo documentdb-setup --pg-version 18 --yes\n```'); expect(text).not.toMatch(/restart documentdb-local@18\.target &&\nsudo documentdb-setup/); + // Without --admin-user the re-run keeps the admin passwords; with it, setup resets that user's. + const upgrading = text.match(/^## Upgrading.*$[\s\S]*?(?=^## )/m)?.[0]; + expect(upgrading).toContain('sudo documentdb-setup --target-postgres-instance 18/main --yes'); + expect(upgrading).not.toMatch(/documentdb-setup[^\n]*--admin-user/); }); }); diff --git a/tests/packageInstall.test.ts b/tests/packageInstall.test.ts index 7f20d37..ee388cd 100644 --- a/tests/packageInstall.test.ts +++ b/tests/packageInstall.test.ts @@ -79,33 +79,33 @@ describe('package metadata', () => { }); describe('release metadata', () => { - it('uses v1.0-0 for the first paint and feed fallback', () => { + it('uses v1.2-0 for the first paint and feed fallback', () => { expect(FALLBACK_RELEASE).toMatchObject({ - tagName: 'v1.0-0', - aptVersion: '1.0-0', - rpmVersion: '1.0.0-1.el9', - metaVersion: '1.0.0', - metaRpmVersion: '1.0.0-1', - releaseUrl: 'https://github.com/documentdb/documentdb/releases/tag/v1.0-0', + tagName: 'v1.2-0', + aptVersion: '1.2-0', + rpmVersion: '1.2.0-1.el9', + metaVersion: '1.2.0', + metaRpmVersion: '1.2.0-1', + releaseUrl: 'https://github.com/documentdb/documentdb/releases/tag/v1.2-0', }); }); - it('derives v1.0 package versions from the published asset shapes', () => { + it('derives v1.2 package versions from the published asset shapes', () => { expect(parseReleaseInfo({ - tag_name: 'v1.0-0', - html_url: 'https://github.com/documentdb/documentdb/releases/tag/v1.0-0', + tag_name: 'v1.2-0', + html_url: 'https://github.com/documentdb/documentdb/releases/tag/v1.2-0', assets: [ - { name: 'ubuntu24.04-documentdb_1.0.0_all.deb' }, - { name: 'ubuntu24.04-postgresql-18-documentdb_1.0-0_amd64.deb' }, - { name: 'documentdb-1.0.0-1.noarch.rpm' }, - { name: 'rhel9-postgresql18-documentdb-1.0.0-1.el9.x86_64.rpm' }, + { name: 'ubuntu24.04-documentdb_1.2.0_all.deb' }, + { name: 'ubuntu24.04-postgresql-18-documentdb_1.2-0_amd64.deb' }, + { name: 'documentdb-1.2.0-1.noarch.rpm' }, + { name: 'rhel9-postgresql18-documentdb-1.2.0-1.el9.x86_64.rpm' }, ], })).toMatchObject({ - tagName: 'v1.0-0', - aptVersion: '1.0-0', - rpmVersion: '1.0.0-1.el9', - metaVersion: '1.0.0', - metaRpmVersion: '1.0.0-1', + tagName: 'v1.2-0', + aptVersion: '1.2-0', + rpmVersion: '1.2.0-1.el9', + metaVersion: '1.2.0', + metaRpmVersion: '1.2.0-1', }); }); });