Skip to content

feat(confluence): return page content in get page version tool#3344

Merged
waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1/confluence-version-data
Feb 25, 2026
Merged

feat(confluence): return page content in get page version tool#3344
waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1/confluence-version-data

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Get Page Version tool now returns actual page content (title, body, cleaned text) alongside version metadata
  • Makes a parallel API call to GET /pages/{id}?version={N}&body-format=storage to fetch page data at that version
  • Extracted cleanHtmlContent utility from existing transformPageData for reuse
  • Gracefully degrades if page content fetch fails (returns null fields, version metadata still works)

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 25, 2026 9:47pm

Request Review

@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/confluence-version-data branch from d5174c2 to c459052 Compare February 25, 2026 21:43
@waleedlatif1 waleedlatif1 force-pushed the waleedlatif1/confluence-version-data branch from c459052 to 83d211a Compare February 25, 2026 21:44
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

This PR enhances the Get Page Version tool to return page content (title, body, cleaned text) alongside version metadata by making a parallel API call to fetch the page at the specific version. The implementation includes:

  • Parallel API calls using Promise.all to fetch both version metadata and page content simultaneously
  • Extracted cleanHtmlContent utility function from transformPageData for code reuse
  • Graceful degradation when page content fetch fails (returns null fields while version metadata still works)
  • New output fields: title, content, and body added to tool response

The code follows existing patterns in the codebase and handles errors appropriately.

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk
  • The changes are well-structured and follow established patterns. The parallel API calls improve performance, error handling is appropriate with graceful degradation, and the utility extraction promotes code reuse. Minor confidence deduction due to lack of automated tests.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/api/tools/confluence/page-versions/route.ts Added parallel API call to fetch page content alongside version metadata; gracefully degrades if page fetch fails
apps/sim/tools/confluence/get_page_version.ts Added output fields for title, content, and body to match API response; updated type definitions and imports
apps/sim/tools/confluence/utils.ts Extracted cleanHtmlContent utility from transformPageData for reuse; no behavioral changes to existing code

Sequence Diagram

sequenceDiagram
    participant Client
    participant API as page-versions/route
    participant Confluence as Confluence API
    
    Client->>API: POST /api/tools/confluence/page-versions<br/>{pageId, versionNumber}
    API->>API: Validate inputs
    
    par Parallel Fetch
        API->>Confluence: GET /versions/{versionNumber}
        Confluence-->>API: Version metadata
    and
        API->>Confluence: GET /pages/{id}?version={N}
        Confluence-->>API: Page content at version
    end
    
    API->>API: Extract title, body from page data
    API->>API: cleanHtmlContent(rawContent)
    API-->>Client: {version, title, content, body}
Loading

Last reviewed commit: 83d211a

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit f625482 into staging Feb 25, 2026
2 of 3 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/confluence-version-data branch February 25, 2026 21:45
waleedlatif1 added a commit that referenced this pull request Feb 25, 2026
* feat(confluence): return page content in get page version tool

* lint
waleedlatif1 added a commit that referenced this pull request Feb 25, 2026
* feat(workflow): lock/unlock workflow from context menu and panel

* lint

* fix(workflow): prevent duplicate lock notifications, no-op guard, fix orphaned JSDoc

* improvement(workflow): memoize hasLockedBlocks to avoid inline recomputation

* feat(google-translate): add Google Translate integration (#3337)

* feat(google-translate): add Google Translate integration

* fix(google-translate): api key as query param, fix docsLink, rename tool file

* feat(google): add missing tools for Gmail, Drive, Sheets, and Calendar (#3338)

* feat(google): add missing tools for Gmail, Drive, Sheets, and Calendar

* fix(google-drive): remove dead transformResponse from move tool

* feat(confluence): return page content in get page version tool (#3344)

* feat(confluence): return page content in get page version tool

* lint

* feat(api): audit log read endpoints for admin and enterprise (#3343)

* feat(api): audit log read endpoints for admin and enterprise

* fix(api): address PR review — boolean coercion, cursor validation, detail scope

* ran lint

* unified list of languages for google translate

* fix(workflow): respect snapshot view for panel lock toggle, remove unused disableAdmin prop

* improvement(canvas-menu): remove lock icon from workflow lock toggle

* feat(audit): record audit log for workflow lock/unlock
waleedlatif1 added a commit that referenced this pull request Feb 26, 2026
* feat(workflow): lock/unlock workflow from context menu and panel

* lint

* fix(workflow): prevent duplicate lock notifications, no-op guard, fix orphaned JSDoc

* improvement(workflow): memoize hasLockedBlocks to avoid inline recomputation

* feat(google-translate): add Google Translate integration (#3337)

* feat(google-translate): add Google Translate integration

* fix(google-translate): api key as query param, fix docsLink, rename tool file

* feat(google): add missing tools for Gmail, Drive, Sheets, and Calendar (#3338)

* feat(google): add missing tools for Gmail, Drive, Sheets, and Calendar

* fix(google-drive): remove dead transformResponse from move tool

* feat(confluence): return page content in get page version tool (#3344)

* feat(confluence): return page content in get page version tool

* lint

* feat(api): audit log read endpoints for admin and enterprise (#3343)

* feat(api): audit log read endpoints for admin and enterprise

* fix(api): address PR review — boolean coercion, cursor validation, detail scope

* ran lint

* unified list of languages for google translate

* fix(workflow): respect snapshot view for panel lock toggle, remove unused disableAdmin prop

* improvement(canvas-menu): remove lock icon from workflow lock toggle

* feat(audit): record audit log for workflow lock/unlock
@waleedlatif1 waleedlatif1 restored the waleedlatif1/confluence-version-data branch February 26, 2026 00:22
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