Skip to content

Add --create repository bootstrap flow to add and add-wizard#45831

Closed
pelikhan with Copilot wants to merge 25 commits into
mainfrom
copilot/add-create-flag-to-add-command
Closed

Add --create repository bootstrap flow to add and add-wizard#45831
pelikhan with Copilot wants to merge 25 commits into
mainfrom
copilot/add-create-flag-to-add-command

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

gh aw add and gh aw add-wizard could install workflows into an existing checkout, but not create the target repository as part of the flow. This change brings repository creation into both commands by reusing the existing bootstrap/setup path instead of introducing a parallel implementation.

  • CLI surface

    • Add shared repository-setup flags to both commands:
      • --create OWNER/REPO
      • --visibility {private|public|internal}
      • --require-owner-type {any|org|user}
    • Update help text and examples so the create flow is discoverable from the install entry points.
  • Shared create/clone orchestration

    • Introduce a small add_create.go helper that:
      • validates create-target arguments
      • builds a bootstrap plan with the existing bootstrap runtime
      • creates the repo when missing
      • clones or attaches the target checkout before workflow installation
    • This keeps repository provisioning aligned with bootstrap semantics and avoids duplicating repo setup logic.
  • add integration

    • add now resolves workflows as before, then runs installation inside the prepared target checkout when --create is set.
    • Existing non-create behavior remains unchanged.
  • add-wizard integration

    • add-wizard can now provision the target repo before entering the existing interactive install / PR flow.
    • The wizard restores the original working directory after the flow and logs restoration failures instead of silently swallowing them.
  • Fresh-repo behavior

    • Repository creation now includes --add-readme, ensuring the new repo has an initial branch so downstream add-wizard / PR flows do not start from an unborn repository state.
  • Coverage

    • Add focused tests for:
      • new flag registration / defaults
      • help and example sync between add and add-wizard
      • checkout preparation via the shared create helper
      • repository creation flags including the new README seeding behavior

Example:

gh aw add githubnext/agentics/ci-doctor \
  --create octo-org/platform-ops \
  --visibility private

gh aw add-wizard githubnext/agentics/ci-doctor \
  --create octo-org/platform-ops \
  --require-owner-type org

Generated by 👨‍🍳 PR Sous Chef · 4.35 AIC · ⌖ 5.96 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI and others added 3 commits July 15, 2026 21:38
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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 feat: add --create flow to add and add-wizard Add --create repository bootstrap flow to add and add-wizard Jul 15, 2026
Copilot AI requested a review from pelikhan July 15, 2026 21:53
@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category feature
Risk medium
Score 42 / 100
Action defer

Score breakdown: Impact 22 + Urgency 10 + Quality 10

Adds --create repo bootstrap flag to add/add-wizard. DRAFT — CI not yet run. Moderate scope (9 files, 261 additions). Defer until undrafted and CI passes.

Run §29462479491

Generated by 🔧 PR Triage Agent · 189.6 AIC · ⌖ 5.52 AIC · ⊞ 5.6K ·

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot

  • add --license to select license
  • run "init" in empty repo to configure for agentic workflows

Copilot AI and others added 2 commits July 16, 2026 04:57
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot when calling init, enable codespace flag to generate devcontainer file too

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

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

  • add --license to select license
  • run "init" in empty repo to configure for agentic workflows

Addressed in 1c6e8a9: add / add-wizard --create now accept --license, and the prepared checkout now runs repository init before the workflow install flow continues.

Copilot AI and others added 2 commits July 16, 2026 05:19
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot when calling init, enable codespace flag to generate devcontainer file too

Addressed in 18b6d89: the shared add / add-wizard --create init path now enables Codespaces so empty repos also get .devcontainer/devcontainer.json generated.

@pelikhan
pelikhan marked this pull request as ready for review July 16, 2026 06:05
… case

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

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add-wizard must support --create without an argument then ask user for repo name. REPO is also ok, infer org from current repo.

