Skip to content

Expose development installs as project dev version - #208

Merged
Komzpa merged 5 commits into
mainfrom
fix-dev-install-version-207
Jun 23, 2026
Merged

Expose development installs as project dev version#208
Komzpa merged 5 commits into
mainfrom
fix-dev-install-version-207

Conversation

@Komzpa

@Komzpa Komzpa commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

  • derive development install metadata as ${PROJECT_VERSION}dev when source INSTALL_VERSION is unreleased
  • generate build/install SQL aliases like h3--4.5.0dev.sql and h3--4.5.0--4.5.0dev.sql while keeping source update files on --unreleased.sql
  • generate compatibility update aliases from old dev install versions (unreleased, ${PROJECT_VERSION}dev, and release-source dev versions) to the generated/default version
  • keep release/postrelease source workflow on the existing unreleased placeholder and make the extension regression update to the control-file default version
  • document the source placeholder vs generated development install version split
  • address review feedback by tracking source update SQL as CMake configure dependencies
  • harden generated update SQL and scripts/release so they rewrite only the psql update guard and availability markers, not unrelated unreleased text
  • shrink the CMake transition-generation diff by sharing the generated transition emitter instead of repeating three near-identical blocks

Closes #207

Validation

  • bash -n scripts/release scripts/postrelease
  • scripts/check-metadata
  • git diff --check
  • cmake -S . -B /tmp/h3b208 -DCMAKE_BUILD_TYPE=Release
  • cmake --build /tmp/h3b208 -j 32
  • inspected generated build-tree control/config/SQL files for 4.5.0dev
  • asserted generated short-build files include h3--4.5.0dev.sql, h3--4.5.0--4.5.0dev.sql, h3--unreleased--4.5.0dev.sql, and matching h3_postgis files
  • touched h3/sql/updates/h3--4.5.0--unreleased.sql, then cmake --build /tmp/h3b208 -j 32 re-ran configure/generate
  • temporary PostgreSQL 18 cluster smoke: old unreleased installs of h3 and h3_postgis update to 4.5.0dev
  • isolated patched clone smoke: RELEASE_DATE=2026-06-23 scripts/release 4.5.1, then CMake configure asserts generated release aliases unreleased -> 4.5.1, 4.5.0dev -> 4.5.1, and 4.5.1dev -> 4.5.1 for both extensions
  • isolated CMake adversarial smoke: injected unrelated quoted unreleased text plus availability: unreleased into both current update SQL files, configured CMake, and asserted generated update SQL changed only the update guard/availability markers while unrelated text stayed unchanged
  • isolated release adversarial smoke: injected unrelated quoted unreleased text plus availability: unreleased into both current update SQL files, ran RELEASE_DATE=2026-06-23 scripts/release 4.5.1, and asserted only the update guard/availability markers changed while unrelated text stayed unchanged
  • ctest --test-dir /tmp/h3b208 --output-on-failure -R '^(h3_regress|h3_validate_extupgrade|h3_postgis_regress_fast|h3_postgis_regress|h3_postgis_validate_extupgrade)$'
  • ctest --test-dir /tmp/h3b208scrub --output-on-failure -R '^(h3_regress|h3_postgis_regress_fast|h3_postgis_regress)$'
  • local pg_validate_extupgrade is unavailable in /tmp/h3b208scrub, so that configure registered *_validate_extupgrade_unavailable placeholders; upgrade validation remains covered by the earlier /tmp/h3b208 run and CI
  • codex review --uncommitted: no discrete correctness issues found in the changed CMake logic
  • codex review --uncommitted: no discrete correctness issues found in the release-script narrowing diff
  • codex review --uncommitted: no discrete correctness issues found in the generated-update scrub/shrink diff

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eac34b9e31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmake/AddPostgreSQLExtension.cmake
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f356319f-f3c6-473e-852e-24ce2ada6994

📥 Commits

Reviewing files that changed from the base of the PR and between f385531 and b901788.

📒 Files selected for processing (2)
  • cmake/AddPostgreSQLExtension.cmake
  • scripts/release
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmake/AddPostgreSQLExtension.cmake

📝 Walkthrough

Walkthrough

Introduces INSTALL_OUTPUT_VERSION in the root CMakeLists.txt, deriving ${PROJECT_VERSION}dev when INSTALL_VERSION is "unreleased". This variable propagates to extension definitions, config headers, and test targets. The cmake/AddPostgreSQLExtension.cmake preprocessing now renames --unreleased.sql update scripts, replaces their content, and generates transition SQL files across all PostgreSQL versions. Release and postrelease scripts drop the UPDATE TO 'unreleased' pattern in favor of a plain ALTER EXTENSION h3 UPDATE assertion.

Changes

Dev version string: unreleased → X.Y.Zdev

Layer / File(s) Summary
INSTALL_OUTPUT_VERSION derivation and propagation
CMakeLists.txt, h3/CMakeLists.txt, h3/src/config.h.in, h3/test/CMakeLists.txt, h3_postgis/CMakeLists.txt, h3_postgis/src/config.h.in, h3_postgis/test/CMakeLists.txt
Root CMake derives INSTALL_OUTPUT_VERSION as ${PROJECT_VERSION}dev when INSTALL_VERSION is "unreleased", then all extension VERSION fields, config.h.in macros, and extupgrade test TO_VERSION arguments switch from INSTALL_VERSION to INSTALL_OUTPUT_VERSION.
Update script preprocessing: --unreleased.sql renaming, content replacement, and transition generation
cmake/AddPostgreSQLExtension.cmake
Introduces a new macro for generating development-install transition SQL files. Reworks the update SQL processing loop to unconditionally read and derive UPDATE_OUTPUT_NAME for each update file; when a file matches --unreleased.sql and EXTENSION_VERSION is not "unreleased", the output filename is rewritten to --<EXTENSION_VERSION>.sql and all unreleased occurrences in the file contents are replaced. Generates unreleased and dev-release transition SQL files when version conditions match. PostgreSQL-version-gated extschema stripping applies only for versions < 16.
Test fixtures: version assertion and update command
h3/test/sql/extension.sql
Extension version assertion regex accepts the dev suffix; upgrade command becomes a plain ALTER EXTENSION h3 UPDATE without an explicit target version.
Release and postrelease script adjustments
scripts/release, scripts/postrelease
scripts/release removes UPDATE TO 'unreleased' from its leftover-marker check and removes the sed rewrite step for test files; release_update_file now replaces specific UPDATE TO 'unreleased' and availability: unreleased strings instead of all unreleased substrings. scripts/postrelease replaces the sed mutation with a grep assertion that both test files contain ALTER EXTENSION h3 UPDATE;.
Development and release process documentation
docs/development.md
Documents that development builds install as ${PROJECT_VERSION}dev, that the release script sets INSTALL_VERSION to ${PROJECT_VERSION} to produce an exact X.Y.Z install, and that postrelease keeps the upgrade regression target at the default extension version.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • postgis/h3-pg#197: Modifies the same release automation scripts with overlapping changes to ALTER EXTENSION h3 UPDATE target handling and --unreleased.sql processing.
  • postgis/h3-pg#203: Changes version macro generation (POSTGRESQL_H3_VERSION/POSTGRESQL_PGH3_VERSION) to use INSTALL_OUTPUT_VERSION, which directly affects the PG_MODULE_MAGIC_EXT module-magic initialization in extension source files.

Poem

🐇 Hop hop, no more "unreleased" in sight,
Now 4.5.0dev shines bright!
The version string leaps from the CMake tree,
Scripts and SQL transitions updated with glee.
A dev suffix blooms — informative and right! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: deriving development install metadata as a project dev version rather than using a generic placeholder.
Description check ✅ Passed The description provides detailed context about versioning changes, implementation approach, and comprehensive validation steps that are directly related to the changeset.
Linked Issues check ✅ Passed The PR successfully addresses issue #207 by implementing development version exposure (e.g., 4.5.0dev) for h3 and h3_postgis extensions, with compatibility for PostgreSQL upgrade paths and ALTER EXTENSION behavior.
Out of Scope Changes check ✅ Passed All changes are scoped to versioning infrastructure: CMake configuration for version derivation, SQL generation for aliases, test configuration updates, release script modifications, and documentation clarification. No unrelated changes detected.
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
  • Commit unit tests in branch fix-dev-install-version-207

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
cmake/AddPostgreSQLExtension.cmake (1)

