Skip to content

Fix mapsloop lint violation in safe output app permission merge#30480

Merged
pelikhan merged 1 commit intomainfrom
copilot/lint-go-code
May 6, 2026
Merged

Fix mapsloop lint violation in safe output app permission merge#30480
pelikhan merged 1 commit intomainfrom
copilot/lint-go-code

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

The lint-go job was failing on pkg/workflow/safe_outputs_app_config.go due to a modernize/mapsloop finding. The failure came from manually copying entries from a temporary permission map into permissionFields.

  • What changed

    • Replaced the ad hoc for k, v := range ... merge with maps.Copy(...) when applying github-app.permissions overrides.
    • Added the standard library maps import required for the merge.
  • Why this area

    • The affected code builds permission-* inputs for GitHub App token minting.
    • This keeps the existing override behavior intact while aligning the implementation with the lint rule enforced in CI.
  • Code shape

    tempPerms := NewPermissionsFromMap(map[PermissionScope]PermissionLevel{
    	scope: PermissionLevel(level),
    })
    maps.Copy(permissionFields, convertPermissionsToAppTokenFields(tempPerms))

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/498ac309-ad6b-469d-a0ad-72fd63a231e6

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review May 6, 2026 01:53
Copilot AI review requested due to automatic review settings May 6, 2026 01:53
@pelikhan pelikhan merged commit 4a61d41 into main May 6, 2026
@pelikhan pelikhan deleted the copilot/lint-go-code branch May 6, 2026 01:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a modernize/mapsloop lint failure by replacing a manual map merge loop with the standard library maps.Copy when applying github-app.permissions overrides during GitHub App token mint-step generation.

Changes:

  • Added the maps stdlib import to pkg/workflow/safe_outputs_app_config.go.
  • Replaced the manual for k, v := range ... { ... } map merge with maps.Copy(...) for permission field overrides.
Show a summary per file
File Description
pkg/workflow/safe_outputs_app_config.go Uses maps.Copy to merge app permission override fields into permissionFields, resolving the lint finding.

Copilot's findings

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

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.

3 participants