Enable pre-release auto-upgrades from aw.json - #58266
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
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:
This is ready for maintainer review. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "github.com"See Network Configuration for more information.
|
There was a problem hiding this comment.
🟡 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-releasesdetects a prerelease-only change, the generated issue and step summary still instruct users to run plaingh 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 includingupgradeOptions, 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. |
|
🎉 This pull request is included in a new release. Release: |
Allow scheduled auto-upgrades to consider pre-release gh-aw versions by passing validated CLI options from
aw.json.Configuration
auto_upgrade.options, restricted to supported flags.--pre-releasesfor this repository.{ "auto_upgrade": { "cron": "0 9 * * 1", "options": ["--pre-releases"] } }Workflow generation
gh aw upgrade.Coverage