Skip to content

Commit 3d63bf9

Browse files
committed
chore: rebase and small changes from review
1 parent 7673932 commit 3d63bf9

File tree

3 files changed

+22
-26
lines changed

3 files changed

+22
-26
lines changed

.github/workflows/nix-build.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
include:
27-
- runner: blacksmith-32vcpu-ubuntu-2404
27+
- runner: blacksmith-32vcpu-ubuntu-2404
2828
arch: amd64
2929
- runner: blacksmith-32vcpu-ubuntu-2404-arm
3030
arch: arm64
@@ -56,12 +56,6 @@ jobs:
5656
sudo -E python -c "import os; file = open('/etc/nix/nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()"
5757
env:
5858
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
59-
- name: Setup SSH for deploy key
60-
run: |
61-
mkdir -p ~/.ssh
62-
echo "${{ secrets.GK_DEPLOY_KEY }}" > ~/.ssh/id_ed25519
63-
chmod 600 ~/.ssh/id_ed25519
64-
ssh-keyscan github.com >> ~/.ssh/known_hosts
6559
- name: Setup cache script
6660
if: ${{ github.secret_source == 'Actions' }}
6761
run: |
@@ -116,7 +110,7 @@ jobs:
116110
df -h
117111
- name: Build psql bundle
118112
run: >
119-
nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48"
113+
nix run "github:Mic92/nix-fast-build?rev=b1dae483ab7d4139a6297e02b6de9e5d30e43d48"
120114
-- --skip-cached --no-nom ${{ matrix.runner == 'macos-latest-xlarge' && '--max-jobs 1' || '' }}
121115
--flake ".#checks.$(nix eval --raw --impure --expr 'builtins.currentSystem')"
122116
env:

nix/packages/gatekeeper.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ buildGoModule {
1818
src = pkgs.fetchFromGitHub {
1919
owner = "supabase";
2020
repo = "jit-db-gatekeeper";
21-
rev = "refs/heads/main";
21+
rev = "v1.0.0";
2222
hash = "sha256-hrYh1dBxk+aN3b/J9mZqk/ZXHmWA/MIqZLVgICT7e90=";
2323
};
2424

testinfra/test_ami_nix.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@ def is_healthy(ssh) -> bool:
403403
def test_postgrest_is_running(host):
404404
"""Check if postgrest service is running using our SSH connection."""
405405
result = run_ssh_command(host["ssh"], "systemctl is-active postgrest")
406-
assert (
407-
result["succeeded"] and result["stdout"].strip() == "active"
408-
), "PostgREST service is not running"
406+
assert result["succeeded"] and result["stdout"].strip() == "active", (
407+
"PostgREST service is not running"
408+
)
409409

410410

411411
def test_postgrest_responds_to_requests(host):
@@ -547,9 +547,9 @@ def test_postgresql_version(host):
547547
if version_match:
548548
major_version = int(version_match.group(1))
549549
print(f"PostgreSQL major version: {major_version}")
550-
assert (
551-
major_version >= 14
552-
), f"PostgreSQL version {major_version} is less than 14"
550+
assert major_version >= 14, (
551+
f"PostgreSQL version {major_version} is less than 14"
552+
)
553553
else:
554554
assert False, "Could not parse PostgreSQL version number"
555555
else:
@@ -579,9 +579,9 @@ def test_libpq5_version(host):
579579
if version_match:
580580
major_version = int(version_match.group(1))
581581
print(f"libpq5 major version: {major_version}")
582-
assert (
583-
major_version >= 14
584-
), f"libpq5 version {major_version} is less than 14"
582+
assert major_version >= 14, (
583+
f"libpq5 version {major_version} is less than 14"
584+
)
585585
else:
586586
print("Could not parse libpq5 version from dpkg output")
587587
else:
@@ -614,9 +614,9 @@ def test_libpq5_version(host):
614614
if version_match:
615615
major_version = int(version_match.group(1))
616616
print(f"psql/libpq major version: {major_version}")
617-
assert (
618-
major_version >= 14
619-
), f"psql/libpq version {major_version} is less than 14"
617+
assert major_version >= 14, (
618+
f"psql/libpq version {major_version} is less than 14"
619+
)
620620
else:
621621
print("Could not parse psql version")
622622

@@ -706,9 +706,9 @@ def test_pam_postgresql_config(host):
706706
perms = result["stdout"].strip()
707707
print(f"PAM config permissions: {perms}")
708708
# Should be owned by postgres:postgres with 664 permissions
709-
assert (
710-
"postgres postgres" in perms
711-
), "PAM config not owned by postgres:postgres"
709+
assert "postgres postgres" in perms, (
710+
"PAM config not owned by postgres:postgres"
711+
)
712712
else:
713713
print("\nPAM config file not found")
714714
assert False, "PAM configuration file /etc/pam.d/postgresql not found"
@@ -743,7 +743,7 @@ def test_jit_pam_gatekeeper_profile(host):
743743
# Check if gatekeeper is in the postgres user's Nix profile
744744
result = run_ssh_command(
745745
host["ssh"],
746-
"sudo -u postgres nix profile list 2>/dev/null | grep -i gatekeeper",
746+
"sudo -u postgres nix profile list --json | jq -r '.elements.gatekeeper.storePaths[0]'",
747747
)
748748
if result["succeeded"] and result["stdout"].strip():
749749
print(f"\nGatekeeper found in Nix profile:\n{result['stdout']}")
@@ -998,7 +998,9 @@ def test_postgrest_read_only_session_attrs(host):
998998
print(
999999
f"\nFound 'session is not read-only' errors in PostgREST logs:\n{result['stdout']}"
10001000
)
1001-
assert False, "PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode"
1001+
assert False, (
1002+
"PostgREST logs contain 'session is not read-only' errors even though PostgreSQL is configured for read-only mode"
1003+
)
10021004
else:
10031005
print("\nNo 'session is not read-only' errors found in PostgREST logs")
10041006

0 commit comments

Comments
 (0)