Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/installcheck-multi-pg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#
# Multi-PG Spock mesh installcheck (no Docker)
#
# Builds PostgreSQL REL_15/16/17/18_STABLE plus the Spock extension against
# each, wires the four single-node clusters into a full Spock mesh
# (12 subscriptions, exception_behaviour='discard', auto-DDL on),
# stresses it with `make installcheck-parallel` against n1 (PG15),
# then asserts that every subscription is still enabled and that
# spock.sync_event() round-trips on every directed edge.
#
# The whole thing is driven by tests/run-multi-pg-installcheck.sh, so
# it runs identically on a developer laptop. This workflow's job is
# just: provision deps, invoke the script, save logs on failure.
#
# Dependency footprint is dictated by the script's ./configure flags
# (see _do_configure_pg in tests/run-multi-pg-installcheck.sh):
#
# --with-icu -> libicu-dev
# --with-openssl -> libssl-dev
# --with-readline -> libreadline-dev
# --with-zstd -> libzstd-dev
# --with-lz4 -> liblz4-dev
# (default zlib) -> zlib1g-dev
# parser/scanner -> bison, flex
# ICU pkg detect -> pkg-config (preinstalled, listed for clarity)
#
# Everything else the script touches -- gcc, make, perl, git, rsync,
# ca-certificates -- is preinstalled on ubuntu-latest. If you change
# the configure command in the script, sync this list with it.
#

name: Installcheck (multi-PG mesh)
run-name: Multi-PG mesh installcheck + sync_event verification

on:
workflow_dispatch: # manual: "Run workflow" button in the UI
push: # automatic: every commit on every branch
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'mkdocs.yml'

permissions:
contents: read

jobs:
installcheck-multi-pg:
runs-on: ubuntu-latest
timeout-minutes: 90

steps:
- name: Checkout spock
uses: actions/checkout@v4
Comment on lines +49 to +50
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

Set persist-credentials: false to prevent credential leakage.

The checkout action should explicitly set persist-credentials: false to ensure the GitHub token is not persisted to disk after checkout completes. While the artifacts being uploaded are only logs and test output (not the git checkout itself), this is a security best practice to prevent accidental credential exposure.

🔒 Proposed fix
       - name: Checkout spock
         uses: actions/checkout@v4
+        with:
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Checkout spock
uses: actions/checkout@v4
- name: Checkout spock
uses: actions/checkout@v4
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 49-50: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 50-50: 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/installcheck-multi-pg.yml around lines 49 - 50, Update the
GitHub Actions checkout step named "Checkout spock" (the actions/checkout@v4
usage) to include persist-credentials: false to avoid persisting the
GITHUB_TOKEN to disk; locate the step with name "Checkout spock" and add a
persist-credentials: false key under that step (properly indented) so the
checkout action explicitly disables credential persistence.

Comment on lines +52 to +53
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
set -euo pipefail

for repo in actions/checkout actions/upload-artifact; do
  type="$(gh api "repos/${repo}/git/ref/tags/v4" --jq '.object.type')"
  sha="$(gh api "repos/${repo}/git/ref/tags/v4" --jq '.object.sha')"

  if [ "$type" = tag ]; then
    sha="$(gh api "repos/${repo}/git/tags/${sha}" --jq '.object.sha')"
  fi

  printf '%s@v4 -> %s\n' "$repo" "$sha"
done

Repository: pgEdge/spock

Length of output: 191


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/installcheck-multi-pg.yml"

echo "== File excerpt around lines 45-85 =="
nl -ba "$FILE" | sed -n '45,85p'

echo
echo "== All uses of `@v4` in that workflow =="
rg -n "uses:\s*.*`@v4`" "$FILE" || true

echo
echo "== All uses of actions/checkout@v4 and actions/upload-artifact@v4 =="
rg -n "uses:\s*actions/(checkout|upload-artifact)`@v4`" "$FILE" || true

Repository: pgEdge/spock

Length of output: 155


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/installcheck-multi-pg.yml"

echo "== File excerpt around lines 45-85 =="
awk 'NR>=45 && NR<=85 {printf "%5d %s\n", NR, $0}' "$FILE"

echo
echo "== All uses of `@v4` in that workflow =="
rg -n "uses:\s*.*`@v4`" "$FILE" || true

echo
echo "== All uses of actions/checkout@v4 and actions/upload-artifact@v4 =="
rg -n "uses:\s*actions/(checkout|upload-artifact)`@v4`" "$FILE" || true

Repository: pgEdge/spock

Length of output: 1850


Pin GitHub Actions versions to immutable SHAs.

This workflow uses mutable tags:

  • Line 53: actions/checkout@v4actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
  • Line 73: actions/upload-artifact@v4actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 52-53: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 53-53: 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/installcheck-multi-pg.yml around lines 52 - 53, The
workflow uses mutable action tags; replace the tagged usages of the actions with
the provided immutable commit SHAs so the steps "uses: actions/checkout@v4" and
"uses: actions/upload-artifact@v4" are updated to "uses:
actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5" and "uses:
actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02" respectively
to pin the actions to immutable SHAs.


- name: Install build dependencies
run: |
sudo apt-get update -qq
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
bison flex pkg-config \
libicu-dev libssl-dev libreadline-dev \
libzstd-dev liblz4-dev zlib1g-dev

- name: Run multi-PG installcheck
run: |
# BASE_DIR defaults to <repo>/multi-pg-installcheck which in CI
# is ${GITHUB_WORKSPACE}/multi-pg-installcheck -- exactly the
# paths the upload-artifact step below points at.
./tests/run-multi-pg-installcheck.sh --jobs "$(nproc)"

- name: Collect logs on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: installcheck-multi-pg-logs
path: |
multi-pg-installcheck/log/**
multi-pg-installcheck/src/pg15/src/test/regress/regression.diffs
multi-pg-installcheck/src/pg15/src/test/regress/regression.out
if-no-files-found: ignore
retention-days: 7
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ spock.control
tags
.vscode
tmp/

# Multi-PG installcheck test rig (tests/run-multi-pg-installcheck.sh).
# Contains per-version PG clones, builds, installs, PGDATA dirs and logs;
# can grow to several gigabytes. Always ignored -- re-create by running
# the script. Deliberately not dot-prefixed so the directory is visible
# in Finder / ls and easy to inspect.
multi-pg-installcheck/
Loading
Loading