Skip to content

feat!: release SnowID 3.0.0#49

Merged
qeeqez merged 18 commits into
mainfrom
rixl/snowid-3.0.0-release
May 25, 2026
Merged

feat!: release SnowID 3.0.0#49
qeeqez merged 18 commits into
mainfrom
rixl/snowid-3.0.0-release

Conversation

@qeeqez

@qeeqez qeeqez commented May 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Bump pg_snowid and the bundled snowid dependency to 3.0.0
  • Document SnowID 3.0 logical timestamp generation in the README and PostgreSQL function docs
  • snowid_generate(...) and snowid_generate_base62(...) now return immediately when a millisecond sequence range is exhausted, advancing the timestamp component logically instead of waiting for the next wall-clock millisecond
  • Add PostgreSQL wrappers for SnowID 3.0 non-blocking and batch APIs: snowid_try_generate, snowid_try_generate_base62, snowid_generate_batch, and snowid_try_generate_batch
  • Remove redundant exported _int SQL wrappers so the extension exposes only the intended OID-based public PostgreSQL functions
  • Make node ID initialization explicit: default is fixed node ID 1, it is not auto-generated from the host, and custom node IDs must be set before generators are created
  • Update README coverage for all exposed PostgreSQL functions and update the 2.4.0 -> 3.0.0 migration script to create the new public functions for existing installations
  • Keep IDs unique, time-sorted, and monotonic while noting that embedded timestamps can run ahead of wall-clock time during sustained overload
  • Refresh PostgreSQL 18.4 image references and continue CI cleanup with shared pgrx setup and parallel validation/package jobs

Breaking Change

  • SnowID generation semantics changed under per-millisecond sequence exhaustion: generation no longer waits for the next millisecond and can advance logical timestamp components ahead of wall-clock time.
  • Redundant _int SQL helper functions are no longer exported; use the public OID-based snowid_* functions.
  • Changing the node ID after generators have been created is rejected; configure a unique node ID before generating IDs in multi-node deployments.

Testing

  • cargo fetch
  • cargo fmt --all
  • cargo clippy --all-targets --all-features
  • cargo test --all-features
  • cargo pgrx package --profile release
  • cargo test --test packaged_sql_files -- --ignored
  • go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/ci.yml .github/workflows/release.yml

qeeqez added 7 commits May 23, 2026 12:29
there was change on how "generate" function works, now it does not wait for next millisecond, which drastically improve performance during high loads

generate() uses logical timestamp generation by default: it always returns an ID and advances the timestamp component instead of waiting when the current millisecond's sequence range is exhausted.
Reduce CI wall time by avoiding redundant work across architecture jobs and pull requests.

- cache cargo-pgrx binary by resolved pgrx version and skip reinstall when already present

- run clippy, pgrx tests, and packaged SQL validation once on amd64

- run Docker build/publish matrix only for workflow_call with publish_images=true
Use the reusable workflow input directly for Docker publish jobs so release builds still run when called from the push-triggered release workflow.

Split cargo-pgrx installation from pgrx initialization to make CI timing easier to inspect.
Split formatting, linting, pgrx tests, and multi-arch packaging into separate jobs so independent failures surface earlier.

Move shared Rust/PostgreSQL/pgrx setup into a local composite action to keep the workflow smaller while preserving the amd64 and arm64 package artifacts for Docker releases.
Run lint and pgrx tests through one matrixed validation job so they stay parallel while sharing the same checkout and pgrx setup definition.
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Walkthrough

This PR releases pg_snowid version 3.0.0 with infrastructure improvements. A new PGRX GitHub composite action standardizes PostgreSQL build environment setup across CI workflows. The CI pipeline is refactored from separate format and compile jobs into a unified validation matrix and parallel packaging for multiple architectures. Version metadata is updated throughout (Cargo.toml, control file, changelog, and SQL migrations), and Docker base images are updated to target PostgreSQL 18.4.

Changes

pg_snowid 3.0.0 Release and CI Infrastructure

