Skip to content

fix(postgresql): preserve pgdump restore owners and privileges - #3440

Draft
weicao wants to merge 2 commits into
release-1.1from
easton/pgdump-owner-acl-release11
Draft

fix(postgresql): preserve pgdump restore owners and privileges#3440
weicao wants to merge 2 commits into
release-1.1from
easton/pgdump-owner-acl-release11

Conversation

@weicao

@weicao weicao commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Design

  • DOC-57@v1
  • Restore owners and privileges by default.
  • Add independent, explicit skip_owner and skip_privileges boolean opt-outs, both defaulting to false.
  • Do not synthesize missing PostgreSQL roles or downgrade a missing-role restore failure.

Exact identities

  • target: release-1.1
  • base: ea888871004fe19cef503e1585014bc233dd4444
  • head: 8fc8d2ae61d3bcb4c9bd4c64d15da30fdff2407d
  • tree: 2b3c317e71bc5f7079c90f1f59fd14f2ce0544e1
  • compare: ahead 2 / behind 0; merge-base equals base
  • final spec blob: e395b24f2651eea686294988d812474407d57911
  • sibling release-1.0 candidate: fix(postgresql): preserve pgdump restore owners and privileges #3441

TDD evidence

  • RED on the exact base: focused ShellSpec 6 examples / 4 failures. The old script always supplied both skip flags, independent opt-outs could not work, and the ActionSet exposed neither parameter.
  • Review B1 reproduced on product head 8d58116b: skip_owner.default false -> true and skip_privileges.type boolean -> string each falsely stayed 6/0.
  • B1 closed in the final spec: each property now has its own structured type/default assertions; the two mutants fail independently at 6/1, while the candidate remains 6/0.
  • GREEN focused: Bash 3.2 6/0; Bash 5.3 6/0.
  • GREEN PostgreSQL full: Bash 3.2 10/0; Bash 5.3 15/0.
  • GREEN repository full on the exact head: Bash 5.3 717/0.
  • ShellCheck (--severity=error), Bash 3.2/5.3 bash -n, git diff --check: pass.
  • Helm lint: 1 chart / 0 failures.
  • Helm render: 44 documents / 839371 bytes. Both properties are boolean with default: false, and both names are present in restore.withParameters.
  • Hosted CI on the exact head: 8/8 SUCCESS.

Runtime boundary

Runtime acceptance remains Fixed Test-owned and UNKNOWN in this source PR. The authorized remote test must use a real archive and separately prove:

  1. default restore preserves an application object's owner and GRANT/REVOKE behavior;
  2. skip_owner=true changes only ownership restoration;
  3. skip_privileges=true changes only ACL restoration;
  4. a missing archived role fails by default rather than silently dropping owner/ACL.

Local stubs are source-contract evidence only and are not a runtime substitute.

@weicao weicao added the nopick Not auto cherry-pick when PR merged label Aug 31, 2026
@codecov-commenter

codecov-commenter commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 87 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (ea88887) to head (8fc8d2a).

Files with missing lines Patch % Lines
.../postgresql/scripts-ut-spec/pgdump_restore_spec.sh 0.00% 87 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           release-1.1   #3440   +/-   ##
===========================================
  Coverage         0.00%   0.00%           
===========================================
  Files               80      81    +1     
  Lines            10053   10140   +87     
===========================================
- Misses           10053   10140   +87     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nopick Not auto cherry-pick when PR merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants