Add getValidReactions function to compute valid reaction list dynamically#2244
Merged
pelikhan merged 2 commits intoq/reaction-schema-default-validation-ab90b2019d4d10dffrom Oct 23, 2025
Conversation
…lidReactions map Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add function for valid reaction entries in schema
Add getValidReactions function to compute valid reaction list dynamically
Oct 23, 2025
9cceb0c
into
q/reaction-schema-default-validation-ab90b2019d4d10df
pelikhan
added a commit
that referenced
this pull request
Oct 23, 2025
…on in parser (#2241) * Add default 'eyes' reaction in schema and reaction value validation in parser - Added 'default: eyes' to reaction field in main_workflow_schema.json - Added isValidReaction() helper function to validate reaction values - Added validation when parsing reaction field to reject invalid values - Added TestInvalidReactionValue test to verify validation works correctly This ensures that invalid reaction values are caught early with helpful error messages, and documents the default behavior in the schema. * Remove .serena files and refactor isValidReaction to reactions.go (#2242) * Initial plan * Remove .serena directory and move isValidReaction to reactions.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Add getValidReactions function to compute valid reaction list dynamically (#2244) * Initial plan * Add getValidReactions function to compute valid reaction list from validReactions map Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: Q <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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.
This PR addresses feedback from #2241 by refactoring the reaction validation logic to eliminate code duplication.
Changes
Previously, the valid reaction values were defined in two places:
isValidReaction()function as a local mapcompiler.goThis PR refactors the code to:
validReactionsmap to package level inreactions.gogetValidReactions()function that dynamically computes the list of valid reactions from the map keyscompiler.goto usegetValidReactions()instead of the hardcoded listBenefits
Example
Fixes feedback in #2241
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.