Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/59607585-50bc-4bce-b952-5eb59e943ed4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add arg to refuse redirects, --no-redirect |
|
@copilo add integration tests |
…updates Agent-Logs-Url: https://github.com/github/gh-aw/sessions/08e3d7dc-4141-43f4-b1dd-b041660a38c2 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/08e3d7dc-4141-43f4-b1dd-b041660a38c2 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented with |
--no-redirect opt-out
|
@copilot adding or removing a redirect should be flagged by the "approval" checker and added to the security review message. |
There was a problem hiding this comment.
Pull request overview
Adds a redirect frontmatter field to support moved workflow locations, and teaches gh aw update to follow (or refuse) redirect chains while updating workflow source to the resolved location.
Changes:
- Extend workflow frontmatter types + schema to include
redirect, and serialize it back to maps. - Emit an informational compiler message when a workflow is configured as a redirect stub.
- Update
gh aw updateto resolve redirect chains (with loop/depth protection) and add--no-redirectto fail instead of following redirects, plus related tests.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/workflow_builder.go | Plumbs extracted redirect into initial WorkflowData. |
| pkg/workflow/redirect_field_test.go | Adds tests for redirect extraction and compile messaging. |
| pkg/workflow/frontmatter_types_test.go | Extends typed frontmatter parsing test to include redirect. |
| pkg/workflow/frontmatter_types.go | Adds Redirect to FrontmatterConfig. |
| pkg/workflow/frontmatter_serialization.go | Includes redirect in FrontmatterConfig.ToMap(). |
| pkg/workflow/frontmatter_extraction_metadata.go | Implements extractRedirect from raw frontmatter. |
| pkg/workflow/compiler_types.go | Adds Redirect to WorkflowData. |
| pkg/workflow/compiler.go | Prints an info message when Redirect is present. |
| pkg/parser/schemas/main_workflow_schema.json | Adds redirect to the JSON schema. |
| pkg/cli/update_workflows.go | Routes workflow updates through redirect-resolution and adds noRedirect plumbing. |
| pkg/cli/update_redirects_test.go | Adds unit tests for redirect normalization, chain following, loops, and --no-redirect. |
| pkg/cli/update_redirects.go | Implements redirect-chain resolution, normalization, and extraction from content. |
| pkg/cli/update_merge.go | Allows merge helper to accept either a ref or a full new source spec. |
| pkg/cli/update_command_test.go | Updates RunUpdateWorkflows calls for the new parameter. |
| pkg/cli/update_command.go | Adds the --no-redirect flag and plumbs it into update execution. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 15/15 changed files
- Comments generated: 2
| if !force && currentRef == latestRef && len(resolvedLocation.redirectHistory) == 0 { | ||
| updateLog.Printf("Workflow already at latest ref: %s, checking for local modifications", currentRef) | ||
|
|
||
| // Download the source content to check if local file has been modified | ||
| sourceContent, err := downloadWorkflowContent(ctx, sourceSpec.Repo, sourceSpec.Path, currentRef, verbose) | ||
| sourceContent, err := downloadWorkflowContentFn(ctx, sourceSpec.Repo, sourceSpec.Path, currentRef, verbose) | ||
| if err != nil { |
There was a problem hiding this comment.
In the up-to-date fast path, this downloads the source content again even though resolveRedirectedUpdateLocation already downloaded resolvedLocation.content at latestRef. When currentRef == latestRef and there were no redirects, you can reuse resolvedLocation.content for the local-modification comparison to avoid an extra network/API call per workflow.
See below for a potential fix:
// Reuse the resolved source content for comparison since it was already
// downloaded at latestRef and this fast path only applies when the current
// ref matches latestRef and no redirects occurred.
sourceContent := newContent
| } | ||
|
|
||
| if noRedirect { | ||
| return nil, fmt.Errorf("redirect is disabled by --no-redirect for %s: %s declares redirect to %s (remove redirect frontmatter or run update without --no-redirect)", workflowName, sourceSpecWithRef(current, latestRef), redirect) |
There was a problem hiding this comment.
The --no-redirect error message suggests the user can "remove redirect frontmatter", but the redirect is typically in the upstream (source) workflow file and may not be editable by the user running gh aw update. Consider changing the guidance to something actionable locally (e.g., update the local source field to the redirected location, or rerun without --no-redirect).
| return nil, fmt.Errorf("redirect is disabled by --no-redirect for %s: %s declares redirect to %s (remove redirect frontmatter or run update without --no-redirect)", workflowName, sourceSpecWithRef(current, latestRef), redirect) | |
| return nil, fmt.Errorf("redirect is disabled by --no-redirect for %s: %s declares redirect to %s (update your local source to %s or run update without --no-redirect)", workflowName, sourceSpecWithRef(current, latestRef), redirect, redirect) |
Generated by Design Decision Gate workflow to capture the architectural decision to introduce a `redirect` frontmatter field for workflow updates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Commit pushed:
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (451 new lines in AI has analyzed the PR diff and generated a draft ADR to help you get started: 📄 Draft ADR: What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
References: §24575079707
|
…rnings Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e427c0ce-2646-4e35-83d9-c6ac1cf4aacc Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e427c0ce-2646-4e35-83d9-c6ac1cf4aacc Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added integration coverage in
Implemented: safe-update approval checks now flag redirect additions/removals (including redirect target changes), and the security review guidance message now includes redirect changes. Addressed in commits Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e427c0ce-2646-4e35-83d9-c6ac1cf4aacc Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e427c0ce-2646-4e35-83d9-c6ac1cf4aacc Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e427c0ce-2646-4e35-83d9-c6ac1cf4aacc Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
--no-redirect opt-out--no-redirect and safe-update approval checks
…ix codemods - Add redirect: frontmatter field reference (gh aw update follows redirect chains; --no-redirect flag refuses redirected updates) - Document allowed-base-branches for create-pull-request safe output (enables per-run base branch override by the agent within policy-gated glob patterns) - Add steps-run-secrets-to-env and engine-env-secrets-to-engine-config codemods to gh aw fix reference (strict-mode secret leak remediation) Refs: #26903, #26916, #26919 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
redirectfrontmatter support to schema and typed frontmatter structuresgh aw updatefollow redirect chains, rewritesourceto resolved location, warn on redirect hops, and stop on redirect loopsgh aw update --no-redirectto refuse redirected updates (fails whenredirectis present instead of following it)gh-aw-manifestso redirect changes are compared across compilations--no-redirectrefusal behavior, redirect-related integration coverage, and redirect safe-update enforcementValidation
go test -run "TestNormalizeRedirectToSourceSpec|TestResolveRedirectedUpdateLocation|TestMergeWorkflowContent_.*|TestRunUpdateWorkflows_NoSourceWorkflows|TestRunUpdateWorkflows_SpecificWorkflowNotFound" ./pkg/cligo test -run "TestResolveRedirectedUpdateLocation/refuses_redirect_when_no-redirect_is_enabled" ./pkg/cligo test -tags=integration -run "TestUpdateCommand_NoRedirectFlag|TestSafeUpdateFirstCompileCreatesBaselineForRedirect" ./pkg/cligo test -run "TestEnforceSafeUpdate|TestBuildSafeUpdateError|TestNewGHAWManifest|TestGHAWManifestToJSON|TestExtractGHAWManifestFromLockFile|TestRedirectFieldExtraction|TestCompileWorkflow_PrintsRedirectInfoMessage|TestParseFrontmatterConfig/parses_complete_workflow_config" ./pkg/workflowmake agent-finish(fails due pre-existing unrelated testifylint issues inpkg/constants/spec_test.go)