Skip to content

Reuse shared workflow types for Copilot setup scaffolding - #54804

Merged
pelikhan merged 8 commits into
mainfrom
copilot/deep-report-replace-duplicate-gha-workflow-model
Aug 22, 2026
Merged

Reuse shared workflow types for Copilot setup scaffolding#54804
pelikhan merged 8 commits into
mainfrom
copilot/deep-report-replace-duplicate-gha-workflow-model

Conversation

Copilot AI commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Copilot setup scaffolding maintained a separate GitHub Actions workflow, job, and step model in pkg/cli. This consolidates the model under pkg/workflow and reuses the primary WorkflowStep type.

  • Shared workflow-file model

    • Added workflow.WorkflowFile and workflow.WorkflowFileJob for YAML workflow-file serialization.
    • Kept flexible on, runs-on, and permissions fields required when reading existing workflows.
  • Removed CLI-local duplicates

    • Deleted CopilotWorkflowStep, WorkflowJob, and Workflow from copilot_setup.go.
    • Updated Copilot setup YAML fixtures and round-trip tests to use shared types.
workflow.WorkflowFile{
    Jobs: map[string]workflow.WorkflowFileJob{
        "copilot-setup-steps": {
            Steps: []workflow.WorkflowStep{
                {Name: "Install gh-aw extension", Run: "…"},
            },
        },
    },
}

pr-sous-chef run https://github.com/github/gh-aw/actions/runs/32578995676> Generated by 👨‍🍳 PR Sous Chef · gpt54 · 14.2 AIC · ⌖ 8.25 AIC · ⊞ 9.5K ·

Comment /souschef to run again

