Skip to content

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

Description

@github-actions

🏷️ Go Function Rename Plan

Files Analyzed: pkg/cli/codemod_network_firewall.go, pkg/cli/codemod_permissions_read.go, pkg/cli/codemod_permissions_write.go, pkg/cli/codemod_playwright_domains.go, pkg/cli/codemod_plugins.go, pkg/cli/codemod_roles.go
Analysis Date: 2026-03-25
Round-Robin Position: files 42–48 of 614 total
Function Budget: 10 functions across 6 files

Why This Matters

When AI coding agents search for functions to complete a task, they rely on function names to understand what code does. Clear, descriptive names increase the likelihood that an agent will find the right function instead of reimplementing existing logic.

Rename Suggestions

pkg/cli/codemod_playwright_domains.go

Current Name Suggested Name Reason
getPlaywrightDomainsCodemod() getPlaywrightDomainsToNetworkAllowedCodemod() Makes the migration direction explicit; matches the *To*Codemod naming pattern used by sibling functions

Context: The codebase uses a consistent naming convention for migration codemods:

  • getPluginsToDependenciesCodemod() β€” plugins β†’ dependencies
  • getRolesToOnRolesCodemod() β€” roles β†’ on.roles
  • getMigrateWritePermissionsToReadCodemod() β€” write β†’ read

getPlaywrightDomainsCodemod breaks this pattern by omitting the migration destination (network.allowed). An agent tasked with "migrating playwright allowed domains to network firewall config" would not reliably discover this function, whereas getPlaywrightDomainsToNetworkAllowedCodemod would be immediately found.

All functions in this file (for reference):

  • getPlaywrightDomainsCodemod() β€” ⚠️ Rename suggested (see table above)
  • removeFieldFromPlaywright() β€” βœ… Clear, no change needed

pkg/cli/codemod_network_firewall.go

  • getNetworkFirewallCodemod() β€” βœ… Clear, no change needed

pkg/cli/codemod_permissions_read.go

  • getExpandPermissionsShorthandCodemod() β€” βœ… Clear, no change needed

pkg/cli/codemod_permissions_write.go

  • getMigrateWritePermissionsToReadCodemod() β€” βœ… Clear, no change needed

pkg/cli/codemod_plugins.go

  • getPluginsToDependenciesCodemod() β€” βœ… Clear, no change needed
  • migratePluginsToDependencies() β€” βœ… Clear, no change needed
  • rewritePluginsBlock() β€” βœ… Acceptable (unexported helper, single call site)
  • rewriteObjectFormatPlugins() β€” βœ… Clear, no change needed

pkg/cli/codemod_roles.go

  • getRolesToOnRolesCodemod() β€” βœ… Clear, no change needed

πŸ€– Agentic Implementation Plan

Agentic Implementation Plan

This issue is designed to be assigned to a coding agent. The agent should implement all rename suggestions below in a single pull request.

Prerequisites

  • Read the rename suggestion and verify it is accurate by reviewing the function body
  • Confirm getPlaywrightDomainsCodemod is not implementing a Go interface method (it is not β€” it returns a Codemod struct, no interface constraint)

Implementation Steps

1. Rename the function in pkg/cli/codemod_playwright_domains.go

// Old
func getPlaywrightDomainsCodemod() Codemod {

// New
func getPlaywrightDomainsToNetworkAllowedCodemod() Codemod {

2. Update all call sites

grep -rn "getPlaywrightDomainsCodemod" pkg/ --include="*.go"

Expected call sites to update:

  • pkg/cli/fix_codemods.go:46 β€” in GetAllCodemods()
  • pkg/cli/codemod_playwright_domains_test.go β€” 9 test function calls

Also check test files:

grep -rn "getPlaywrightDomainsCodemod" pkg/ --include="*_test.go"

3. Verify compilation after the rename

make build

4. Run tests after the rename is complete

make test-unit
make lint
```

### Commit Convention

```
refactor: rename getPlaywrightDomainsCodemod to getPlaywrightDomainsToNetworkAllowedCodemod for clarity

Validation Checklist

  • Rename implemented in codemod_playwright_domains.go
  • Call site updated in fix_codemods.go
  • All 9 test call sites updated in codemod_playwright_domains_test.go
  • make build passes with no errors
  • make test-unit passes
  • make lint passes
  • PR description explains the agent-discoverability rationale

Notes for the Agent

  • This is a pure rename refactor β€” behavior must not change, only the name
  • Follow existing naming conventions documented in AGENTS.md
  • The new name follows the established *To*Codemod pattern used throughout this package

Generated by the Daily Go Function Namer workflow
Run: Β§23538009816

Generated by Daily Go Function Namer Β· β—·

  • expires on Apr 1, 2026, 11:15 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions