Skip to content

Add --staged flag to compile for forced staged workflows#31975

Merged
pelikhan merged 5 commits into
mainfrom
copilot/add-staged-flag-to-compile
May 13, 2026
Merged

Add --staged flag to compile for forced staged workflows#31975
pelikhan merged 5 commits into
mainfrom
copilot/add-staged-flag-to-compile

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

New Feature

What does this feature do?

Adds a --staged flag to gh aw compile that forces compiled agentic workflows into staged mode, even when the source workflow does not enable it or explicitly sets staged: false.

Why is this feature needed?

This provides a compile-time override for safe-output behavior, making it possible to generate preview-only workflows without editing workflow frontmatter.

Implementation details

  • CLI surface

    • adds --staged to the compile command
    • threads the flag through CompileConfig from Cobra into the compile pipeline
  • Compiler behavior

    • adds compiler state for forced staged mode
    • applies the override when extracting safe-outputs config, so global staged mode is enabled regardless of frontmatter
  • Coverage

    • adds unit coverage for compiler-forced staged mode
    • adds compile-path coverage to verify --staged overrides safe-outputs.staged: false
    • adds help-text coverage for the new flag

Example

gh aw compile --staged .github/workflows/my-workflow.md
safe-outputs:
  staged: false
  create-issue:
    max: 1

With --staged, the compiled workflow is emitted in staged mode despite the frontmatter value above.

Copilot AI and others added 2 commits May 13, 2026 16:11
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 Add --staged flag to compile Add --staged flag to compile for forced staged workflows May 13, 2026
Copilot AI requested a review from pelikhan May 13, 2026 16:19
@pelikhan pelikhan marked this pull request as ready for review May 13, 2026 16:28
Copilot AI review requested due to automatic review settings May 13, 2026 16:28
@pelikhan
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
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

Adds a --staged compile flag that forces safe-output workflows to compile in staged mode.

Changes:

  • Adds CLI flag parsing and threads the option through CompileConfig into compiler setup.
  • Adds compiler state/accessors for forced staged mode and applies it during safe-output config extraction.
  • Adds unit, help-text, and integration coverage for the new behavior.
Show a summary per file
File Description
cmd/gh-aw/main.go Defines and reads the new --staged flag for compile.
cmd/gh-aw/main_help_text_test.go Verifies help text for the new flag.
pkg/cli/compile_config.go Adds Staged to compile configuration.
pkg/cli/compile_compiler_setup.go Applies CompileConfig.Staged to the compiler.
pkg/cli/compile_compiler_setup_test.go Tests compiler setup for forced staged mode.
pkg/cli/compile_integration_test.go Verifies CLI compilation forces staged safe outputs.
pkg/workflow/compiler_types.go Adds compiler force-staged state and accessors.
pkg/workflow/safe_outputs_config.go Overrides extracted safe-output staged config when forced.
pkg/workflow/staged_test.go Adds direct compiler extraction tests for forced staged mode.

Copilot's findings

Tip

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

  • Files reviewed: 9/9 changed files
  • Comments generated: 0

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

Copilot AI commented May 13, 2026

@pelikhan pelikhan merged commit b657778 into main May 13, 2026
6 of 7 checks passed
@pelikhan pelikhan deleted the copilot/add-staged-flag-to-compile branch May 13, 2026 16:40
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.

3 participants