feat(migrate): configure embedded Goose providers (#14)
Add embedded SQL and provider-local Go migrations with slog logging and Postgres session locking, returning Goose's Provider directly. Cover timestamp and sequential versions, failure recovery, and concurrent startup with SQLite and Postgres tests. Reuse page's Postgres CI service. Document authoring conventions and the Go template compatibility gate. Closes #7 Refs #9
This commit was merged in pull request #14.
This commit is contained in:
1 parent
c45e8abe08
commit
f0439000cb
15 files changed
+805
-56
No files matched your search
+16
-22
@@ -15,6 +15,17 @@ on:
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
env:
|
||||
POSTGRES_PASSWORD: page-test
|
||||
POSTGRES_DB: page_test
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres -d page_test"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 12
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
@@ -26,6 +37,11 @@ jobs:
|
||||
run: test -z "$(gofmt -l .)"
|
||||
- run: go vet ./...
|
||||
- run: go test -race ./...
|
||||
env:
|
||||
CI: "true"
|
||||
MIGRATE_POSTGRES_DSN: postgres://postgres:page-test@postgres:5432/page_test?sslmode=disable
|
||||
PAGE_POSTGRES_DSN: postgres://postgres:page-test@postgres:5432/page_test?sslmode=disable
|
||||
PAGE_REQUIRE_POSTGRES: "1"
|
||||
- name: Require issue URLs in TODO comments
|
||||
run: |
|
||||
find . -type d \( -name .git -o -name node_modules -o -name vendor -o -name generated -o -name gen -o -name target -o -name dist -o -name build -o -name .svelte-kit -o -name .next \) -prune -o -type f \( -name '*.go' -o -name '*.ts' -o -name '*.tsx' -o -name '*.js' -o -name '*.svelte' -o -name '*.rs' -o -name '*.sql' -o -name '*.sh' -o -name '*.proto' -o -name '*.graphql' -o -name '*.yml' -o -name '*.yaml' -o -name '*.toml' \) -exec awk 'match($0, "((^|[^:])[/][/]|[/][*]|(^|[[:space:]])(#|--)|^[[:space:]]*([*]|<!--))") { comment=substr($0, RSTART + RLENGTH); todo=index(comment, "TO" "DO"); if (todo && substr(comment, todo + 4) !~ "https?:[/][/]") { print FILENAME ":" FNR ":" $0; bad=1 } } END { exit bad }' {} + # shortcut: line-based scan can flag comment-like strings and misses multiline issue links, use a parser when these need accurate coverage
|
||||
@@ -41,25 +57,3 @@ jobs:
|
||||
distribution: goreleaser
|
||||
version: v2.19.0
|
||||
args: release --snapshot --clean
|
||||
postgres:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
env:
|
||||
POSTGRES_PASSWORD: page-test
|
||||
POSTGRES_DB: page_test
|
||||
options: >-
|
||||
--health-cmd "pg_isready -U postgres -d page_test"
|
||||
--health-interval 5s
|
||||
--health-timeout 5s
|
||||
--health-retries 12
|
||||
env:
|
||||
PAGE_POSTGRES_DSN: postgres://postgres:page-test@postgres:5432/page_test?sslmode=disable
|
||||
PAGE_REQUIRE_POSTGRES: "1"
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- uses: actions/setup-go@v7.0.0
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- run: go test -race ./page
|
||||
Reference in new issue
Block a user