Skip to content

Add page version history, restore and watch commands#2

Merged
AngelMsger merged 1 commit into
mainfrom
feature/page-history-and-watchers
May 18, 2026
Merged

Add page version history, restore and watch commands#2
AngelMsger merged 1 commit into
mainfrom
feature/page-history-and-watchers

Conversation

@AngelMsger
Copy link
Copy Markdown
Owner

What

Tier 2 of the practical-coverage roadmap — page history/restore and watchers.

Stacked on #1 (tier 1). This branch is cut from the tier-1 branch, so
until #1 merges this PR's diff also contains tier-1's commit. Review the
feature/page-history-and-watchers commit for the tier-2 changes.

Version history

  • page history <page> — list a page's versions (newest first)
  • page restore <page> --version N [--message ...] — roll a page back

Restore has no native v1 endpoint, so it fetches version N's body and
republishes it as a new version through the existing buildUpdatePage
machinery — non-destructive, the history is kept. Supports --dry-run.

Watchers (self)

  • page watch / page unwatch — subscribe / unsubscribe the authenticated user
  • page watch-status — report whether you watch the page

The v1 /user/watch/content/{id} endpoints act on the credentialed user when
no user is passed, so no current-user resolution is needed. watch / unwatch
support --dry-run. Listing all watchers of a page was deliberately left out
— v1 has no reliable public endpoint for it.

Design notes

  • Each write op has a build* helper shared with DescribeWrite, so the
    --dry-run preview matches the sent request.
  • v1 endpoints — work on both Cloud and Data Center.

Verification

  • gofmt / go vet / go test ./... all green; new tests cover the apiclient
    methods (history list, restore's GET-then-PUT, watch GET/POST/DELETE, dry-run
    plans) and the CLI commands.
  • make docs regenerated; generator is idempotent.
  • Manual --dry-run smoke tests for restore / watch / unwatch.
  • No live Confluence instance was available — HTTP paths are covered by
    httptest-based unit tests.

Roadmap tier 3 (page restrictions, space writes, comment edit/delete, whoami,
blogs, PDF export) remains a follow-up.

🤖 Generated with Claude Code

Implements tier 2 of the practical-coverage roadmap.

Version history — `page history` lists a page's versions; `page restore
--version N` rolls a page back. Restore has no native v1 endpoint, so it
fetches version N's body and republishes it as a new version via the existing
buildUpdatePage machinery — non-destructive, the history is kept. `restore`
supports `--dry-run`.

Watchers — `page watch` / `page unwatch` subscribe or unsubscribe the
authenticated user (the v1 user-watch endpoints act on the credentialed user,
so no current-user resolution is needed); `page watch-status` reports whether
you watch a page. `watch` / `unwatch` support `--dry-run`.

Each write op exposes a build* helper shared with `DescribeWrite`, keeping the
--dry-run preview in lock-step with the sent request. Regenerates the CLI
reference and updates the embedded confluence Skill.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@AngelMsger AngelMsger merged commit 99bc5fc into main May 18, 2026
1 check passed
@AngelMsger AngelMsger deleted the feature/page-history-and-watchers branch May 18, 2026 17:37
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.

1 participant