Feat v0.5.5 upgrade testing
Some checks failed
CI/CD / detect-changes (pull_request) Successful in 3s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Failing after 2m39s
CI/CD / test-sqlite (pull_request) Successful in 2m44s
CI/CD / build-and-deploy (pull_request) Has been skipped

Upgrade test harness, schema edge case tests, and two bug fixes found
during testing.

New: docker-compose-upgrade.yml + ci/e2e-upgrade-test.sh for single-replica
upgrade testing (seed → upgrade → verify). ci/e2e-upgrade-rolling.sh for
multi-replica rolling upgrade with shared Postgres. 11 Go unit tests for
schema migration edge cases, settings preservation, and package compat.

Fix: Bundled permission auto-grant on Postgres — SQL used SQLite-style
`granted = 1` on BOOLEAN columns. Now dialect-aware (true/false on PG).
Fix: E2E chat test API fields — login, token extraction, profile endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-30 20:27:31 +00:00
parent 4da25350ac
commit 2c792cd3ec
9 changed files with 1445 additions and 14 deletions

View File

@@ -224,9 +224,13 @@ func installBundledPackage(pkgPath, packagesDir string, stores store.Stores, run
// Use direct SQL with NULL granted_by to satisfy FK constraint on users(id).
if len(declaredPerms) > 0 {
now := time.Now().UTC().Format(time.RFC3339)
_, err := database.DB.ExecContext(ctx,
`UPDATE extension_permissions SET granted = 1, granted_by = NULL, granted_at = ? WHERE package_id = ? AND granted = 0`,
now, pkgID)
var grantSQL string
if database.IsPostgres() {
grantSQL = `UPDATE extension_permissions SET granted = true, granted_by = NULL, granted_at = $1 WHERE package_id = $2 AND granted = false`
} else {
grantSQL = `UPDATE extension_permissions SET granted = 1, granted_by = NULL, granted_at = ? WHERE package_id = ? AND granted = 0`
}
_, err := database.DB.ExecContext(ctx, grantSQL, now, pkgID)
if err != nil {
log.Printf("[bundled] Failed to auto-grant permissions for %s: %v", pkgID, err)
}