Skip to content

Update action pin tests to match updated action_pins.json data#19794

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-github-actions-workflow-90f5bb25-67da-4868-97c4-b37669640400
Mar 6, 2026
Merged

Update action pin tests to match updated action_pins.json data#19794
pelikhan merged 2 commits intomainfrom
copilot/fix-github-actions-workflow-90f5bb25-67da-4868-97c4-b37669640400

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

action_pins.json was updated with 2 new entries and actions/setup-dotnet bumped from v5.1.0v5.2.0, causing two test failures in pkg/workflow.

Changes

  • action_pins_test.go: Update TestGetActionPinsSorting expected pin count 3234
  • action_pins_logging_test.go: Update TestActionPinResolutionWithMismatchedVersions setup-dotnet subtest fallbackPinVer "v5.1.0""v5.2.0" and rename test case to match
Original prompt

Fix the failing GitHub Actions workflow test
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 65972499171
Job URL: https://github.com/github/gh-aw/actions/runs/22746889653/job/65972499171


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… version (v5.1.0→v5.2.0)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow test Update action pin tests to match updated action_pins.json data Mar 6, 2026
@pelikhan pelikhan marked this pull request as ready for review March 6, 2026 03:31
Copilot AI review requested due to automatic review settings March 6, 2026 03:31
@pelikhan pelikhan merged commit d9e692e into main Mar 6, 2026
@pelikhan pelikhan deleted the copilot/fix-github-actions-workflow-90f5bb25-67da-4868-97c4-b37669640400 branch March 6, 2026 03:31
Copy link
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

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 TestGetActionPinsSorting expected pin count from 32 to 34.
  • Update TestActionPinResolutionWithMismatchedVersions to expect actions/setup-dotnet fallback pin v5.2.0 and 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.

Comment on lines +300 to +302
// 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))
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.
Comment on lines +37 to 42
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,
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.
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