Remove hardcoded action pins lists from tests#3922
Merged
Conversation
Read action pins exclusively from action_pins.json instead of maintaining duplicate hardcoded lists in test files. This ensures: - Tests automatically cover all actions defined in JSON - No need to manually sync test lists when JSON changes - Single source of truth for action pins data Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove builtin action pins list and read from actions_pins.json
Remove hardcoded action pins lists from tests
Nov 14, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR eliminates code duplication by removing hardcoded action lists from test files in favor of dynamically reading from the centralized action_pins.json file. The change improves maintainability by ensuring tests automatically cover all actions defined in the JSON configuration without requiring manual updates to test code.
Key changes:
- Replaced hardcoded 14-action test arrays with dynamic iteration over all actions from
getActionPins() - Tests now automatically cover all 18 actions in the JSON file (previously only 14)
- Added defensive checks to ensure action pins are successfully loaded before running tests
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests contained hardcoded lists of action names that duplicated data already in
action_pins.json, creating maintenance burden and incomplete coverage (14 of 18 actions tested).Changes
Modified
pkg/workflow/action_pins_test.go:TestActionPinsExist: Removed hardcoded 14-action array, now iterates over all actions fromgetActionPins()TestGetActionPinReturnsValidSHA: Removed hardcoded test table, dynamically generates test cases fromgetActionPins()Before:
After:
Impact
Original 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.