Skip to content

fix(search): read Confluence pages through the v2 API the Search grant allows - #8321

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/confluence-v2-reads
Sep 26, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/confluence-v2-reads

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Every live Confluence read failed ("Unable to complete this operation"): read_document called the v1 GET /wiki/rest/api/content/{id}?expand=body.view, which Atlassian denies for Search connections because their granular grant lacks read:content-details:confluence
  • Reads now use the v2 page and blog post endpoints (/wiki/api/v2/pages/{id} / blogposts/{id} with body-format=view), which need only read:page:confluence / read:blogpost:confluence — both already granted
  • Search results now record whether a hit is a page, blog post, or space (CQL can return spaces), so the read picks the right endpoint; a space reads as its homepage
  • The member verifier for space-restricted policies had the same v1 dependency; it now resolves the space key through v2 (page → spaceId → space)
  • Service-account verification (separate admin credential) is unchanged

Type of Change

  • Bug fix

Testing

Response shapes checked against a public Confluence Cloud site's v2 API. New tests fail on the old code and pass on the new; live-search suite (237), lint, 51 audits and type-check pass

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

vercel Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 26, 2026 10:02am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/policy.ts
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High risk] Changes how Confluence pages are fetched from the API.

The PR appears safe to merge; no outstanding previous finding or new actionable issue remains.

Summary

The PR moves Confluence document and space-policy reads to v2 endpoints, records search-result kinds for page, blog-post, and space reads, and adds client-level coverage for HTTP status propagation.

  • The change since the previous review adds a test for the 404 and 500 status mapping.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Confluence search result] --> B{Kind}
  B -->|Page| C[v2 pages read]
  B -->|Blog post| D[v2 blogposts read]
  B -->|Space| E[v2 space lookup]
  E --> C
Loading

Reviews (4) · Last reviewed commit: "test(search): check that provider failur..."

Comment thread apps/sim/lib/sim-search/live/atlassian.ts
Comment thread apps/sim/lib/sim-search/live/atlassian.test.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/atlassian.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/atlassian.test.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit a0c93d6 into staging Sep 26, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/confluence-v2-reads branch September 26, 2026 15:48

This branch was previously deployed

1 inactive deployment
Preview — a9480f36 Deployed Sep 26, 2026 by vercel[bot]
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