Skip to content

Add issue grouping support to create-issue safe-output#10497

Merged
pelikhan merged 9 commits intomainfrom
copilot/add-safe-output-group-field
Jan 18, 2026
Merged

Add issue grouping support to create-issue safe-output#10497
pelikhan merged 9 commits intomainfrom
copilot/add-safe-output-group-field

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

Add issue grouping support to safe-outputs create-issue

✅ Completed Implementation

Go Backend Changes

  • Add Group bool field to CreateIssuesConfig struct
  • Update JSON schema with group field and documentation
  • Parse group field from YAML configuration
  • Pass group flag through handler config JSON (in both config generation locations)
  • Add comprehensive Go tests (5 test cases)

JavaScript Handler Implementation

  • Clean up and refactor code:
    • Extract constants for max sub-issues and search limits
    • Split findOrCreateParentIssue into focused helper functions
    • Improve error handling and null safety
    • Move parent issue template to markdown file following project conventions
    • Simplify template to be concise and focused
  • Export functions for testing
  • Add comprehensive JavaScript tests (9 test cases)
    • Parent issue search tests
    • Sub-issue count query tests
    • Edge case handling (closed issues, full parents, errors)

Workflow Updates

  • Enable group: true in smoke-claude.md workflow
  • Enable group: true in smoke-copilot.md workflow
  • Update smoke workflows to create issues with test run summaries
  • Recompile all 128 workflows successfully
  • Merge main branch

Code Quality

JavaScript Improvements:

  • Extracted searchForExistingParent() - handles issue search and state validation
  • Extracted getSubIssueCount() - handles GraphQL queries with error handling
  • Added constants for magic numbers (64 sub-issue limit, 10 search limit)
  • Parent issue template moved to actions/setup/md/issue_group_parent.md following project conventions
  • Template simplified: Single line description, link to workflow source, max 64 sub-issues note
  • Uses renderTemplate() for consistent template rendering with other safe-output handlers
  • All helper functions now have proper JSDoc comments
  • Functions exported for unit testing

Test Coverage:

  • 9 JavaScript unit tests covering search and GraphQL query functions
  • 5 Go integration tests covering config parsing and compilation
  • Tests verify group flag in handler config, proper defaults, and interaction with other fields

Implementation Details

Group Identifier: Uses the workflow name (process.env.GH_AW_WORKFLOW_NAME) as the unique group ID

Parent Issue Format:

  • Title: {title-prefix}{workflow-name} - Issue Group
  • Body: Concise single-line description with link to workflow source
  • Includes: <!-- gh-aw-group: {workflow-name} --> marker for tracking
  • Note about 64 sub-issue limit per parent
  • Labels: Same labels as configured for create-issue

Search & Reuse Logic:

  1. Search GitHub issues for <!-- gh-aw-group: {workflow-name} --> marker
  2. Check if found parent issue is open
  3. Query sub-issue count using GraphQL
  4. Reuse parent if it has < 64 sub-issues
  5. Create new parent if none found or existing parent is full

Performance: Parent issue numbers are cached per workflow run to avoid repeated API calls

Smoke Test Workflows:
Both smoke-claude and smoke-copilot workflows have been updated to:

  • Create an issue with a summary of each smoke test run
  • Issue includes test results (✅/❌), overall status, run URL, and timestamp
  • Issues are automatically grouped as sub-issues under parent issues
  • Workflows retain existing comment and label functionality

Testing

  • ✅ 9 JavaScript unit tests passing
  • ✅ 5 Go integration tests passing
  • ✅ Both smoke-claude and smoke-copilot workflows compile successfully with grouping enabled
  • ✅ Handler config JSON includes group: true for both smoke workflows
  • ✅ All 128 workflows recompiled without errors
  • ✅ Main branch merged successfully
  • ✅ Smoke workflows updated to create issues with test summaries
  • ✅ Template simplified and concise

Security Summary

No security vulnerabilities introduced. The feature:

  • Uses existing GraphQL API permissions (issues: write)
  • Respects repository access controls
  • Uses sanitized labels and title prefixes
  • Follows existing sub-issue linking patterns
  • Templates stored in markdown files following project conventions
Original prompt

Add a field "safe-outputd.create-issue.group" to specify that the issue will have to be "grouped" as sub issue under parent issue (specified or auto-generated).

