Skip to content

Cover nested fragments in Copilot web-fetch codemod tests - #75298

Merged
pelikhan merged 2 commits into
mainfrom
copilot/testify-expert-improve-test-quality
Nov 6, 2026
Merged

pelikhan merged 2 commits into
mainfrom
copilot/testify-expert-improve-test-quality

Conversation

Copilot AI commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Nested fragments: Verify missing engine metadata preserves web-fetch.
  • Explicit engine: Verify web-fetch is removed when the fragment declares Copilot.

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing tests for isNestedWorkflowFragment in codemod_copilot_web_fetch Cover nested fragments in Copilot web-fetch codemod tests Nov 6, 2026
Copilot AI requested a review from gh-aw-bot November 6, 2026 04:39
@pelikhan
pelikhan marked this pull request as ready for review November 6, 2026 08:06
Copilot AI adaptive review requested due to automatic review settings November 6, 2026 08:06
@pelikhan
pelikhan merged commit a17ef77 into main Nov 6, 2026
48 checks passed
@pelikhan
pelikhan deleted the copilot/testify-expert-improve-test-quality branch November 6, 2026 08:06
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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: reported_no_action

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.

Generated from Design Decision Gate 🏗ïļ Â· routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗ïļ ADR gate enforced by Design Decision Gate 🏗ïļ

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #75298

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

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.

Generated from PR Specification Reviewer · gpt56 · ~1 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #75298

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

Generated from Test Quality Sentinel · routed: gpt56 max · ~1 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧊 Test quality analysis by Test Quality Sentinel

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

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-fetch is preserved when nested fragments lack engine metadata.
  • Verifies web-fetch is 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)

Comment on lines +318 to +340
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")
}
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.1

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.

[testify-expert] Improve Test Quality: pkg/cli/codemod_copilot_web_fetch_test.go

4 participants