Skip to content

Conversation

@javierbrea
Copy link
Collaborator

Request child pages using pagination

Description

This PR implements a temporary workaround to retrieve all child pages from Confluence when their number exceeds the default API limit (25).

The current confluence.js library does not support pagination in the getContentChildren method, so this solution uses Axios to query the Confluence API directly with manual pagination.

closes #60

Agreement

Please check the following boxes after you have read and understood each item.

  • I have read the CONTRIBUTING document
  • I have read the CODE_OF_CONDUCT document
  • I accept that, by signing the Contributor License Agreement through a comment in the PR, my Github user name will be stored by in a branch of this repository for future reference.

In case this is your first contribution to this project, you will also have to add a comment with the following text: "I have read the CLA Document and I hereby sign the CLA", otherwise the PR status will fail and our bot will request you to add it. Once you have signed it in a PR, you will not have to sign it again for future contributions.

@javierbrea javierbrea self-assigned this Jul 11, 2025
Copilot AI review requested due to automatic review settings July 11, 2025 06:55
@javierbrea javierbrea added the bug Something isn't working label Jul 11, 2025
@github-actions
Copy link

github-actions bot commented Jul 11, 2025

Check SPDX headers

✅ 242 files have valid headers.

@github-actions
Copy link

github-actions bot commented Jul 11, 2025

Check License Compliance

✅ There are 1437 dependencies with allowed licenses.

⚠️ There are 5 dependencies with dangerous licenses:

✅ Result: Valid licenses

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a manual pagination workaround for retrieving child pages from Confluence when their number exceeds the default API limit, and updates mocks, tests, and versioning accordingly.

  • Introduces a _getChildPages method in CustomConfluenceClient that uses Axios and recursion to fetch all child pages.
  • Adds getPageChildrenMiddleware and related route/collection entries in mocks for both repositories.
  • Updates unit and component tests to cover paginated child page retrieval and error scenarios, plus version bumps and CHANGELOG entries.

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
components/markdown-confluence-sync/package.json Bumped version to 2.1.1
components/markdown-confluence-sync/mocks/routes/Confluence.ts Added getPageChildrenMiddleware and new route variants for pagination
components/markdown-confluence-sync/mocks/collections.ts Included child-page routes in mock collections
components/markdown-confluence-sync/CHANGELOG.md Added entry for fixing pages with >25 children
components/confluence-sync/test/unit/specs/confluence/CustomConfluenceClient.test.ts Added tests for recursive child-page fetching and error handling
components/confluence-sync/test/component/specs/Sync.spec.ts Updated component tests to assert paginated child-page requests
components/confluence-sync/src/confluence/CustomConfluenceClient.ts Implemented _getChildPages for recursive pagination
components/confluence-sync/package.json Bumped version to 2.0.2
components/confluence-sync/mocks/routes/Confluence.ts Added getPageChildrenMiddleware and pagination route variants
components/confluence-sync/mocks/collections.ts Updated mock collections to include child-page variants
components/confluence-sync/CHANGELOG.md Documented fix for child pages >25 issue
.github/workflows/publish.yml Removed trailing whitespace
.github/ISSUE_TEMPLATE/BUG.yml Updated bug template to allow selecting versions 1.x or 2.x
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@javierbrea javierbrea merged commit e0516d5 into release Jul 11, 2025
11 checks passed
@javierbrea javierbrea deleted the fix/CROSS-9856/many-child-pages branch July 11, 2025 07:23
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants