Skip to content

refactor(workflow): consolidate duplicate runtime action repo maps - #41809

Merged
pelikhan merged 4 commits into
mainfrom
copilot/deep-report-consolidate-duplicate-runtime-maps
Jun 27, 2026
Merged

refactor(workflow): consolidate duplicate runtime action repo maps#41809
pelikhan merged 4 commits into
mainfrom
copilot/deep-report-consolidate-duplicate-runtime-maps

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

safe_update_enforcement.go maintained a runtimeActionRepos map[string]bool that was simply the key-set of actionRepoToRuntime (already built in runtime_definitions.go), causing a redundant walk of knownRuntimes at startup and two sources of truth for the same data.

Changes

  • pkg/workflow/safe_update_enforcement.go: Remove runtimeActionRepos variable and its init() loop; update isTrustedActionRepo to derive membership directly from actionRepoToRuntime:
// Before
return runtimeActionRepos[repo]

// After
_, ok := actionRepoToRuntime[repo]
return ok

No behavior change — actionRepoToRuntime already covers all non-empty ActionRepo values from knownRuntimes.


pr-sous-chef run 28270977547 requested a branch refresh.

Generated by 👨‍🍳 PR Sous Chef · 83.6 AIC · ⌖ 0.993 AIC · ⊞ 17.2K ·

Copilot AI and others added 2 commits June 26, 2026 22:42
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…oToRuntime

Remove the redundant `runtimeActionRepos map[string]bool` and its `init()` loop
from `safe_update_enforcement.go`. `isTrustedActionRepo` now derives membership
directly from `actionRepoToRuntime` (the existing map built in runtime_definitions.go),
eliminating a second startup walk of `knownRuntimes` and providing a single source
of truth for runtime action repos.

Closes #41738

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Consolidate duplicate runtime maps runtimeActionRepos and actionRepoToRuntime refactor(workflow): consolidate duplicate runtime action repo maps Jun 26, 2026
Copilot AI requested a review from pelikhan June 26, 2026 22:46
@pelikhan
pelikhan marked this pull request as ready for review June 26, 2026 23:03
Copilot AI review requested due to automatic review settings June 26, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors trusted-action enforcement to remove a redundant runtime action repo set by reusing the already-initialized actionRepoToRuntime map, reducing duplicated initialization work and eliminating two sources of truth.

Changes:

  • Removed runtimeActionRepos and its init() population loop from safe_update_enforcement.go.
  • Updated isTrustedActionRepo to treat “trusted runtime-manager actions” as the key-set of actionRepoToRuntime.
Show a summary per file
File Description
pkg/workflow/safe_update_enforcement.go Drops the duplicate runtime action repo set and checks trust via actionRepoToRuntime.
.github/workflows/detection-analysis-report.lock.yml Updates the generated workflow lock metadata (body_hash).

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment on lines +145 to +146
_, ok := actionRepoToRuntime[repo]
return ok
@@ -1,4 +1,4 @@
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"179078ab5cd745919117a67bbc9f30c8448c98b0e4187f2caff2175422ea4d7a","body_hash":"ae74f30eefbf62ea6b77ee6ffe193e3c614966e23aa890d1366e5b3defa0b9d4","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.191"}}
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"179078ab5cd745919117a67bbc9f30c8448c98b0e4187f2caff2175422ea4d7a","body_hash":"f76f3bc31cbb52b73129dd9c59de35a3d3e319bf3387b10794003672c3dbf0ec","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.191"}}
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address any remaining review feedback, update/rebase this branch from main since it is behind, and rerun checks once it is up to date.

Generated by 👨‍🍳 PR Sous Chef · 83.6 AIC · ⌖ 0.993 AIC · ⊞ 17.2K ·

Copilot AI requested a review from gh-aw-bot June 26, 2026 23:52
@pelikhan
pelikhan merged commit 1fd598d into main Jun 27, 2026
30 checks passed
@pelikhan
pelikhan deleted the copilot/deep-report-consolidate-duplicate-runtime-maps branch June 27, 2026 00:12
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.

4 participants