276-292: 🧹 Nitpick | 🔵 Trivial

Global string replacement of "unreleased" affects non-version-string contexts.

Line 280 uses string(REPLACE) which performs a blind global replacement of "unreleased" throughout the update file content. Current update files already contain "unreleased" outside version strings: in the echo/\quit directive at line 19 (e.g., \echo Use "ALTER EXTENSION h3 UPDATE TO 'unreleased'"). This will be transformed whenever the CMake code processes these files, which could be problematic if the version string replacement is not the intended behavior for such directives.

Consider using a more targeted replacement strategy, such as string(REGEX REPLACE) with a pattern that specifically matches version-string contexts (e.g., only within SQL comments or specific line patterns).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmake/AddPostgreSQLExtension.cmake` around lines 276 - 292, The
`string(REPLACE "unreleased" "${EXTENSION_VERSION}")` call on line 280 performs
a global blind replacement throughout the entire update file contents, which
unintentionally replaces "unreleased" text in non-version contexts like echo
directives. Replace this global string replacement with a more targeted
`string(REGEX REPLACE)` pattern that only matches "unreleased" in actual
version-string contexts (such as within SQL version comments or specific
patterns) to avoid replacing "unreleased" text appearing in other file
directives and comments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cmake/AddPostgreSQLExtension.cmake`:
- Around line 276-292: The `string(REPLACE "unreleased" "${EXTENSION_VERSION}")`
call on line 280 performs a global blind replacement throughout the entire
update file contents, which unintentionally replaces "unreleased" text in
non-version contexts like echo directives. Replace this global string
replacement with a more targeted `string(REGEX REPLACE)` pattern that only
matches "unreleased" in actual version-string contexts (such as within SQL
version comments or specific patterns) to avoid replacing "unreleased" text
appearing in other file directives and comments.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 421ab766-180c-4f0c-b178-41e88e7a234d

📥 Commits

Reviewing files that changed from the base of the PR and between 9d70e9c and eac34b9.

⛔ Files ignored due to path filters (1)
  • h3/test/expected/extension.out is excluded by !**/*.out
📒 Files selected for processing (12)
  • CMakeLists.txt
  • cmake/AddPostgreSQLExtension.cmake
  • docs/development.md
  • h3/CMakeLists.txt
  • h3/src/config.h.in
  • h3/test/CMakeLists.txt
  • h3/test/sql/extension.sql
  • h3_postgis/CMakeLists.txt
  • h3_postgis/src/config.h.in
  • h3_postgis/test/CMakeLists.txt
  • scripts/postrelease
  • scripts/release

@Komzpa

Komzpa commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99a9a3c0ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmake/AddPostgreSQLExtension.cmake Outdated
@Komzpa

Komzpa commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 08e1b14d14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Komzpa

Komzpa commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f385531aaf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +316 to +317
if(DEFINED PROJECT_VERSION AND EXTENSION_VERSION STREQUAL PROJECT_VERSION
AND (NOT EXTENSION_PROJECT_DEV_RELEASE_TRANSITION_EMITTED OR NOT EXTENSION_SOURCE_DEV_RELEASE_TRANSITION_EMITTED))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Generate dev-to-dev upgrade aliases

When the next development cycle starts (for example, after releasing 4.5.1 and returning INSTALL_VERSION to unreleased), EXTENSION_VERSION becomes 4.5.1dev, so this branch is skipped and the build only emits the normal 4.5.0--4.5.1 plus 4.5.1--4.5.1dev paths. A developer who installed the current 4.5.0dev version from source then has no 4.5.0dev--4.5.1 or 4.5.0dev--4.5.1dev update file in a fresh next-cycle build, so ALTER EXTENSION ... UPDATE cannot move their dev install forward unless they first install the release artifact. Please emit the source-dev compatibility transition when generating the dev default version as well as release builds.

Useful? React with 👍 / 👎.

@Komzpa

Komzpa commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: b901788dc2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Komzpa
Komzpa merged commit adbade5 into main Jun 23, 2026
35 checks passed
@Komzpa
Komzpa deleted the fix-dev-install-version-207 branch June 23, 2026 13:08
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.

Development builds report extension version as "unreleased"

1 participant