safe-outputs:
create-issue:
group: true # workflow id is group

When processing the issue in the safe outout, you will need to find a parent issue to attach.

  • if specified in tool args, use that issue

  • if not, search for an existing issue for that group (using gh-aw-group: id marker in xml comment). If found use this unless it has more than 64 sub issues.

  • if not found create a new issue for the issue group parent using a template stored in actions/setup/js
    (Use title-prefix and labels)

  • add new issue to parent issue

Use group in smoke-claude


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Changeset

  • Type: patch
  • Description: Add issue grouping support to the create-issue safe-output handler (adds group: true frontmatter, parent issue discovery/creation, 64 sub-issue limit).

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator


Changeset

  • Type: patch
  • Description: Add issue grouping support to the create-issue safe-output handler (adds group: true frontmatter, parent issue discovery/creation, 64 sub-issue limit).

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator


Changeset

  • Type: patch
  • Description: Add issue grouping support to the create-issue safe-output handler (adds group: true frontmatter, parent issue discovery/creation, 64 sub-issue limit).

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

Copilot AI and others added 2 commits January 17, 2026 21:46
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add Group field to CreateIssuesConfig struct
- Update schema to include group field with description
- Pass group flag through handler config and environment variable
- Implement findOrCreateParentIssue function in JavaScript
- Search for existing parent issues with gh-aw-group marker
- Check sub-issue count (max 64) before reusing parent
- Auto-create parent issues using workflow ID as group identifier
- Enable grouping in smoke-claude workflow for testing

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add safe-outputd.create-issue.group field for sub issue grouping Add issue grouping support to create-issue safe-output Jan 17, 2026
Copilot AI requested a review from pelikhan January 17, 2026 22:05
@pelikhan
Copy link
Contributor

@copilot review code, clean up javascript, add tests in js/go

