Skip to content

ci: resolve package install sha from a flake input - #2327

Merged
brainrake merged 2 commits into
developfrom
marton/fix-git-sha-flake-ref
Jul 31, 2026
Merged

ci: resolve package install sha from a flake input#2327
brainrake merged 2 commits into
developfrom
marton/fix-git-sha-flake-ref

Conversation

@brainrake

@brainrake brainrake commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Workflows that install nix packages via github:supabase/postgres/<sha>#pkg use the run's own commit sha. That breaks when the exact same workflow file runs in a different repo.

Adds a resolve-git-sha composite action: if a GIT_SHA_FROM_FLAKE_INPUT repo variable names a flake input, resolves that input's pinned rev from flake.lock; otherwise falls back to github.sha unchanged. Wired into the four workflows that construct these install refs (ami-release-nix.yml, testinfra-ami-build.yml, qemu-image-build.yml, test.yml).

build-ami/action.yml gets a second input, packages_git_sha, kept separate from git_sha (AMI identity tag, used for cache lookups, must stay the triggering commit) so the two don't get conflated.

No effect here: the variable is never set in this repo, so every site falls through to github.sha exactly as today.

Workflows that install nix packages from github:supabase/postgres/<sha>
hardcode the run's own commit sha, which breaks when the same workflow
runs in a repo whose flake re-exports this one. Adds resolve-git-sha,
which falls back to the flake input pinned in flake.lock when a repo
variable names one, else uses github.sha unchanged.
@brainrake
brainrake requested review from a team as code owners July 31, 2026 00:05
@brainrake brainrake changed the title ci: resolve package install sha from a flake input override ci: resolve package install sha from a flake input Jul 31, 2026
@brainrake
brainrake added this pull request to the merge queue Jul 31, 2026
Merged via the queue into develop with commit 35a5471 Jul 31, 2026
43 checks passed
@brainrake
brainrake deleted the marton/fix-git-sha-flake-ref branch July 31, 2026 13:56
@mmlb

mmlb commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

How in the world did this PR break my branch/PR...https://github.com/supabase/postgres/actions/runs/30667526580/job/91279509777?pr=2326

@mmlb

mmlb commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

ugghhh its because testinfra workflow has uses: supabase/postgres/.github/actions/shared-checkout@HEAD which changes the git workdir from github's synthetic merge commit for PRs back to the HEAD commit of the branch but nix-build workflow does not and there's a disagreement of what workflows/actions are "supposed to exist in .github/" at that point. nix-build is using synthetic merge commit and kicks off a testinfra that has a resolve-git-sha step, but then testinfra runs and checks out my branch's HEAD which does not have the action and boom failure...

hunleyd added a commit that referenced this pull request Aug 8, 2026
…c-spool-path-defaults-onto-the-10gb-root-volume

* origin/develop: (26 commits)
  Lots of bootstrap script clean ups (#2326)
  ci: Fix nix-build PUSH_TO_CACHE (#2345)
  ci/nix-install-ephemeral: Drop sticky disk config (#2346)
  chore: bump postgres_release to cut fresh AMIs (includes #2334) (#2349)
  fix(multigres): stop base config data_directory from overriding pooler data dir (#2344)
  fix(cron): remove unnecessary TRIGGER grant on cron.job_run_details from postgres (#2334)
  chore: enable extension version restriction (warn) and cut AMIs (#2315)
  feat(nix): add site-env packages for rolling instance updates (#2283)
  ci: resolve package install sha from a flake input override (#2327)
  fix(multigres): remove dangling wal-g include from postgresql.conf (#2338)
  fix: Allow test CI pipelines to use old Int CA access. For staging only (#2330)
  chore(nix): remove maintainers field from package definitions (#2280)
  chore: bump multigres to b713432 (#2323)
  ci: Use arm-native-runner for kvm builds on aarch64-linux (#2319)
  Whole lot of ansible clean up (#2272)
  fix(ansible): drop no-op zpool loop item from zswap task (#2322)
  ci: Fix dockerhub-release-matrix matrix generation (#2320)
  chore: bump pgctld (#2318)
  fix(ansible): skip zswap params the kernel does not expose (#2321)
  feat(docker): add Dockerfile-supabase base image and rewrite Dockerfile-multigres as layered image (#2160)
  ...
hunleyd added a commit that referenced this pull request Aug 8, 2026
…nix-pkg-for-pgbackrest

* origin/develop: (36 commits)
  Lots of bootstrap script clean ups (#2326)
  ci: Fix nix-build PUSH_TO_CACHE (#2345)
  ci/nix-install-ephemeral: Drop sticky disk config (#2346)
  chore: bump postgres_release to cut fresh AMIs (includes #2334) (#2349)
  fix(multigres): stop base config data_directory from overriding pooler data dir (#2344)
  fix(cron): remove unnecessary TRIGGER grant on cron.job_run_details from postgres (#2334)
  chore: enable extension version restriction (warn) and cut AMIs (#2315)
  feat(nix): add site-env packages for rolling instance updates (#2283)
  ci: resolve package install sha from a flake input override (#2327)
  fix(multigres): remove dangling wal-g include from postgresql.conf (#2338)
  fix: Allow test CI pipelines to use old Int CA access. For staging only (#2330)
  chore(nix): remove maintainers field from package definitions (#2280)
  chore: bump multigres to b713432 (#2323)
  ci: Use arm-native-runner for kvm builds on aarch64-linux (#2319)
  Whole lot of ansible clean up (#2272)
  fix(ansible): drop no-op zpool loop item from zswap task (#2322)
  ci: Fix dockerhub-release-matrix matrix generation (#2320)
  chore: bump pgctld (#2318)
  fix(ansible): skip zswap params the kernel does not expose (#2321)
  feat(docker): add Dockerfile-supabase base image and rewrite Dockerfile-multigres as layered image (#2160)
  ...
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.

3 participants