Copilot AI and others added 2 commits August 22, 2026 13:27
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] Replace duplicate GHA workflow model with pkg/workflow types Reuse shared workflow types for Copilot setup scaffolding Aug 22, 2026
Copilot AI requested a review from pelikhan August 22, 2026 13:39
"$ref": "#/definitions/permissions-level"
},
"drives": {
"$ref": "#/definitions/permissions-level"

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 revert change and merge main

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Restored the drives schema permission and merged main in 320f1e7.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted the stray local edit to pkg/workflow/schemas/github-workflow.json — the branch is already merged with main (370f5c2) and the file now matches main's drives position exactly.

Copilot AI and others added 2 commits August 22, 2026 14:00
…eplace-duplicate-gha-workflow-model

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review August 22, 2026 14:09
Copilot AI balanced review requested due to automatic review settings August 22, 2026 14:09
Copilot AI requested a review from pelikhan August 22, 2026 14:09
@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Ponytail review: PR is a pure deduplication refactor (removes duplicate CopilotWorkflowStep/WorkflowJob/Workflow types, reuses shared workflow.WorkflowFile/WorkflowFileJob/WorkflowStep). Net deletion of code, no speculative abstractions or reinvented logic found. Lean already. Ship.

Generated by Ponytail Reviewer for #54804

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (46 additions detected, threshold is 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

Copy link
Copy Markdown
Contributor

🛠️ Agentic Maintenance updated this pull request branch.

View workflow run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Consolidates Copilot setup workflow fixtures around shared pkg/workflow types.

Changes:

  • Adds shared workflow-file and job models.
  • Replaces CLI-local step models in tests.
  • Regenerates command routing with an unrelated smoke-drive route.
Show a summary per file
File Description
pkg/workflow/workflow_file.go Adds shared YAML models.
pkg/cli/copilot_setup.go Removes local duplicate types.
pkg/cli/copilot_setup_test.go Migrates tests to shared types.
.github/workflows/agentic_commands.yml Adds smoke-drive routing.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment on lines +4 to +7
type WorkflowFile struct {
Name string `yaml:"name,omitempty"`
On any `yaml:"on,omitempty"`
Jobs map[string]WorkflowFileJob `yaml:"jobs,omitempty"`
# /smoke-crush -> smoke-crush [issue_comment,issues,pull_request,pull_request_comment] reaction=eyes
# /smoke-cursor -> smoke-cursor [issue_comment,issues,pull_request,pull_request_comment] reaction=rocket
# /smoke-deepseek-harness -> smoke-deepseek-harness [issue_comment,issues,pull_request,pull_request_comment] reaction=eyes
# /smoke-drive -> smoke-drive [issue_comment,issues,pull_request,pull_request_comment] reaction=rocket
Comment thread pkg/workflow/workflow_file.go Outdated
// WorkflowFileJob represents a GitHub Actions workflow job in a workflow file.
type WorkflowFileJob struct {
RunsOn any `yaml:"runs-on,omitempty"`
Permissions map[string]any `yaml:"permissions,omitempty"`
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-22T00:00:00Z
review_event: COMMENT
top_themes:
  - no actionable issues in changed lines
  - shared workflow model reuse looks behaviorally equivalent
files_reviewed:
  - .github/workflows/agentic_commands.yml
  - pkg/cli/copilot_setup.go
  - pkg/cli/copilot_setup_test.go
  - pkg/workflow/workflow_file.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 18.7 AIC · ⌖ 6.75 AIC · ⊞ 7K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No actionable changed-line issues stood out here. The new shared workflow-file structs match the old copilot setup YAML shape, keep the flexible on/runs-on/permissions typing needed for round-tripping existing workflow files, and the test updates cover the moved types without changing behavior.

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 18.7 AIC · ⌖ 6.75 AIC · ⊞ 7K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /codebase-design — one suggestion, otherwise clean consolidation work.

📋 Summary

What this PR does well

  • ✅ Clean elimination of duplicate types (CopilotWorkflowStep, WorkflowJob, Workflow) in favour of shared pkg/workflow equivalents — reduces the maintenance surface and the risk of the two models diverging.
  • ✅ Narrowing Env from map[string]anymap[string]string is the right semantic tightening; the test rename from TestCopilotWorkflowStepStructureTestWorkflowStepYAMLStructure and TestWorkflowStructMarshalingTestWorkflowFileMarshaling improves clarity.
  • ✅ New file pkg/workflow/workflow_file.go is minimal and well-placed.

One suggestion

WorkflowFileJob.Permissions is map[string]any while GitHub Actions permission values are always strings. The PR already applied this tightening to Env — applying it to Permissions too would be consistent. See inline comment.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 33.5 AIC · ⌖ 9.79 AIC · ⊞ 7.6K
Comment /matt to run again

Comment thread pkg/workflow/workflow_file.go Outdated
type WorkflowFileJob struct {
RunsOn any `yaml:"runs-on,omitempty"`
Permissions map[string]any `yaml:"permissions,omitempty"`
Steps []WorkflowStep `yaml:"steps,omitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/codebase-design] Permissions is typed map[string]any, but GitHub Actions permission values are always strings ("read", "write", "none"). This PR already narrowed Env from map[string]anymap[string]string on WorkflowStep for the same reason — Permissions deserves the same treatment for consistency.

💡 Suggested change
// Before
Permissions map[string]any `yaml:"permissions,omitempty"`

// After
Permissions map[string]string `yaml:"permissions,omitempty"`

This keeps the type vocabulary consistent and catches bad permission values at compile time rather than at runtime.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Replaced Permissions map[string]any with a new WorkflowFilePermissions union type that supports both the scope-map form (contents: read) as map[string]string and the shorthand scalar form (read-all/write-all/none), since a plain map[string]string alone can't represent the scalar permissions case raised in the other thread.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean refactor — no blocking issues found.

The PR removes three locally-defined types (CopilotWorkflowStep, WorkflowJob, Workflow) from copilot_setup.go and replaces them with the shared workflow.WorkflowStep, workflow.WorkflowFileJob, and workflow.WorkflowFile. This reduces duplication and ensures the copilot-setup scaffolding stays in sync with the rest of the compiler's type system.

Notable improvement: Env map[string]anyEnv map[string]string. GitHub Actions environment values must be strings, so the tighter type is strictly correct and prevents accidental non-string values.

All test references are updated consistently. LGTM.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 38.9 AIC · ⌖ 9 AIC · ⊞ 6.2K

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot this PR looks close, but there is still one maintainer-facing follow-up to finish.

  • Please review the latest comments and any unresolved review feedback, refresh the branch if needed, and run the pr-finisher skill.
  • Leave a concise maintainer handoff that lists the exact validations rerun and whether any human follow-up remains.

Run: https://github.com/github/gh-aw/actions/runs/32578995676

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 14.2 AIC · ⌖ 8.25 AIC · ⊞ 9.5K ·
Comment /souschef to run again

Copilot AI commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@gh-aw-bot Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 354953ed-c7ce-404f-a1f9-777f96229473

Sorry for the inconvenience!

…cope

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

Copilot AI commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot this PR looks close, but there is still one maintainer-facing follow-up to finish.

  • Please review the latest comments and any unresolved review feedback, refresh the branch if needed, and r...

pr-finisher pass complete:

  • Reviews: addressed and replied on the drives-schema thread (reverted stray edit; already merged with main) and the permissions-type thread (added WorkflowFilePermissions union type supporting both scalar shorthand and scope-map forms). The /smoke-drive route flagged in an older review is pre-existing on main, not drift from this PR — no change made.
  • Checks (local): go build ./..., targeted pkg/cli/pkg/workflow tests, make fmt, make lint, and make test-unit all pass.
  • Checks (CI): stale after this push — needs a maintainer re-trigger.
  • Mergeable: no conflicts with main (already merged in as of 370f5c2).

Still needed: a maintainer re-trigger of CI and final human review/approval before merge.

Copilot AI requested a review from gh-aw-bot August 22, 2026 14:53
@pelikhan
pelikhan merged commit 15041fe into main Aug 22, 2026
31 checks passed
@pelikhan
pelikhan deleted the copilot/deep-report-replace-duplicate-gha-workflow-model branch August 22, 2026 15:10
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.

[deep-report] Replace copilot_setup.go's duplicate GHA workflow model with pkg/workflow types

4 participants