Skip to content

[task] Resolve ValidatePermissions naming conflict between imports.go and permissions_validator.go #3537

@github-actions

Description

@github-actions

Objective

Rename conflicting ValidatePermissions functions to clarify their distinct purposes and prevent confusion.

Context

Two different ValidatePermissions functions exist with different signatures:

  • pkg/workflow/imports.go:347 - Part of Compiler, validates permissions from included files
  • pkg/workflow/permissions_validator.go:92 - Standalone function using PermissionsValidator

This creates confusion when calling validation functions and makes the codebase harder to navigate.

Part of issue #3435.

Approach

1. Analyze function purposes

Review both functions to understand their specific responsibilities:

  • imports.go version: Validates permissions when merging included files
  • permissions_validator.go version: General permission validation

2. Rename for clarity

Rename the imports.go function to ValidateIncludedPermissions to reflect its specific purpose of validating permissions from included files.

Keep the permissions_validator.go function as ValidatePermissions since it's the general-purpose validator.

3. Update all callers

  • Find all references to the renamed function
  • Update function calls to use the new name
  • Update any related documentation or comments

4. Add documentation

Add clear comments explaining:

  • When to use ValidatePermissions (general validation)
  • When to use ValidateIncludedPermissions (when merging includes)

Files to Modify

  • pkg/workflow/imports.go - Rename function from ValidatePermissions to ValidateIncludedPermissions
  • All files that call imports.go's ValidatePermissions function
  • Add documentation comments to both functions

Acceptance Criteria

AI generated by Plan Command for #3435

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions