Repository navigation
Cover nested fragments in Copilot web-fetch codemod tests - #75298
Conversation
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
ð§ Matt Pocock Skills Reviewer has completed the skills-based review. â
|
|
â Design Decision Gate ðïļ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate ðïļOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
â PR Code Quality Reviewer completed the code quality review.
|
|
â Ponytail Reviewer completed successfully!
|
|
â PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
â Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
ðĄ Changes recommended
An active nit identifies duplicated regression coverage that should be consolidated by moving the existing test rather than retaining both copies.
1 open issue
What changed in this PR
Adds regression coverage for the Copilot web-fetch codemod when handling nested workflow fragments with and without explicit engine metadata.
Changes:
- Verifies
web-fetchis preserved when nested fragments lack engine metadata. - Verifies
web-fetchis removed when nested fragments explicitly declare Copilot.
| File | Summary | Review |
|---|---|---|
pkg/âcli/âcodemod_copilot_web_fetch_test.go |
Adds nested-fragment preservation and explicit-Copilot removal regression cases. | Nit: Equivalent coverage already exists in pkg/cli/codemod_copilot_web_search_test.go; consolidate the tests by moving the existing test rather than retaining duplicates. |
Review effort: Lite (auto)
| func TestCopilotWebFetchRemovalCodemod_PreservesNestedFragmentWithoutEngine(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| filePath := filepath.Join(t.TempDir(), ".github", "workflows", "shared", "fragment.md") | ||
| content := "---\ntools:\n web-fetch: true\n---\n" | ||
| frontmatter, err := parser.ExtractFrontmatterFromContent(content) | ||
| require.NoError(t, err) | ||
|
|
||
| codemod := getCopilotWebFetchRemovalCodemod() | ||
| updated, applied, err := codemod.ApplyWithContext(content, frontmatter.Frontmatter, filePath) | ||
| require.NoError(t, err) | ||
| assert.False(t, applied) | ||
| assert.Equal(t, content, updated) | ||
|
|
||
| contentWithEngine := strings.Replace(content, "---\n", "---\nengine: copilot\n", 1) | ||
| frontmatter, err = parser.ExtractFrontmatterFromContent(contentWithEngine) | ||
| require.NoError(t, err) | ||
|
|
||
| updated, applied, err = codemod.ApplyWithContext(contentWithEngine, frontmatter.Frontmatter, filePath) | ||
| require.NoError(t, err) | ||
| assert.True(t, applied) | ||
| assert.NotContains(t, updated, "web-fetch") | ||
| } |
|
ð This pull request is included in a new release. Release: |

The web-fetch codemod tests lacked coverage for nested workflow fragments without local engine metadata. Add regression coverage for preserving the setting in that case and removing it when the fragment explicitly declares Copilot.
web-fetch.web-fetchis removed when the fragment declares Copilot.