fix: Include folders in confluence page children output#41
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces several enhancements and bug fixes to the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where child folders were missing from Confluence page children output. The fix correctly fetches and merges folders. However, the pull request also includes a significant number of changes to add comprehensive support for Jira custom fields, which is not mentioned in the summary. It would be beneficial to update the PR description to reflect all the changes. The code is generally well-structured, with good refactoring to centralize custom field parsing logic. I've left a few comments on potential issues with pagination and error handling that should be addressed.
The v2 /pages/{id}/children endpoint only returns pages, not folders.
This caused --type folder to always return empty results, and the
default children list to silently omit folders like WIP, Certs, etc.
Fix:
- Add GetChildFolders() that uses v1 CQL search (parent = {id} AND
type = folder) to fetch child folders
- Merge folder results into children output alongside pages
- Set Type field to "page" for v2 results (API returns empty string)
- Skip folder fetch when --type page is specified (optimization)
Before: atl confluence page children 33554434 → 3 results (pages only)
After: atl confluence page children 33554434 → 6 results (3 pages + 3 folders)
173c424 to
19514f5
Compare
0423195 to
90574dd
Compare
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. |
Summary
The
atl confluence page childrencommand was silently omitting folders from results. This caused--type folderto always return empty, and made it impossible to find folders like WIP, Certs, Guides & Docs under a parent page.Root cause: The Confluence v2 API
/pages/{id}/childrenendpoint only returns pages, not folders. Folders are a separate content type in v2.Fix: Also fetch child folders via CQL search (
parent = {id} AND type = folder) and merge them into the results. The v2 API also returns emptytypefields for pages, so those are now explicitly set to"page".Before
After
Changes
internal/api/confluence.go: AddGetChildFolders()using CQL, setType = "page"for v2 resultsinternal/cmd/confluence/page/children.go: Merge folder results, skip folder fetch when--type pageTest plan
atl confluence page children 33554434→ 6 results (3 pages + 3 folders)atl confluence page children 33554434 --type folder→ 3 foldersatl confluence page children 33554434 --type page→ 3 pagesatl confluence page children 33554434 --json→ type field populated for all entries