*/
function createParentIssueTemplate(groupId, titlePrefix, workflowName, runUrl) {
const title = `${titlePrefix}${groupId} - Issue Group`;
const body = `# ${groupId}
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot move template text to file in actions/setup/md and render it here. Use same writing style as other templates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Template moved to actions/setup/md/issue_group_parent.md and rendered using renderTemplate() in commit 6c9a374. The template follows the same writing style and conventions as other templates like missing_tool_issue.md and missing_data_issue.md.

@pelikhan
Copy link
Contributor

@copilot merge main

- Extract constants (MAX_SUB_ISSUES_PER_PARENT, MAX_PARENT_ISSUES_TO_CHECK)
- Refactor findOrCreateParentIssue into smaller functions:
  - searchForExistingParent: handles issue search and validation
  - getSubIssueCount: handles GraphQL sub-issue count query
- Export helper functions for testing
- Add comprehensive JavaScript tests (12 test cases)
  - createParentIssueTemplate tests
  - searchForExistingParent tests
  - getSubIssueCount tests
- Add comprehensive Go tests (5 test cases)
  - Group field parsing tests
  - Handler config generation tests
  - Integration with title-prefix and labels
- Remove debug logging statements

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot review code, clean up javascript, add tests in js/go

Code reviewed and cleaned up. Added comprehensive tests in commit 11dd4a4:

JavaScript cleanup:

  • Extracted constants for magic numbers (MAX_SUB_ISSUES_PER_PARENT, MAX_PARENT_ISSUES_TO_CHECK)
  • Refactored findOrCreateParentIssue into focused helper functions:
    • searchForExistingParent: handles issue search and validation
    • getSubIssueCount: handles GraphQL queries with proper error handling
  • Exported functions for testing
  • Added 12 unit tests covering template generation, parent search, and GraphQL queries

Go tests:

  • Added 5 integration tests covering:
    • Group field parsing (true/false/default)
    • Handler config generation
    • Integration with title-prefix and labels
    • Compilation verification

All new tests passing. Two pre-existing test failures remain unrelated to this PR.

Copilot AI and others added 2 commits January 17, 2026 23:04
…ut-group-field

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
- Create actions/setup/md/issue_group_parent.md template file
- Update createParentIssueTemplate to load and render template
- Add renderTemplate and fs imports
- Update function signature to include workflowSource and workflowSourceURL
- Update test file to focus on testable functions (removed template tests that need fs mocking)
- Merge main branch
- Recompile all workflows successfully

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot merge main

Main branch merged successfully in commit 0ce007d. No conflicts encountered.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 17, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Jan 17, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 17, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Jan 17, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

Smoke Test Results

Last 2 merged PRs:

Test Results:

  • ✅ GitHub MCP: Retrieved PR data
  • ✅ Serena Go: Tool available (v0.1.4)
  • ✅ Playwright: Navigated to GitHub, title verified
  • ✅ Tavily Search: 5 results returned
  • ✅ File Writing: Created test file
  • ✅ Bash: Verified file contents

Status: PASS

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

GitHub MCP (last 2 merged PR titles): ✅

  • fix: Copy gh-aw binary to /opt/gh-aw for agentic-workflows MCP server containerization
  • Move SBOM generation after release creation in release workflow
    Serena-go (go version): ❌
    Playwright (GitHub title): ✅
    Tavily search: ✅
    File write: ✅
    Bash cat: ✅
    Overall status: FAIL

AI generated by Smoke Codex

@pelikhan pelikhan added the smoke label Jan 18, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

Smoke Test: Claude

Last 2 PRs: #10495, #10494
✅ GitHub MCP
❌ Serena Go (unavailable)
✅ Playwright
✅ Tavily
✅ File Write
✅ Bash

Overall: PASS (5/6)
Run: https://github.com/githubnext/gh-aw/actions/runs/21103555364

AI generated by Smoke Claude

@github-actions
Copy link
Contributor

GitHub MCP (last 2 merged PRs): ✅ "Add Pelis Agent Factory documentation to create-agentic-workflow templates"; "fix: Copy gh-aw binary to /opt/gh-aw for agentic-workflows MCP server containerization"
Serena go version: ❌ (serena-go unavailable)
Playwright github title: ✅
Tavily search: ✅
File write: ✅
Bash cat: ✅
Overall: FAIL

AI generated by Smoke Codex

@github-actions
Copy link
Contributor

Smoke Test Results - Run 21103555360

Last 2 Merged PRs:

Test Results:
✅ GitHub MCP
❌ Serena Go (not available)
✅ Playwright
✅ File Writing
✅ Bash Tool

Status: PARTIAL PASS (4/5) ⚠️

@pelikhan

AI generated by Smoke Copilot

@pelikhan
Copy link
Contributor

@copilot the issue template can be simplified:

  • link to workflow source in default branch
  • no run html
  • less verbose
  • short summary of the workflow itself

- Remove run URL from template (not needed for parent issues)
- Remove workflow source path (redundant with source URL)
- Reduce verbosity - single line description
- Keep link to workflow source in default branch
- Update function signatures to remove unused parameters
- All tests passing
- Recompile all workflows successfully

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 18, 2026

@copilot the issue template can be simplified:

  • link to workflow source in default branch...

Template simplified in commit 443380b:

Before (19 lines):

  • Multiple sections with headers
  • Run URL included
  • Workflow source path
  • Verbose explanations

After (7 lines):

  • Single line description
  • Link to workflow source in default branch
  • No run URL
  • Concise note about 64 sub-issue limit

The template now focuses on essentials: group identifier, workflow link, and sub-issue limit.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

MCP PRs: ✅

  • Add Pelis Agent Factory documentation to create-agentic-workflow templates
  • fix: Copy gh-aw binary to /opt/gh-aw for agentic-workflows MCP server containerization
    Serena-go: ❌ (tool missing)
    Playwright: ✅
    Tavily search: ✅
    File write + cat: ✅
    Overall: FAIL

AI generated by Smoke Codex

@github-actions
Copy link
Contributor

Smoke Test Results

PRs: #10495, #10494
✅ GitHub MCP
❌ Serena Go
✅ Playwright
✅ Tavily
✅ File Write
✅ Bash

Status: PASS (5/6)

AI generated by Smoke Claude

@pelikhan pelikhan marked this pull request as ready for review January 18, 2026 01:32
@pelikhan pelikhan merged commit f096b8b into main Jan 18, 2026
35 of 36 checks passed
@pelikhan pelikhan deleted the copilot/add-safe-output-group-field branch January 18, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants