Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: tests
on:
pull_request:
push: { branches: master }
push: { branches: main }

jobs:
test:
name: Run tests
strategy:
matrix:
postgres: ["15.1.1.13"]
postgres: ["15.14.1.169", "17.6.1.169"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build docker images
run: PG_VERSION=${{ matrix.postgres }} docker compose -f dockerfiles/docker-compose.yml build
run: SUPABASE_VERSION=${{ matrix.postgres }} docker compose -f dockerfiles/docker-compose.yml build

- name: Run tests
run: PG_VERSION=${{ matrix.postgres }} docker compose -f dockerfiles/docker-compose.yml run test
run: SUPABASE_VERSION=${{ matrix.postgres }} docker compose -f dockerfiles/docker-compose.yml run test
4 changes: 1 addition & 3 deletions bin/compile_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@
import compile # noqa: E402 (bin/compile.py; import after sys.path setup)

NAME_RE = re.compile(r"'([a-z0-9_]+)'\s+as\s+name", re.IGNORECASE)
CATEGORIES_RE = re.compile(
r"array\[(.*?)\]\s+as\s+categories", re.IGNORECASE | re.DOTALL
)
CATEGORIES_RE = re.compile(r"array\[([^\]]*)\]\s+as\s+categories", re.IGNORECASE)


def extract_name(stem: str, query: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG SUPABASE_VERSION=15.1.1.13
ARG SUPABASE_VERSION=15.14.1.169
FROM supabase/postgres:${SUPABASE_VERSION}

WORKDIR /home/splinter
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
context: ..
dockerfile: ./dockerfiles/Dockerfile
args:
PG_VERSION: ${SUPABASE_VERSION:-15.1.1.13}
SUPABASE_VERSION: ${SUPABASE_VERSION:-15.14.1.169}
healthcheck:
test: pg_isready -U postgres -h localhost
interval: 5s
Expand Down
16 changes: 8 additions & 8 deletions test/expected/0022_extension_versions_outdated.out
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ begin;
1
(1 row)

-- Test that the query returns proper column structure
-- This will help ensure the lint is properly formed
-- Verify the stable columns. The available (default) version is excluded
-- so the test doesn't depend on the amcheck version in the running image.
select
name,
title,
level,
facing,
categories,
description,
detail,
remediation,
metadata,
cache_key
cache_key,
metadata - 'default_version' as metadata,
detail like 'Extension `amcheck` is using version `1.0`%' as detail_reports_installed_version
from lint."0022_extension_versions_outdated";
name | title | level | facing | categories | description | detail | remediation | metadata | cache_key
-----------------------------+-----------------------------+-------+----------+------------+--------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+-----------------------------------------
extension_versions_outdated | Extension Versions Outdated | WARN | EXTERNAL | {SECURITY} | Detects extensions that are not using the default (recommended) version. | Extension `amcheck` is using version `1.0` but version `1.3` is available. Using outdated extension versions may expose the database to security vulnerabilities. | https://supabase.com/docs/guides/database/database-linter?lint=0022_extension_versions_outdated | {"extension_name": "amcheck", "default_version": "1.3", "installed_version": "1.0"} | extension_versions_outdated_amcheck_1.0
name | title | level | facing | categories | description | remediation | cache_key | metadata | detail_reports_installed_version
-----------------------------+-----------------------------+-------+----------+------------+--------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------------------------+-----------------------------------------------------------+----------------------------------
extension_versions_outdated | Extension Versions Outdated | WARN | EXTERNAL | {SECURITY} | Detects extensions that are not using the default (recommended) version. | https://supabase.com/docs/guides/database/database-linter?lint=0022_extension_versions_outdated | extension_versions_outdated_amcheck_1.0 | {"extension_name": "amcheck", "installed_version": "1.0"} | t
(1 row)

drop extension amcheck;
Expand Down
10 changes: 5 additions & 5 deletions test/sql/0022_extension_versions_outdated.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ begin;
count(*) as total_outdated_extensions
from lint."0022_extension_versions_outdated";

-- Test that the query returns proper column structure
-- This will help ensure the lint is properly formed
-- Verify the stable columns. The available (default) version is excluded
-- so the test doesn't depend on the amcheck version in the running image.
select
name,
title,
level,
facing,
categories,
description,
detail,
remediation,
metadata,
cache_key
cache_key,
metadata - 'default_version' as metadata,
detail like 'Extension `amcheck` is using version `1.0`%' as detail_reports_installed_version
from lint."0022_extension_versions_outdated";

drop extension amcheck;
Expand Down
Loading