Skip to content

Restore unarchived documents as drafts#1274

Draft
gearnode wants to merge 2 commits into
mainfrom
cursor/unarchive-documents-as-draft-eda9
Draft

Restore unarchived documents as drafts#1274
gearnode wants to merge 2 commits into
mainfrom
cursor/unarchive-documents-as-draft-eda9

Conversation

@gearnode

@gearnode gearnode commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Ensure unarchiving a published document creates a latest draft version.
  • Apply the same draft restoration behavior to bulk unarchive for documents that were archived.
  • Wrap bulk unarchive errors with contextual messages.
  • Add console e2e coverage for publishing, archiving, and unarchiving a document.

Testing

  • make go-fmt
  • make bin/probod
  • go test ./pkg/probo -run TestDoesNotExist -count=0
  • go test -c ./e2e/console -o /tmp/console.test
  • Attempted: PROBO_E2E_BINARY=/workspace/bin/probod PROBO_E2E_CONFIG=/workspace/e2e/console/testdata/config.yaml go test ./e2e/console -run TestDocument_UnarchivePublishedDocumentCreatesDraft -count=1 (blocked: local PostgreSQL/Docker stack unavailable; docker is not installed in this environment)
Open in Web Open in Cursor 

Summary by cubic

Unarchiving a document now restores a latest draft for both single and bulk actions. Adds console e2e coverage to verify publish → archive → unarchive creates a draft and reactivates the document.

Service +102 -3

  • Bulk and single unarchive run in a transaction, ensure the latest version is a draft, and wrap errors with context.
  • Pending approvals are voided and converted to a draft with the next minor (or 0.1 if none).
  • From a published version, a new draft is created after unarchive.

Tests +112 -0

  • Added e2e test confirming unarchiving a published document creates draft v1.1 and sets status to ACTIVE.

Written for commit 295bf81. Summary will update on new commits.

Review in cubic

cursoragent and others added 2 commits May 30, 2026 00:48
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants