Repository navigation
fix(database): Team Reports fails to port to PostgreSQL after a successful dry run - #190124
Conversation
Co-authored-by: etzelm <[email protected]>
Co-authored-by: etzelm <[email protected]>
…ssful dry run Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 3a013d3e-391a-435f-97ed-7eb6d08ccf92
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 2d03c461-6f96-4e07-900e-48b00d89efcb
|
ClawSweeper's input-safety hold on this PR comes from a pre-existing synthetic fixture on
Could a maintainer either qualify this fixture in clawsweeper Items worth covering in the evidence once review runs:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge current main into the existing PR branch and resolve the moved anchor reader. Preserve each validator's case policy and accept the hyphen in local-companion backup verification. Retain the PostgreSQL port round trip and quoted catalog normalization. Co-authored-by: etzelm <[email protected]>
|
Reopened because the Team Reports schema name still breaks PostgreSQL archive and Git backups and stops |
Use a dot in the malformed namespace fixture now that PostgreSQL store anchors accept the hyphen in Team Reports namespaces.
|
Merged via squash.
|
…ssful dry run (openclaw#190124) * Save workspace before refreshing its selected base Co-authored-by: etzelm <[email protected]> * fix(database): Team Reports fails to port to PostgreSQL after a successful dry run Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 3a013d3e-391a-435f-97ed-7eb6d08ccf92 * Publish openclaw/pg-team-reports-port-namespace Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 2d03c461-6f96-4e07-900e-48b00d89efcb * test(database): keep the backup anchor refusal case invalid Use a dot in the malformed namespace fixture now that PostgreSQL store anchors accept the hyphen in Team Reports namespaces. --------- Co-authored-by: etzelm <[email protected]> Co-authored-by: VACInc <[email protected]>
…ssful dry run (#190124) * Save workspace before refreshing its selected base Co-authored-by: etzelm <[email protected]> * fix(database): Team Reports fails to port to PostgreSQL after a successful dry run Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 3a013d3e-391a-435f-97ed-7eb6d08ccf92 * Publish openclaw/pg-team-reports-port-namespace Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 2d03c461-6f96-4e07-900e-48b00d89efcb * test(database): keep the backup anchor refusal case invalid Use a dot in the malformed namespace fixture now that PostgreSQL store anchors accept the hyphen in Team Reports namespaces. --------- Co-authored-by: etzelm <[email protected]> Co-authored-by: VACInc <[email protected]> (cherry picked from commit ced77ff) Co-authored-by: RomneyDa <[email protected]>
…ssful dry run (openclaw#190124) * Save workspace before refreshing its selected base Co-authored-by: etzelm <[email protected]> * fix(database): Team Reports fails to port to PostgreSQL after a successful dry run Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 3a013d3e-391a-435f-97ed-7eb6d08ccf92 * Publish openclaw/pg-team-reports-port-namespace Worked on by: - @etzelm Co-authored-by: etzelm <[email protected]> OpenClaw-Publication: 2d03c461-6f96-4e07-900e-48b00d89efcb * test(database): keep the backup anchor refusal case invalid Use a dot in the malformed namespace fixture now that PostgreSQL store anchors accept the hyphen in Team Reports namespaces. --------- Co-authored-by: etzelm <[email protected]> Co-authored-by: VACInc <[email protected]> (cherry picked from commit ced77ff) Release adaptation: Port existing physical anchor/recovery namespace validation and quoted catalog normalization. Exclude local-companion manifest parser and its tests because baseline lacks that feature; audit corrected on actual application. Existing backup/port regressions retained; no DDL. Co-authored-by: RomneyDa <[email protected]>
…ssful dry run (#190124) Baseline adaptation: Normalize quoted PostgreSQL catalog qualifiers and admit the Team Reports namespace at the branch-local backup anchor and port recovery readers; retain generated port_ destinations and the baseline catalog fact filter. (cherry picked from commit ced77ff) Co-authored-by: RomneyDa <[email protected]>
Summary
High Level TLDR
Backups and database port now accept the PostgreSQL schema name that Team Reports already uses. The schema name and its stored data stay in place.
What Problem This Solves
A Team Reports SQLite-to-PostgreSQL dry run can succeed, then the actual port fails before staging. Once Team Reports is on PostgreSQL, archive and Git backup also reject its SQLite anchor.
User Impact
Team Reports can keep its existing PostgreSQL schema when making backups, resuming a port, or porting back to SQLite.
Why This Change Was Made
Root Cause
The namespace builder includes the store ID
team-reportsin the schema name. PostgreSQL accepts it as a quoted identifier. The anchor and recovery manifest validators excluded its hyphen, and the local-companion backup manifest had the same restriction. PostgreSQL also includes quotes when it deparses these schema references, so the port catalog check removes that quoting when comparing with its reference schema.The validators retain their original rules for the first character and letter case. The port and backup round trips preserve the name. Original investigation and patch by etzelm.
Evidence
Real behavior proof
On the base, the Team Reports dry run found the store. The real port then failed at
Database port capture originals. The local-companion backup case failed withBackup manifest contains an invalid PostgreSQL anchor.On disposable PostgreSQL 16, the focused round-trip test returned
1 passed. It ran dry run, interrupted publication, resumed against the same quoted schema, and returned to SQLite with the original 64-bit value and unchanged neighboring store.Reproduce the PostgreSQL proof
Verification
The focused TypeScript, lint, formatting, and whitespace checks passed. Local recovery, update-capture and backup tests passed, including offline verification and restore of an anchor containing a hyphen.
The five local suites passed all 156 tests on PostgreSQL 16.16 with the same database extensions as CI. The earlier local
OWNER_UNAVAILABLEfailure also reproduced on main. The test database lacked theunaccentextension. After provisioning the test database with the CI extensions, all eight mixed-family port cases passed.The first CI run caught an older backup test that used a hyphen as its invalid character. The follow-up changes that fixture to a dot. All 12 tests in
src/snapshot/database-backup.test.tspassed locally after that change.What was not tested
The Git backup and Gateway lock recovery call paths were traced to the shared anchor reader. They were not exercised end to end for this change.