Skip to content

Commit 9d5261d

Browse files
authored
Merge branch 'cloudnative-pg:main' into pr-cron
2 parents f38852c + 8d04fc0 commit 9d5261d

34 files changed

Lines changed: 1217 additions & 454 deletions

.github/workflows/bake.yml

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ on:
77
extension_name:
88
description: "The PostgreSQL extension to build (directory name)"
99
required: true
10-
type: choice
11-
options:
12-
- pgvector
13-
- postgis
14-
- pgaudit
15-
- pg-crash
10+
type: string
1611

1712
defaults:
1813
run:
@@ -33,6 +28,43 @@ jobs:
3328
with:
3429
persist-credentials: false
3530

31+
- name: Fetch valid targets
32+
id: get-targets
33+
uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1
34+
env:
35+
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
36+
DAGGER_VERSION: 0.20.8
37+
with:
38+
version: ${{ env.DAGGER_VERSION }}
39+
verb: call
40+
module: ./dagger/maintenance/
41+
args: get-targets
42+
43+
- name: Validate extension name
44+
if: github.event_name == 'workflow_dispatch'
45+
env:
46+
INPUT_EXTENSION_NAME: ${{ github.event.inputs.extension_name }}
47+
VALID_TARGETS: ${{ steps.get-targets.outputs.output }}
48+
run: |
49+
if ! echo "$VALID_TARGETS" | jq -e --arg ext "$INPUT_EXTENSION_NAME" 'index($ext)' > /dev/null; then
50+
echo "::error::'$INPUT_EXTENSION_NAME' is not a valid extension target. Valid targets: $VALID_TARGETS"
51+
exit 1
52+
fi
53+
54+
- name: Compute paths-filter extensions block
55+
env:
56+
VALID_TARGETS: ${{ steps.get-targets.outputs.output }}
57+
run: |
58+
if ! echo "$VALID_TARGETS" | jq -e 'length > 0' > /dev/null; then
59+
echo "::error::dagger get-targets returned no extensions: $VALID_TARGETS"
60+
exit 1
61+
fi
62+
{
63+
echo 'EXTENSIONS<<YAML_EOF'
64+
echo "$VALID_TARGETS" | jq -r '.[] | "\(.):\n - \"\(.)/**\"\n - *shared"'
65+
echo 'YAML_EOF'
66+
} >> "$GITHUB_ENV"
67+
3668
- name: Check for changes
3769
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
3870
id: filter
@@ -41,21 +73,10 @@ jobs:
4173
_shared: &shared
4274
- 'docker-bake.hcl'
4375
- 'Taskfile.yml'
44-
- 'kind-config.yaml'
4576
- 'test/**'
46-
- '.github/workflows/bake*.yml'
47-
pgvector:
48-
- 'pgvector/**'
49-
- *shared
50-
postgis:
51-
- 'postgis/**'
52-
- *shared
53-
pgaudit:
54-
- 'pgaudit/**'
55-
- *shared
56-
pg-crash:
57-
- 'pg-crash/**'
58-
- *shared
77+
- 'dagger/maintenance/**'
78+
- '.github/workflows/bake_targets.yml'
79+
${{ env.EXTENSIONS }}
5980
6081
# Compute a matrix containing the list of all extensions that have been modified
6182
- name: Compute matrix

.github/workflows/bake_targets.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions: {}
1616
jobs:
1717
testbuild:
1818
name: Build ${{ inputs.extension_name }}
19-
runs-on: ubuntu-24.04
19+
runs-on: ${{ github.repository_owner == 'cloudnative-pg' && 'ubuntu-latest-16-cores' || 'ubuntu-24.04' }}
2020
permissions:
2121
contents: read
2222
packages: write
@@ -32,7 +32,7 @@ jobs:
3232
persist-credentials: false
3333

3434
- name: Log in to the GitHub Container registry
35-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
35+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
3636
with:
3737
registry: ghcr.io
3838
username: ${{ github.actor }}
@@ -44,10 +44,10 @@ jobs:
4444
platforms: 'linux/arm64'
4545

4646
- name: Set up Docker Buildx
47-
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
47+
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
4848

4949
- name: Build and push
50-
uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7
50+
uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 # v7
5151
id: build
5252
env:
5353
BUILDX_METADATA_PROVENANCE: disabled
@@ -68,7 +68,7 @@ jobs:
6868
6969
# Even if we're testing we sign the images, so we can push them to production later if that's required
7070
- name: Install cosign
71-
uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3
71+
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
7272
# See https://github.blog/security/supply-chain-security/safeguard-container-signing-capability-actions/
7373
# and https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml for more details on
7474
# how to use cosign.
@@ -119,26 +119,28 @@ jobs:
119119
fail-fast: false
120120
matrix:
121121
image: ${{fromJson(needs.testbuild.outputs.images)}}
122-
cnpg: ["main", "1.27", "1.28"]
122+
cnpg: ["main", "1.28", "1.29"]
123123
steps:
124124
- name: Checkout Code
125125
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
126126
with:
127127
persist-credentials: false
128128

129129
- name: Install Task
130-
uses: go-task/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1.0.0
130+
uses: go-task/setup-task@01a4adf9db2d14c1de7a560f09170b6e0df736aa # v2.1.0
131131

132132
- name: Install Dagger
133133
env:
134134
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
135-
DAGGER_VERSION: 0.20.1
135+
DAGGER_VERSION: 0.20.8
136136
run: |
137137
curl -L https://dl.dagger.io/dagger/install.sh | BIN_DIR=$HOME/.local/bin sh
138138
139139
- name: Set up environment
140+
env:
141+
CNPG_RELEASE: ${{ matrix.cnpg }}
140142
run: |
141-
task e2e:setup-env
143+
task e2e:setup-env CNPG_RELEASE=$CNPG_RELEASE
142144
143145
- name: Generate Chainsaw testing values
144146
env:

.github/workflows/update-catalogs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ jobs:
3636

3737
- name: Update catalogs
3838
id: update-extension-catalogs
39-
uses: dagger/dagger-for-github@496f1b3d8b0d823834c13e67cf8a8e08ca3b9602 # v8.4.0
39+
uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1
4040
env:
4141
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
42-
DAGGER_VERSION: 0.20.1
42+
DAGGER_VERSION: 0.20.8
4343
with:
4444
version: ${{ env.DAGGER_VERSION }}
4545
verb: call
4646
module: ./dagger/maintenance/
4747
args: generate-catalogs --catalogs-dir artifacts/image-catalogs/ export --path artifacts/image-catalogs-extensions/
4848

4949
- name: Install cosign
50-
uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3
50+
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
5151

5252
- name: Sign catalogs
5353
run: |
@@ -63,7 +63,7 @@ jobs:
6363
git status
6464
git diff --staged
6565
66-
- uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9
66+
- uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321 # v10
6767
if: github.ref == 'refs/heads/main'
6868
with:
6969
cwd: 'artifacts'

.github/workflows/update_os_libraries.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525

2626
- name: Fetch extensions
2727
id: get-extensions-dagger
28-
uses: dagger/dagger-for-github@496f1b3d8b0d823834c13e67cf8a8e08ca3b9602 # v8.4.0
28+
uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1
2929
env:
3030
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
31-
DAGGER_VERSION: 0.20.1
31+
DAGGER_VERSION: 0.20.8
3232
with:
3333
version: ${{ env.DAGGER_VERSION }}
3434
verb: call
@@ -56,17 +56,17 @@ jobs:
5656
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5757

5858
- name: Log in to the GitHub Container registry
59-
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
59+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
6060
with:
6161
registry: ghcr.io
6262
username: ${{ github.actor }}
6363
password: ${{ secrets.GITHUB_TOKEN }}
6464

6565
- name: Update OS libs for ${{ matrix.extension }}
66-
uses: dagger/dagger-for-github@496f1b3d8b0d823834c13e67cf8a8e08ca3b9602 # v8.4.0
66+
uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1
6767
env:
6868
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
69-
DAGGER_VERSION: 0.20.1
69+
DAGGER_VERSION: 0.20.8
7070
with:
7171
version: ${{ env.DAGGER_VERSION }}
7272
verb: call
@@ -79,7 +79,7 @@ jobs:
7979
git diff
8080
8181
- name: Create a PR if versions have been updated on main
82-
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
82+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
8383
if: github.ref == 'refs/heads/main'
8484
with:
8585
token: ${{ secrets.REPO_GHA_PAT }}

CONTRIBUTING_NEW_EXTENSION.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ Before proposing a change, ensure your local machine is compatible with the
1515

1616
1. **Fork** the [cloudnative-pg/postgres-extensions-containers](https://github.com/cloudnative-pg/postgres-extensions-containers) repository.
1717
2. **Clone** your fork and enter the directory:
18-
```sh
19-
git clone https://github.com/<your-username>/postgres-extensions-containers.git
20-
cd postgres-extensions-containers
21-
```
18+
```sh
19+
git clone https://github.com/<your-username>/postgres-extensions-containers.git
20+
cd postgres-extensions-containers
21+
```
2222
3. **Verify the Environment:** Run the following to ensure you can build the
2323
existing project ecosystem.
24-
```sh
25-
task prereqs # Check if Go, Task, and Docker are ready
26-
task checks:all # Validate current configurations
27-
task bake:all # Optional: build all existing extensions to confirm the Dagger engine
28-
```
24+
```sh
25+
task prereqs # Check if Go, Task, and Docker are ready
26+
task checks:all # Validate current configurations
27+
task bake:all # Optional: build all existing extensions to confirm the Dagger engine
28+
```
2929

3030
---
3131

@@ -152,9 +152,26 @@ The scaffolding generates `metadata.hcl`, `Dockerfile`, and `README.md`.
152152
Follow the specific instructions and "TODO" comments found within each
153153
generated file to finalize your extension.
154154

155+
#### Package Version vs. SQL Version
156+
157+
Your `metadata.hcl` file requires two version fields:
158+
159+
- **`package`**: The full Debian package version (e.g., `0.8.2-1.pgdg13+1`).
160+
This includes packaging metadata and is used to install the correct package.
161+
162+
- **`sql`**: The PostgreSQL extension version as it appears in the catalog
163+
(e.g., `0.8.2`). This is the version of the extension that will be verified
164+
as part of the automatic testing of the resulting containers. It should
165+
match what is defined by the `default_version` field in the control file.
166+
167+
168+
> [!WARNING]
169+
> The `sql` version is optional and only needed if your extension uses
170+
> `CREATE EXTENSION` (when `create_extension = true` in metadata).
171+
155172
> [!TIP]
156-
> Pay close attention to the `// renovate:` comments in the metadata; these are
157-
> required for automated version tracking.
173+
> Pay close attention to the `// renovate:` comments in the metadata and
174+
> `README.md` files; these are required for automated version tracking.
158175

159176
---
160177

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ CloudNativePG actively maintains the following third-party extensions, provided
3232
they are maintained by their respective authors, and PostgreSQL Debian Group
3333
(PGDG) packages are available.
3434

35-
| Extension | Description | Project URL |
36-
| :--- | :--- | :--- |
37-
| **[pgAudit](pgaudit)** | PostgreSQL audit extension | [github.com/pgaudit/pgaudit](https://github.com/pgaudit/pgaudit) |
38-
| **[pg_crash](pg-crash)** | **Disruptive** fault injection and chaos engineering extension | [github.com/cybertec-postgresql/pg_crash](https://github.com/cybertec-postgresql/pg_crash) |
39-
| **[pgvector](pgvector)** | Vector similarity search for PostgreSQL | [github.com/pgvector/pgvector](https://github.com/pgvector/pgvector) |
40-
| **[PostGIS](postgis)** | Geospatial database extension for PostgreSQL | [postgis.net/](https://postgis.net/) |
41-
35+
| Extension | Description | Project URL | Maintained by |
36+
| :--- | :--- | :--- | :--- |
37+
| **[pgAudit](pgaudit)** | PostgreSQL audit extension | [github.com/pgaudit/pgaudit](https://github.com/pgaudit/pgaudit) | CNPG maintainers |
38+
| **[pg_crash](pg-crash)** | **Disruptive** fault injection and chaos engineering extension | [github.com/cybertec-postgresql/pg_crash](https://github.com/cybertec-postgresql/pg_crash) | CNPG maintainers |
39+
| **[pgvector](pgvector)** | Vector similarity search for PostgreSQL | [github.com/pgvector/pgvector](https://github.com/pgvector/pgvector) | CNPG maintainers |
40+
| **[PostGIS](postgis)** | Geospatial database extension for PostgreSQL | [postgis.net/](https://postgis.net/) | CNPG maintainers |
4241

4342
Extensions are provided only for the OS versions already built by the
4443
[`cloudnative-pg/postgres-containers`](https://github.com/cloudnative-pg/postgres-containers) project,
@@ -138,26 +137,27 @@ other tools to identify the base PostgreSQL version and OS distribution.
138137

139138
### CloudNativePG-Specific Labels
140139

141-
| Label | Description | Example |
142-
| :--- | :--- | :--- |
143-
| `io.cloudnativepg.image.base.name` | Base PostgreSQL container image | `ghcr.io/cloudnative-pg/postgresql:18-minimal-bookworm` |
144-
| `io.cloudnativepg.image.base.pgmajor` | PostgreSQL major version | `18` |
145-
| `io.cloudnativepg.image.base.os` | Operating system distribution | `bookworm` |
140+
| Label | Description | Example |
141+
|:--------------------------------------|:---------------------------------|:--------------------------------------------------------|
142+
| `io.cloudnativepg.image.base.name` | Base PostgreSQL container image | `ghcr.io/cloudnative-pg/postgresql:18-minimal-bookworm` |
143+
| `io.cloudnativepg.image.base.pgmajor` | PostgreSQL major version | `18` |
144+
| `io.cloudnativepg.image.base.os` | Operating system distribution | `bookworm` |
145+
| `io.cloudnativepg.image.sql.version` | PostgreSQL extension SQL version | `0.8.2` |
146146

147147
### Standard OCI Labels
148148

149149
In addition to CloudNativePG-specific labels, all images include standard OCI
150150
annotations as defined by the [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/main/annotations.md):
151151

152-
| Label | Description |
153-
| :--- | :--- |
154-
| `org.opencontainers.image.created` | Image creation timestamp |
155-
| `org.opencontainers.image.version` | Extension version |
156-
| `org.opencontainers.image.revision` | Git commit SHA |
157-
| `org.opencontainers.image.title` | Human-readable image title |
158-
| `org.opencontainers.image.description` | Image description |
159-
| `org.opencontainers.image.source` | Source repository URL |
160-
| `org.opencontainers.image.licenses` | License identifier |
152+
| Label | Description |
153+
|:---------------------------------------|:----------------------------|
154+
| `org.opencontainers.image.created` | Image creation timestamp |
155+
| `org.opencontainers.image.version` | Extension's package version |
156+
| `org.opencontainers.image.revision` | Git commit SHA |
157+
| `org.opencontainers.image.title` | Human-readable image title |
158+
| `org.opencontainers.image.description` | Image description |
159+
| `org.opencontainers.image.source` | Source repository URL |
160+
| `org.opencontainers.image.licenses` | License identifier |
161161

162162
You can inspect these labels using container tools:
163163

0 commit comments

Comments
 (0)