Skip to content

fix: Include folders in confluence page children output#41

Merged
Hinne1 merged 2 commits intomainfrom
claude/fix-children-folders
Mar 22, 2026
Merged

fix: Include folders in confluence page children output#41
Hinne1 merged 2 commits intomainfrom
claude/fix-children-folders

Conversation

@Hinne1
Copy link
Contributor

@Hinne1 Hinne1 commented Mar 22, 2026

Summary

The atl confluence page children command was silently omitting folders from results. This caused --type folder to 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}/children endpoint 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 empty type fields for pages, so those are now explicitly set to "page".

Before

$ atl confluence page children 33554434
Found 3 children of page 33554434

ID          TITLE                             TYPE  STATUS
766214154   Application Development Workflow        current
1040318492  External Resources                      current
1040089124  Document Control Banner Template        current

After

$ atl confluence page children 33554434
Found 6 children of page 33554434

ID          TITLE                             TYPE    STATUS
766214154   Application Development Workflow  page    current
1040318492  External Resources                page    current
1040089124  Document Control Banner Template  page    current
767459382   WIP                               folder  current
675381331   Certs                             folder  current
517832762   Guides & Docs                     folder  current

Changes

  • internal/api/confluence.go: Add GetChildFolders() using CQL, set Type = "page" for v2 results
  • internal/cmd/confluence/page/children.go: Merge folder results, skip folder fetch when --type page

Test plan

  • atl confluence page children 33554434 → 6 results (3 pages + 3 folders)
  • atl confluence page children 33554434 --type folder → 3 folders
  • atl confluence page children 33554434 --type page → 3 pages
  • atl confluence page children 33554434 --json → type field populated for all entries

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 atl command-line tool, focusing on improving its interaction with Confluence and Jira. The changes address issues with retrieving Confluence page children and significantly enhance Jira functionality by adding support for custom fields in issue viewing, creation, editing, and transitions. Additionally, a new command is introduced to display allowed values for Jira issue fields, making it easier for users to interact with constrained fields.

Highlights

  • Confluence Page Children: The atl confluence page children command now includes folders in the results, which were previously omitted. This fix ensures that the --type folder flag works correctly and allows users to find folders under a parent page.
  • Jira Custom Fields: Enhanced Jira functionality to include custom fields in issue view and edit commands. This allows users to view and modify custom fields directly from the command line, including handling various field types like select, radio, and text areas.
  • Jira Field Options: Introduced a new command, atl issue field-options, to display allowed values for issue fields. This is particularly useful for discovering valid values for select, radio, and other constrained fields, improving the user experience when creating and editing issues.
  • Jira Transition Enhancements: The atl issue transition command now supports setting custom fields during issue transitions. This allows users to fulfill mandatory field requirements when moving issues between statuses.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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)
@Hinne1 Hinne1 force-pushed the claude/fix-children-folders branch from 173c424 to 19514f5 Compare March 22, 2026 15:52
@Hinne1 Hinne1 force-pushed the claude/fix-children-folders branch from 0423195 to 90574dd Compare March 22, 2026 15:53
@Hinne1 Hinne1 marked this pull request as ready for review March 22, 2026 15:55
@github-actions
Copy link

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/api 36.53% (-0.29%) 👎
github.com/enthus-appdev/atl-cli/internal/cmd/confluence/page 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/api/confluence.go 1.39% (-0.04%) 359 (+11) 5 354 (+11) 👎
github.com/enthus-appdev/atl-cli/internal/cmd/confluence/page/children.go 0.00% (ø) 75 (+5) 0 75 (+5)

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.

@Hinne1 Hinne1 merged commit f8493d4 into main Mar 22, 2026
15 checks passed
@Hinne1 Hinne1 deleted the claude/fix-children-folders branch March 22, 2026 15:57
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