Skip to content

[Code Quality] Rename PolicyRule in pkg/cli/firewall_policy.go to FirewallPolicyRule #46944

Description

@github-actions

Description

PolicyRule is defined in two unrelated packages with the same name:

  1. pkg/cli/firewall_policy.go:36 — a firewall ACL rule (fields: ID, Order, Action, ACLName, Protocol, Domains, ...)
  2. pkg/intent/policy.go:46 — an intent execution-policy rule (fields: ID, Scope, When, Set)

These are unrelated concepts sharing only an ID field and are not merge candidates. The name collision causes confusion in cross-package code reviews and text searches.

Suggested Changes

Rename PolicyRule in pkg/cli/firewall_policy.go to FirewallPolicyRule to make the distinction explicit. Update all references in the same package.

Files Affected

  • pkg/cli/firewall_policy.go — rename struct PolicyRuleFirewallPolicyRule
  • Any files in pkg/cli/ that reference PolicyRule (check with grep -r "PolicyRule" pkg/cli/)

Success Criteria

  • FirewallPolicyRule used consistently in pkg/cli/
  • pkg/intent/policy.go unchanged
  • make build passes; all tests pass
  • No ambiguous PolicyRule references in cross-package searches

Source

Extracted from Typist Go Type Consistency Analysis discussion #46823

Priority

Low — reduces cross-package confusion; effort < 1 hour

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 46.7 AIC · ⌖ 7.94 AIC · ⊞ 7K ·

  • expires on Jul 21, 2026, 5:17 PM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions