Conversation
… version (v5.1.0→v5.2.0) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates workflow action pin tests to reflect the latest action_pins.json data so that the pkg/workflow test suite passes after new pin entries were added and actions/setup-dotnet was bumped.
Changes:
- Update
TestGetActionPinsSortingexpected pin count from 32 to 34. - Update
TestActionPinResolutionWithMismatchedVersionsto expectactions/setup-dotnetfallback pinv5.2.0and rename the subtest accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/workflow/action_pins_test.go | Adjusts expected total pin count in sorting test to match updated embedded pins. |
| pkg/workflow/action_pins_logging_test.go | Updates expected fallback pin version and test name for actions/setup-dotnet mismatch-resolution logging test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| // 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)) |
There was a problem hiding this comment.
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.
| 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, |
There was a problem hiding this comment.
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.
action_pins.jsonwas updated with 2 new entries andactions/setup-dotnetbumped fromv5.1.0→v5.2.0, causing two test failures inpkg/workflow.Changes
action_pins_test.go: UpdateTestGetActionPinsSortingexpected pin count32→34action_pins_logging_test.go: UpdateTestActionPinResolutionWithMismatchedVersionssetup-dotnet subtestfallbackPinVer"v5.1.0"→"v5.2.0"and rename test case to matchOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.