Skip to content

Refining project to support multiple Postgres versions - #3

Open
dingo4dev with Copilot wants to merge 8 commits into
mainfrom
copilot/add-postgres-18-4-support
Open

Refining project to support multiple Postgres versions#3
dingo4dev with Copilot wants to merge 8 commits into
mainfrom
copilot/add-postgres-18-4-support

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown

Pull request created by AI Agent

Copilot AI and others added 2 commits August 7, 2026 03:33
Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
…port

Co-authored-by: dingo4dev <19900516+dingo4dev@users.noreply.github.com>
Copilot AI and others added 2 commits August 7, 2026 03:45
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>
@dingo4dev
dingo4dev marked this pull request as ready for review August 11, 2026 03:35
Copilot AI lite review requested due to automatic review settings August 11, 2026 03:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 docker job is skipped on PRs (or fails early), needs: docker prevents the test job from running. Since test already 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/arm64 builds are not compatible with the current Dockerfile's linux.x64 Oracle Instant Client downloads. Restrict platforms here as well (or update the Dockerfile to select Instant Client archives per TARGETARCH).
        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 @master for 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;
Comment on lines +34 to +37
-- 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;
Comment thread docker-compose.yml
Comment on lines +24 to +26
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
Comment on lines +19 to +27
-- 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');
Comment on lines +66 to +73
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:
Comment thread .github/workflows/docker-build.yml Outdated
Comment on lines +26 to +30
- major: "18"
version: "18.4"
latest: true
oracle_version: ["19.25.0.0.0"]
oracle_fdw_version: ["ORACLE_FDW_2_8_0"]
Comment on lines 15 to 16
docker:
runs-on: ubuntu-latest
Comment on lines +84 to +88
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker-tags.outputs.tags }}
Comment thread .github/workflows/security-scan.yml
Comment thread README.md
Comment on lines +396 to +398
- 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>
@github-advanced-security

Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

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.

4 participants