Skip to content

Rename GetActionPinWithData to ResolveActionPin in pkg/actionpins#26657

Merged
pelikhan merged 2 commits intomainfrom
copilot/function-rename-pkg-actionpins
Apr 16, 2026
Merged

Rename GetActionPinWithData to ResolveActionPin in pkg/actionpins#26657
pelikhan merged 2 commits intomainfrom
copilot/function-rename-pkg-actionpins

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

This updates pkg/actionpins naming to better reflect behavior: the function doesn’t just “get with data,” it resolves a pin via dynamic lookup first, then embedded fallback. The change improves API discoverability without changing resolution logic.

  • API rename (pkg/actionpins)

    • Renamed exported function:
      • GetActionPinWithData(actionRepo, version, ctx)ResolveActionPin(actionRepo, version, ctx)
    • Updated the function doc comment to match the new intent-focused name.
  • Call-site updates

    • Updated internal usage in pkg/actionpins/GetCachedActionPin.
    • Updated pkg/workflow delegation in getActionPinWithData(...) to call actionpins.ResolveActionPin(...).
  • Package docs sync

    • Updated pkg/actionpins/README.md public API table to reference ResolveActionPin.
// before
pinnedRef, err := actionpins.GetActionPinWithData(actionRepo, version, data.PinContext())

// after
pinnedRef, err := actionpins.ResolveActionPin(actionRepo, version, data.PinContext())

Copilot AI linked an issue Apr 16, 2026 that may be closed by this pull request
11 tasks
Copilot AI changed the title [WIP] Refactor function names in pkg/actionpins for clarity Rename GetActionPinWithData to ResolveActionPin in pkg/actionpins Apr 16, 2026
Copilot AI requested a review from pelikhan April 16, 2026 14:38
@pelikhan pelikhan marked this pull request as ready for review April 16, 2026 14:42
Copilot AI review requested due to automatic review settings April 16, 2026 14:42
@pelikhan pelikhan merged commit d510f01 into main Apr 16, 2026
51 of 53 checks passed
@pelikhan pelikhan deleted the copilot/function-rename-pkg-actionpins branch April 16, 2026 14:43
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

Renames the exported action pin resolution helper in pkg/actionpins to better reflect that it performs resolution (dynamic lookup + embedded fallback), and updates internal call sites/docs accordingly.

Changes:

  • Renamed exported API GetActionPinWithDataResolveActionPin in pkg/actionpins.
  • Updated internal callers (pkg/actionpins cache path and pkg/workflow delegation) to use the new name.
  • Updated pkg/actionpins/README.md public API table to reflect the new function name.
Show a summary per file
File Description
pkg/workflow/action_pins.go Updates workflow delegation helper to call actionpins.ResolveActionPin.
pkg/actionpins/actionpins.go Renames the exported resolver function and updates internal cache helper call site.
pkg/actionpins/README.md Syncs public API documentation to the renamed function.

Copilot's findings

Tip

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

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

Comment on lines +216 to +219
// ResolveActionPin returns the pinned action reference for a given action@version.
// It consults ctx.Resolver first, then falls back to embedded pins.
// If ctx is nil, only embedded pins are consulted.
func GetActionPinWithData(actionRepo, version string, ctx *PinContext) (string, error) {
func ResolveActionPin(actionRepo, version string, ctx *PinContext) (string, error) {
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

Renaming this exported function is a breaking API change for any downstream consumers of pkg/actionpins. To preserve backward compatibility (consistent with other deprecated APIs in this repo), consider keeping GetActionPinWithData as a thin wrapper that calls ResolveActionPin, and mark it with a // Deprecated: Use ResolveActionPin. doc comment. If the intention is to break API, this should at least be accompanied by an explicit deprecation/removal plan in release notes.

Copilot uses AI. Check for mistakes.
@github-actions github-actions Bot mentioned this pull request Apr 16, 2026
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.

[function-namer] Go function rename plan: pkg/actionpins

3 participants