Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/workflow/action_pins_logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ func TestActionPinResolutionWithMismatchedVersions(t *testing.T) {
expectMismatch: true,
},
{
name: "setup-dotnet v5 resolves to v5.1.0 pin but comment shows v5",
name: "setup-dotnet v5 resolves to v5.2.0 pin but comment shows v5",
repo: "actions/setup-dotnet",
requestedVer: "v5",
expectedCommentVer: "v5", // Comment shows requested version
fallbackPinVer: "v5.1.0",
fallbackPinVer: "v5.2.0",
expectMismatch: true,
Comment on lines +37 to 42
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

fallbackPinVer is pinned to a specific patch version, so this subtest will break on every actions/setup-dotnet pin bump. Consider computing the expected fallback version from the hardcoded pins at runtime (e.g., by selecting the semver-compatible pin for repo/requestedVer using getActionPins()/sortPinsByVersion) so the test continues to validate warning contents without needing manual updates.

Copilot uses AI. Check for mistakes.
},
{
Expand Down
6 changes: 3 additions & 3 deletions pkg/workflow/action_pins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ func TestApplyActionPinToStep(t *testing.T) {
func TestGetActionPinsSorting(t *testing.T) {
pins := getActionPins()

// Verify we got all the pins (32 as of March 2026)
if len(pins) != 32 {
t.Errorf("getActionPins() returned %d pins, expected 32", len(pins))
// Verify we got all the pins (34 as of March 2026)
if len(pins) != 34 {
t.Errorf("getActionPins() returned %d pins, expected 34", len(pins))
Comment on lines +300 to +302
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

This test hard-codes the total pin count, which will require updating the test every time data/action_pins.json changes. Consider deriving the expected count by unmarshaling the embedded actionPinsJSON (or otherwise reading the source pins) and asserting len(getActionPins()) == len(data.Entries) so the test validates parsing without becoming stale.

Copilot uses AI. Check for mistakes.
}

// Verify they are sorted by version (descending) then by repository name (ascending)
Expand Down