Skip to content

Enable pre-release auto-upgrades from aw.json - #58266

Merged
pelikhan merged 1 commit into
mainfrom
copilot/update-aw-json-auto-upgrade-options
Sep 3, 2026
Merged

Enable pre-release auto-upgrades from aw.json#58266
pelikhan merged 1 commit into
mainfrom
copilot/update-aw-json-auto-upgrade-options

Conversation

Copilot AI commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Allow scheduled auto-upgrades to consider pre-release gh-aw versions by passing validated CLI options from aw.json.

  • Configuration

    • Add auto_upgrade.options, restricted to supported flags.
    • Enable --pre-releases for this repository.
    {
      "auto_upgrade": {
        "cron": "0 9 * * 1",
        "options": ["--pre-releases"]
      }
    }
  • Workflow generation

    • Serialize options into the generated auto-upgrade workflow.
    • Pass options as discrete arguments to gh aw upgrade.
    • Reject malformed or unsupported runtime options.
  • Coverage

    • Cover configuration parsing, schema validation, workflow generation, and command invocation.

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

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Great work! 🎉 This PR looks ready for review. The feature is well-structured — it adds pre-release auto-upgrade support to the core gh-aw auto-upgrade workflow with proper schema validation, configuration handling, and comprehensive test coverage.

What stands out:

  • Clean schema extension in repo_config_schema.json for the new auto_upgrade.options field
  • Multiple test files updated with good coverage of parsing, validation, and workflow generation
  • Practical example in the PR description showing real-world usage
  • Focused change that doesn't mix concerns

This is ready for maintainer review.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

Generated by ✅ Contribution Check · copilot · auto · 55.1 AIC · ⌖ 7.39 AIC · ⊞ 9.3K ·

@pelikhan
pelikhan marked this pull request as ready for review September 3, 2026 18:21
Copilot AI balanced review requested due to automatic review settings September 3, 2026 18:21

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.

🟡 Changes recommended

Notifications omit the prerelease option from application instructions, so users may not reproduce the detected upgrade.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds validated auto-upgrade CLI options to aw.json, enabling scheduled prerelease upgrades.

Changes:

  • Adds schema and parsing support for auto_upgrade.options.
  • Propagates options through workflow generation and runtime invocation.
  • Enables prerelease upgrades and adds coverage.
File summaries
File Description
pkg/workflow/repo_config.go Parses auto-upgrade options.
pkg/workflow/repo_config_test.go Tests option configuration.
pkg/workflow/maintenance_workflow.go Propagates configured options.
pkg/workflow/auto_update_workflow.go Serializes options into workflow YAML.
pkg/workflow/auto_update_workflow_test.go Tests generated option environment.
pkg/parser/schemas/repo_config_schema.json Allow-lists --pre-releases.
actions/setup/js/run_operation_update_upgrade.cjs Validates and passes runtime options.
actions/setup/js/run_operation_update_upgrade.test.cjs Tests option invocation.
.github/workflows/aw.json Enables prerelease upgrades.
.github/workflows/agentic-auto-upgrade.yml Includes generated option environment.
.changeset/patch-auto-upgrade-options.md Records the user-facing change.
Review details

Suppressed comments (1)

actions/setup/js/run_operation_update_upgrade.cjs:269

  • When --pre-releases detects a prerelease-only change, the generated issue and step summary still instruct users to run plain gh aw upgrade (lines 342, 351, and 390). Since stable releases are the default, that command may not apply the detected update and can even select the stable channel instead. Render the exact command including upgradeOptions, and ensure the Copilot instruction preserves the same options.
  const fullCmd = [bin, ...prefixArgs, "upgrade", ...upgradeOptions].join(" ");
  core.info(`Running: ${fullCmd}`);
  const exitCode = await exec.exec(bin, [...prefixArgs, "upgrade", ...upgradeOptions]);
  • Files reviewed: 11/11 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

* GH_TOKEN - GitHub token for gh CLI auth and git push
* GH_AW_OPERATION - 'update', 'upgrade', 'disable', or 'enable'
* GH_AW_CMD_PREFIX - Command prefix: './gh-aw' (dev) or 'gh aw' (release)
* GH_AW_UPGRADE_OPTIONS - JSON array of supported options passed to upgrade
expect(mockCore.notice).toHaveBeenCalledWith(expect.stringContaining("https://github.com/testowner/testrepo/issues/42"));
});

it("passes configured upgrade options", async () => {
// or a configuration object; auto_upgrade can be a boolean or an object with an
// optional cron field.
func (r *RepoConfig) UnmarshalJSON(data []byte) error {
func (r *RepoConfig) UnmarshalJSON(data []byte) error { //nolint:largefunc // Polymorphic repository fields are decoded together.
@pelikhan
pelikhan merged commit cfc72cd into main Sep 3, 2026
54 checks passed
@pelikhan
pelikhan deleted the copilot/update-aw-json-auto-upgrade-options branch September 3, 2026 19:59
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.3

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