Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Refactored wildcard expansion logic into dedicated helper function per code review feedback.

Changes

Helper function (pkg/cli/add_command.go)

  • Extracted expandWildcardWorkflows() helper function from AddWorkflows()
  • Function takes workflow specs and expands wildcards to individual workflows
  • Improved error handling and separation of concerns
  • Better testability with isolated logic

Dedicated tests (pkg/cli/add_wildcard_test.go)

  • Added TestExpandWildcardWorkflows with comprehensive test cases:
    • Single wildcard expansion
    • Mixed wildcard and specific workflows
    • Non-wildcard pass-through
    • Empty input error handling
  • Added TestExpandWildcardWorkflows_ErrorHandling for error cases:
    • Nonexistent package handling
    • Proper error message validation

Benefits

  • Improved code organization and readability
  • Enhanced testability with isolated function
  • Better separation of concerns
  • Easier to maintain and extend

All tests pass ✓

Original prompt

Add support for wildcard in the "add" command for workflow names.

gh aw githubnext/agentics/*

or

gh aw githubnext/agentics/*@v1

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

Copilot AI and others added 2 commits November 6, 2025 18:15
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for wildcard in add command for workflow names Add wildcard support for workflow names in add command Nov 6, 2025
Copilot AI requested a review from pelikhan November 6, 2025 18:25
Copilot finished work on behalf of pelikhan November 6, 2025 18:25
@pelikhan pelikhan marked this pull request as ready for review November 6, 2025 19:23
Copilot AI review requested due to automatic review settings November 6, 2025 19:23
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 support for wildcard workflow specifications (e.g., owner/repo/*) that allow users to add all workflows from a repository at once. The implementation introduces a new IsWildcard field to WorkflowSpec, parses wildcard syntax, discovers all workflows in an installed package, and expands them during the add command processing.

  • Adds wildcard specification parsing in parseWorkflowSpec to recognize owner/repo/* patterns
  • Implements discoverWorkflowsInPackage to find all markdown files in an installed package
  • Expands wildcards after package installation in AddWorkflows function

Reviewed Changes

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

Show a summary per file
File Description
pkg/cli/spec.go Adds IsWildcard field to WorkflowSpec and wildcard detection logic in parseWorkflowSpec
pkg/cli/packages.go Implements discoverWorkflowsInPackage function to find all workflows in a package
pkg/cli/add_wildcard_test.go Tests for wildcard parsing and workflow discovery functionality
pkg/cli/add_command.go Adds wildcard expansion logic after package installation and updates help text
docs/src/content/docs/status.mdx Adds new workflow entries to the status table (unrelated documentation update)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

pelikhan and others added 2 commits November 6, 2025 11:26
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot finished work on behalf of pelikhan November 6, 2025 19:35
Copilot AI requested a review from pelikhan November 6, 2025 19:35
@pelikhan pelikhan merged commit 83e2263 into main Nov 6, 2025
34 of 38 checks passed
@pelikhan pelikhan deleted the copilot/add-wildcard-support-add-command branch November 6, 2025 19:37
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.

2 participants