Layer / File(s) Summary
PGRX GitHub Composite Action
.github/actions/setup-pgrx/action.yml
New composite action declares inputs for PostgreSQL major version and cache key, sets up Rust toolchain with caching, configures PostgreSQL apt repository, caches system packages and cargo-pgrx binary, conditionally installs cargo-pgrx based on version matching, and runs cargo pgrx init for the specified PostgreSQL version.
CI Workflow Refactoring
.github/workflows/ci.yml
Replaces separate fmt and compile jobs with a new validate job that runs matrix-driven checks (format, lint, pgrx tests) with conditional Rust vs PGRX setup, and a package job that builds for amd64/arm64 with packaged-SQL test limited to amd64. Updates build_and_push dependencies and marks PostgreSQL 18.4 as the latest version.
Version 3.0.0 Release Metadata
Cargo.toml, pg_snowid.control, CHANGELOG.md, sql/pg_snowid--2.4.0--3.0.0.sql
Package version and snowid dependency bumped from 2.4.0/2.1.0 to 3.0.0/3.0.0. Control file and changelog reflect version 3.0.0 with documented generate() behavior changes. New SQL upgrade migration script created.
Docker Base Image Updates
images/pg/Dockerfile, images/dev/Dockerfile, images/cloudnative-pg/Dockerfile
PostgreSQL minor version default updated from 18.1 to 18.4 across all three Dockerfiles, changing resolved base image tags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • rixlhq/snowid-postgres#12: Both PRs modify CI and Docker configuration targeting PostgreSQL versions; PR #12 reworks CI for building/testing multiple Postgres versions while this PR refactors job structure and targets 18.4.

Poem

A rabbit hops through the CI with glee, 🐰
PGRX action now builds PostgreSQL spree,
Version three-oh-oh takes flight,
Eighteen-four shines oh-so-bright,
Docker caches and workflows align perfectly! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title 'feat!: release SnowID 3.0.0' accurately reflects the main change—a major version release with breaking changes (indicated by '!' in conventional commits). It clearly summarizes the primary objective of the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rixl/snowid-3.0.0-release

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.

qeeqez added 3 commits May 23, 2026 14:49
Resolve pgrx from the checked-out workspace Cargo.toml inside the composite action and fail fast if the version is empty.
Remove pgrx dependency parsing from the composite action and require callers to pass the cargo-pgrx version directly.
Use the shared setup-pgrx action for every validation matrix entry so format, lint, and tests exercise the same cached setup path.

@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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
sql/pg_snowid--2.4.0--3.0.0.sql (1)

1-2: ⚡ Quick win

Confirm empty pg_snowid migration is intentional (repo-wide pattern)

sql/pg_snowid--2.4.0--3.0.0.sql contains only the header comment, and every other sql/pg_snowid--*.sql migration in this repo is also comment-only (no non-comment SQL statements). The empty migration is therefore consistent with the established migration approach, and upgrades will pick up the Rust behavior change automatically.

Optionally, align the header text with the other migrations’ “no SQL schema changes / library updated” messaging and explicitly call out the behavioral change for operators.

🤖 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 `@sql/pg_snowid--2.4.0--3.0.0.sql` around lines 1 - 2, Confirm that the empty
migration in pg_snowid--2.4.0--3.0.0.sql is intentional; if you want to make the
intent explicit, replace the header comment with the same standard phrasing used
by other pg_snowid migrations (e.g., "no SQL schema changes; library updated —
behavioral change: runtime ID generation moved to Rust; operators should restart
services to pick up behavior change") so operators see the behavioral change
note; otherwise leave the file as-is to match the repo-wide pattern.
🤖 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.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 39-43: Replace moving tag refs in all workflow and action uses
with pinned full 40-character commit SHAs: locate each `uses:` entry such as
actions/checkout@v6, dtolnay/rust-toolchain@stable, actions/upload-artifact@v7,
actions/download-artifact@v8, Swatinem/rust-cache@v2 and any docker/* actions
across the workflows and action metadata, find the corresponding repository
commit SHA for the version you intend to lock to, and update `uses:` to the form
owner/repo@<full-40-char-sha> for each occurrence in .github/workflows/ci.yml,
.github/workflows/release.yml and .github/actions/setup-pgrx/action.yml (and any
other workflow files) to ensure immutable pins.

---

Nitpick comments:
In `@sql/pg_snowid--2.4.0--3.0.0.sql`:
- Around line 1-2: Confirm that the empty migration in
pg_snowid--2.4.0--3.0.0.sql is intentional; if you want to make the intent
explicit, replace the header comment with the same standard phrasing used by
other pg_snowid migrations (e.g., "no SQL schema changes; library updated —
behavioral change: runtime ID generation moved to Rust; operators should restart
services to pick up behavior change") so operators see the behavioral change
note; otherwise leave the file as-is to match the repo-wide pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 447fd1eb-e498-4bd0-b4e4-1e2726370401

📥 Commits

Reviewing files that changed from the base of the PR and between 40fa415 and 516d4e4.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • .github/actions/setup-pgrx/action.yml
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • Cargo.toml
  • images/cloudnative-pg/Dockerfile
  • images/dev/Dockerfile
  • images/pg/Dockerfile
  • pg_snowid.control
  • sql/pg_snowid--2.4.0--3.0.0.sql

Comment thread .github/workflows/ci.yml Outdated
Comment on lines 39 to 43
uses: actions/checkout@v6

- name: 🦀 Setup Rust
if: ${{ !matrix.check.requires-pgrx }}
uses: dtolnay/rust-toolchain@stable

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify all non-SHA pinned GitHub Actions references in workflow/action files.
# Expected: no output after remediation.

rg -nP '^\s*uses:\s*[^@\s]+@(?!(?:[0-9a-f]{40})\b)[^\s]+' .github/workflows .github/actions

Repository: rixlhq/snowid-postgres

Length of output: 1205


Pin GitHub Actions to immutable commit SHAs (supply-chain hardening).

.github/workflows/ci.yml uses moving tag refs (not full commit SHAs) in multiple uses: entries, including actions/checkout@v6, dtolnay/rust-toolchain@stable, actions/upload-artifact@v7, actions/download-artifact@v8, and several docker/* actions. This weakens supply-chain integrity—pin each uses: to a full 40-hex commit SHA.

Same issue also appears in .github/workflows/release.yml and .github/actions/setup-pgrx/action.yml (e.g., actions/checkout@v6, dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2, etc.).

🧰 Tools
🪛 zizmor (1.25.2)

[error] 39-39: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 43-43: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 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 @.github/workflows/ci.yml around lines 39 - 43, Replace moving tag refs in
all workflow and action uses with pinned full 40-character commit SHAs: locate
each `uses:` entry such as actions/checkout@v6, dtolnay/rust-toolchain@stable,
actions/upload-artifact@v7, actions/download-artifact@v8, Swatinem/rust-cache@v2
and any docker/* actions across the workflows and action metadata, find the
corresponding repository commit SHA for the version you intend to lock to, and
update `uses:` to the form owner/repo@<full-40-char-sha> for each occurrence in
.github/workflows/ci.yml, .github/workflows/release.yml and
.github/actions/setup-pgrx/action.yml (and any other workflow files) to ensure
immutable pins.

qeeqez added 3 commits May 23, 2026 14:53
Restore deriving cargo-pgrx from Cargo.toml inside the composite action and run that resolution from the checked-out workspace.
Document that PostgreSQL ID generation now uses SnowID 3.0 logical timestamps and no longer waits for the next millisecond when a sequence range is exhausted.

BREAKING CHANGE: SnowID generation semantics now use logical timestamp advancement under per-millisecond sequence exhaustion instead of waiting for wall-clock time.
@qeeqez qeeqez changed the title Release SnowID 3.0.0 and speed up CI validation feat!: release SnowID 3.0.0 May 23, 2026
qeeqez added 5 commits May 23, 2026 15:16
Add PostgreSQL wrappers for SnowID 3.0 try_generate and batch generation APIs, document their behavior, and create them in the 2.4.0 to 3.0.0 upgrade script.
Use separate Rust cache keys for format, lint, test, and package jobs and save caches even when a job fails after compiling.
Use a matrix check id to build validation Rust cache keys instead of hardcoding a separate key on every check entry.
Remove redundant exported _int SQL wrappers and document the intended PostgreSQL functions exposed by the extension.

BREAKING CHANGE: Redundant _int SQL helper functions are no longer exported; use the OID-based public snowid_* functions instead.
@qeeqez qeeqez merged commit 7cdf57f into main May 25, 2026
7 checks passed
@qeeqez qeeqez deleted the rixl/snowid-3.0.0-release branch May 25, 2026 07:54
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