Skip to content

Rename getPlaywrightDomainsCodemod to getPlaywrightDomainsToNetworkAllowedCodemod#22872

Merged
pelikhan merged 2 commits into
mainfrom
copilot/rename-go-functions-playwright-plugins
Mar 25, 2026
Merged

Rename getPlaywrightDomainsCodemod to getPlaywrightDomainsToNetworkAllowedCodemod#22872
pelikhan merged 2 commits into
mainfrom
copilot/rename-go-functions-playwright-plugins

Conversation

Copilot AI commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Codemod function names follow a *To*Codemod convention to make migration direction explicit, but getPlaywrightDomainsCodemod omitted the destination (network.allowed), making it hard to discover by agents or developers searching for "migrate playwright domains to network firewall config."

Changes

  • codemod_playwright_domains.go — rename function definition and update comment
  • codemod_playwright_domains_test.go — update all 9 call sites
  • fix_codemods.go — update registration call site

The new name aligns with the existing pattern:

Before After
getPlaywrightDomainsCodemod() getPlaywrightDomainsToNetworkAllowedCodemod()

Consistent with siblings: getPluginsToDependenciesCodemod, getRolesToOnRolesCodemod, getMigrateWritePermissionsToReadCodemod.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Rename Go functions in codemod_playwright_domains.go and codemod_plugins.go Rename getPlaywrightDomainsCodemod to getPlaywrightDomainsToNetworkAllowedCodemod Mar 25, 2026
Copilot AI requested a review from pelikhan March 25, 2026 11:32
@pelikhan pelikhan marked this pull request as ready for review March 25, 2026 11:32
Copilot AI review requested due to automatic review settings March 25, 2026 11:32
@pelikhan pelikhan merged commit 563b211 into main Mar 25, 2026
@pelikhan pelikhan deleted the copilot/rename-go-functions-playwright-plugins branch March 25, 2026 11:32

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.

Pull request overview

Renames the Playwright domains codemod constructor to make the migration destination (network.allowed) explicit and easier to discover/search.

Changes:

  • Renamed getPlaywrightDomainsCodemod to getPlaywrightDomainsToNetworkAllowedCodemod
  • Updated codemod registry to use the new constructor name
  • Updated test call sites to reference the renamed constructor

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/cli/codemod_playwright_domains.go Renames the codemod constructor and aligns the doc comment with the new name.
pkg/cli/codemod_playwright_domains_test.go Updates all constructor call sites in tests to the new function name.
pkg/cli/fix_codemods.go Updates codemod registry registration to call the renamed constructor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -11,7 +11,7 @@ import (
)

func TestGetPlaywrightDomainsCodemod(t *testing.T) {

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test name no longer matches the constructor under test. To keep tests discoverable and consistent with the other codemod tests (e.g., codemod_roles_test.go:14), rename TestGetPlaywrightDomainsCodemod to TestGetPlaywrightDomainsToNetworkAllowedCodemod.

Suggested change
func TestGetPlaywrightDomainsCodemod(t *testing.T) {
func TestGetPlaywrightDomainsToNetworkAllowedCodemod(t *testing.T) {

Copilot uses AI. Check for mistakes.
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.

[function-namer] Go function rename plan: codemod_playwright_domains.go, codemod_plugins.go

3 participants