Implemented in commits 08c2d75 and 30a8e16. The --create flag now supports three formats:

  1. --create (no value) — prompts for repo name in add-wizard
  2. --create REPO — infers owner from current repository's git remote
  3. --create OWNER/REPO — explicit full format

The prompt in add-wizard validates:

  • Non-empty input
  • Proper OWNER/REPO format if slash is present
  • No whitespace in repo names

Owner inference uses getRepositorySlugFromRemote() to extract the owner from the current repository's origin remote. If no remote exists or inference fails, validation provides a clear error message.

Examples updated in both add and add-wizard help text.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the unresolved review threads listed below, and rerun checks once the branch is up to date.

Unresolved review threads:

Generated by 👨‍🍳 PR Sous Chef · 4.35 AIC · ⌖ 5.96 AIC · ⊞ 7.5K ·
Comment /souschef to run again

…ter test

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot July 16, 2026 08:33
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review comments, fix any failing checks, and rerun checks once the branch is up to date.

Failed checks

Generated by 👨‍🍳 PR Sous Chef · 8.77 AIC · ⌖ 6.55 AIC · ⊞ 5.1K ·
Comment /souschef to run again

Copilot AI and others added 2 commits July 16, 2026 09:30
Update tests to use firewall version 0.27.35 and remove expectations
for images that no longer have embedded pins (build-tools, agent-act).
Also fix formatting and update actionpins test to use node:lts-alpine.

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Update action pin tests to use current versions:
- setup-node: v6.x -> v7.x
- setup-go: v6.5.0 -> v7.0.0
- gh-aw-mcpg: v0.3.6/v0.3.9 -> v0.4.1

All tests now pass after the package update that removed old versions.

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review comments, fix any failing checks, and rerun checks once the branch is up to date.

Failed checks...

All failing checks have been addressed. Fixed test failures caused by the package update (401db81) that removed old embedded pins:

Test failures fixed:

  • Docker firewall pin tests updated to use version 0.27.35 (was 0.27.0)
  • Removed obsolete build-tools and agent-act test expectations
  • Updated action pin tests for setup-node (v6.x → v7.x) and setup-go (v6.5.0 → v7.0.0)
  • Updated gh-aw-mcpg test (v0.3.6/v0.3.9 → v0.4.1)
  • Fixed formatting in add_create_test.go

All affected test suites now pass: pkg/workflow, pkg/actionpins, and pkg/cli.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main recompile fix conflicts

Resolved test conflicts by accepting main's dynamic test approach that derives expected values from embedded data rather than hardcoding versions.

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

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main recompile fix conflicts

Done in 21308ed. Merged main, resolved test conflicts by accepting main's dynamic test approach, and recompiled all 257 workflows successfully.

@copilot merge main recompile fix conflicts

Done in 21308ed. Merged main, resolved test conflicts by accepting main's dynamic test approach, and recompiled all 257 workflows successfully.

Note: The make agent-report-progress validation has 3 pre-existing test failures from main (not related to this merge):

  • TestLogsJSONOutputWithNoRuns - Environment/flaky test (skips when run individually)
  • TestCloseExistingOrgIssuesByMarkerSkipsPRsAndPaginates - Expects github.com but gets localhost:26831
  • TestRunWorkflowOnGitHub_FlagCombinations/push_flag_with_remote_repo - Network TLS timeout

All add/create-related tests pass successfully.

@pelikhan pelikhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot default visibility to private

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot default visibility to private

The --visibility flag already defaults to "private" in both add and add-wizard commands (implemented in pkg/cli/add_create.go:31). The test TestAddCommandFlagDefaults confirms this default, and the help text shows (default "private"). No changes needed.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan July 16, 2026 10:56
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks if needed.

Unresolved review threads:

Please close out the remaining review threads and confirm the branch is current with main.

Generated by 👨‍🍳 PR Sous Chef · 14.6 AIC · ⌖ 4.75 AIC · ⊞ 7.5K ·
Comment /souschef to run again

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.

4 participants