Refining project to support multiple Postgres versions#3
Conversation
Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
…port Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
…ures Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refines the Docker image project to support building and publishing images for multiple PostgreSQL major versions, and expands the repo with CI workflows, local-dev scaffolding, and Kubernetes examples to make usage and contribution easier.
Changes:
- Parameterize image builds for multiple PostgreSQL versions and add matrix-based build/test workflows.
- Add local development artifacts (docker-compose, init SQL) plus Kubernetes example manifests.
- Add security scanning, templates, Dependabot configuration, and expanded documentation.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Updates docs for multi-version images, tags, quickstart, and repo structure. |
Dockerfile |
Adds version build args/labels, pins oracle_fdw checkout, and adds healthcheck. |
docker-compose.yml |
Adds local dev Compose stack with build args, init scripts, and healthcheck. |
init-scripts/01-init-extensions.sql |
Adds automatic first-start extension initialization and example setup. |
build-versions.sh |
Adds helper script to build supported PostgreSQL versions locally. |
examples/kubernetes/README.md |
Adds instructions for deploying via CloudNativePG operator. |
examples/kubernetes/cluster.yaml |
Adds a sample CNPG Cluster manifest with bootstrap SQL and parameters. |
examples/kubernetes/oracle-fdw-config.yaml |
Adds example Secret/ConfigMap/Job to configure oracle_fdw objects. |
.github/workflows/docker-build.yml |
Adds CI matrix builds, multi-arch configuration, and PR test job. |
.github/workflows/security-scan.yml |
Adds Trivy-based image vulnerability scanning. |
CONTRIBUTING.md |
Adds contributor guidelines and local/CI testing instructions. |
.github/PULL_REQUEST_TEMPLATE.md |
Adds a PR template with version/testing checklists. |
.github/ISSUE_TEMPLATE/feature_request.md |
Adds feature request template. |
.github/ISSUE_TEMPLATE/bug_report.md |
Adds bug report template. |
.github/dependabot.yml |
Adds Dependabot configuration for Actions and Docker. |
.env.example |
Adds example env file for Compose-based setup. |
Suppressed comments (4)
.github/workflows/docker-build.yml:143
- The PR test build uses
ORACLE_FDW_VERSION=ORACLE_FDW_2_8_0, which currently disagrees with the Dockerfile default and other tooling in this repo (ORACLE_FDW_2_7_0). This can make CI pass/fail depending on which workflow runs. Use the same pinned version as the rest of the project (or update everything consistently).
PG_MAJOR=${{ matrix.pg_version.major }}
PG_VERSION=${{ matrix.pg_version.version }}
ORACLE_VERSION=19.25.0.0.0
ORACLE_FDW_VERSION=ORACLE_FDW_2_8_0
.github/workflows/docker-build.yml:115
- If the
dockerjob is skipped on PRs (or fails early),needs: dockerprevents thetestjob from running. Sincetestalready builds and validates the image on PRs, it should not depend on the push job.
test:
runs-on: ubuntu-latest
needs: docker
if: github.event_name == 'pull_request'
.github/workflows/docker-build.yml:103
- Same as the Docker Hub step:
linux/arm64builds are not compatible with the current Dockerfile'slinux.x64Oracle Instant Client downloads. Restrict platforms here as well (or update the Dockerfile to select Instant Client archives perTARGETARCH).
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.ghcr-tags.outputs.tags }}
.github/workflows/security-scan.yml:61
- Same issue here: avoid
@masterfor actions in security-related workflows; pin to a release tag or commit SHA to ensure reproducible and reviewable builds.
- name: Run Trivy vulnerability scanner (table format)
uses: aquasecurity/trivy-action@master
with:
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| -- OPTIONS (schema 'SYSTEM', table 'EXAMPLE_TABLE'); | ||
|
|
||
| -- Initialize anonymizer | ||
| ALTER DATABASE app SET anon.transparent_dynamic_masking TO true; |
| -- Example: Create an anonymous role | ||
| CREATE ROLE anonymous LOGIN PASSWORD 'anonymous_pass'; | ||
| SECURITY LABEL FOR anon ON ROLE anonymous IS 'MASKED'; | ||
| GRANT pg_read_all_data TO anonymous; |
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
| interval: 10s |
| -- Create Oracle server using credentials from secret | ||
| CREATE SERVER IF NOT EXISTS oracle_server | ||
| FOREIGN DATA WRAPPER oracle_fdw | ||
| OPTIONS (dbserver '//oracle-host:1521/ORCLPDB1'); | ||
|
|
||
| -- Create user mapping | ||
| CREATE USER MAPPING IF NOT EXISTS FOR app | ||
| SERVER oracle_server | ||
| OPTIONS (user 'oracle_user', password 'oracle_password'); |
| PGPASSWORD="${POSTGRES_PASSWORD}" psql -h postgres-oracle-fdw-rw -U app -d app -f /scripts/setup.sql | ||
| env: | ||
| - name: POSTGRES_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: postgres-oracle-fdw-app | ||
| key: password | ||
| volumeMounts: |
| - major: "18" | ||
| version: "18.4" | ||
| latest: true | ||
| oracle_version: ["19.25.0.0.0"] | ||
| oracle_fdw_version: ["ORACLE_FDW_2_8_0"] |
| docker: | ||
| runs-on: ubuntu-latest |
| with: | ||
| context: . | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: ${{ github.event_name != 'pull_request' }} | ||
| tags: ${{ steps.docker-tags.outputs.tags }} |
| - Base Image: `ghcr.io/cloudnative-pg/postgresql:{PG_MAJOR}-bullseye` | ||
| - Supports PostgreSQL 17 and 18 (configurable via PG_MAJOR build argument) | ||
| - Oracle Instant Client: Version 19.25.0.0.0 (configurable via ORACLE_VERSION build argument) |
Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Pull request created by AI Agent