Skip to content

Conversation

@samrose
Copy link
Collaborator

@samrose samrose commented Feb 3, 2026

a build of postgres with just the latest extension version and postgres itself

Summary by CodeRabbit

  • New Features

    • Slim PostgreSQL package variants for smaller container images.
    • Optional "latest-only" build mode for many PostgreSQL extensions to produce single-version builds.
  • Chores

    • Updated PostgreSQL version identifiers to include slim build metadata.

@samrose samrose requested review from a team as code owners February 3, 2026 21:04
@samrose samrose requested a review from LGUG2Z February 3, 2026 21:04
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

This change set adds a new boolean input latestOnly ? false across many Nix extension derivations and the postgres packaging code, and wires it through build logic to allow building only the latest PostgreSQL/extension versions (versionsToUse, versionsBuilt, numberOfVersionsBuilt). Packages, postBuild checks, and passthru metadata (versions, numberOfVersions, version, latestOnly) are adjusted to reflect latest-only mode. postgres packaging gains slim variants (latestOnly=true) with minimal locales and systemd disabled. ansible/vars.yml updates three Postgres release strings by appending "-slim-1".

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

nix, extensions, infrastructure

Suggested reviewers

  • LGUG2Z
  • hunleyd
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is minimal and vague, providing only a single sentence that lacks specific details about what changes are made or how they work. Expand the description to follow the template structure: explain what changes are made, why they're needed, how the latestOnly flag works, and provide examples of the new slim build outputs.
Title check ❓ Inconclusive The title 'slim builds for postgres versions just latest extension' is somewhat vague and grammatically awkward, using non-standard phrasing that doesn't clearly convey the core change. Revise to a clearer title such as 'Add slim PostgreSQL builds with only latest extension versions' or 'Introduce latestOnly flag for minimal PostgreSQL extension builds'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch slim-build

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
nix/ext/plpgsql-check.nix (1)

128-136: ⚠️ Potential issue | 🟡 Minor

Inconsistent use of versions vs versionsBuilt for upgrade scripts.

The loop on line 131 uses versions (all supported versions) instead of versionsBuilt. When latestOnly=true, this creates empty upgrade scripts for version transitions that aren't included in the slim build.

For consistency with the rest of the latestOnly logic, consider using versionsBuilt:

🔧 Proposed fix
     # Create empty upgrade files between consecutive versions
     # plpgsql_check ships without upgrade scripts - extensions are backward-compatible
     previous_version=""
-    for ver in ${lib.concatStringsSep " " versions}; do
+    for ver in ${lib.concatStringsSep " " versionsBuilt}; do
       if [[ -n "$previous_version" ]]; then
         touch $out/share/postgresql/extension/${pname}--''${previous_version}--''${ver}.sql
       fi
       previous_version=$ver
     done
nix/ext/wal2json.nix (1)

89-94: ⚠️ Potential issue | 🔴 Critical

Use versionsBuilt instead of versions for upgrade script files to match built versions.

The loop at line 89 creates upgrade path files using versions (all supported versions), but only the versions in versionsBuilt are actually compiled. In latestOnly mode, this creates upgrade files for versions that were never built. For example, if only v1.1 is built, the loop still creates --1.0--1.1.sql even though v1.0 was never compiled. Change the loop to iterate over versionsBuilt:

Suggested change
-    for ver in ${lib.concatStringsSep " " versions}; do
+    for ver in ${lib.concatStringsSep " " versionsBuilt}; do

This same bug exists in nix/ext/plpgsql-check.nix at line 131.

🧹 Nitpick comments (1)
nix/ext/index_advisor.nix (1)

78-79: Consider propagating latestOnly to hypopg dependency.

The hypopg dependency is instantiated without passing latestOnly. When building index_advisor with latestOnly=true, hypopg will still build all its versions. For a truly slim build, consider:

-  paths = packages ++ [ (callPackage ./hypopg.nix { inherit postgresql; }) ];
+  paths = packages ++ [ (callPackage ./hypopg.nix { inherit postgresql latestOnly; }) ];

If hypopg should always include all versions regardless of index_advisor's setting, this can be left as-is.

@samrose
Copy link
Collaborator Author

samrose commented Feb 4, 2026

We won't need this one after all closing

@samrose samrose closed this Feb 4, 2026
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.

1 participant