Rename ValidatePermissions to ValidateIncludedPermissions in imports.go#3546
Merged
Rename ValidatePermissions to ValidateIncludedPermissions in imports.go#3546
Conversation
- Renamed Compiler.ValidatePermissions() to ValidateIncludedPermissions() in pkg/workflow/imports.go - Updated caller in pkg/workflow/compiler.go - Updated test function name in pkg/workflow/permissions_import_test.go - Added comprehensive documentation to both functions explaining their distinct purposes - All tests pass (make test-unit) - Build succeeds (make build) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Rename ValidatePermissions functions to clarify purposes
Rename ValidatePermissions to ValidateIncludedPermissions in imports.go
Nov 9, 2025
pelikhan
approved these changes
Nov 9, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR renames a function to better distinguish between two different permission validation use cases. The function ValidatePermissions in imports.go has been renamed to ValidateIncludedPermissions to clarify that it specifically validates permissions when merging included/imported workflow files, distinguishing it from the general-purpose ValidatePermissions function in permissions_validator.go that validates permissions against GitHub MCP toolsets.
Key changes:
- Renamed
Compiler.ValidatePermissions()toCompiler.ValidateIncludedPermissions()inimports.go - Updated all call sites to use the new function name
- Added comprehensive documentation explaining when to use each validation function
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/workflow/imports.go |
Renamed method from ValidatePermissions to ValidateIncludedPermissions and enhanced documentation to clarify its specific use case for validating imported workflow permissions |
pkg/workflow/permissions_validator.go |
Enhanced documentation for ValidatePermissions function to clarify it's for general MCP toolset validation and distinguish it from the renamed function |
pkg/workflow/compiler.go |
Updated function call from ValidatePermissions to ValidateIncludedPermissions |
pkg/workflow/permissions_import_test.go |
Updated test function name and all error messages to reflect the renamed function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two different
ValidatePermissionsfunctions existed with incompatible signatures, causing navigation confusion:pkg/workflow/imports.go:161- Compiler method validating permissions from imported filespkg/workflow/permissions_validator.go:92- Standalone function validating permissions against GitHub MCP toolsetsChanges
Compiler.ValidatePermissions()→ValidateIncludedPermissions()inpkg/workflow/imports.gopkg/workflow/compiler.go:676TestValidatePermissions→TestValidateIncludedPermissionsUsage
The renamed function clarifies its specific role in the imports workflow, while the standalone validator remains the canonical general-purpose validator.
Original prompt
💡 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.