Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 23, 2025

This PR addresses feedback from #2241 by making two organizational improvements:

Changes

1. Removed .serena directory

The .serena/ directory and its contents have been removed from the repository as they are no longer needed.

2. Refactored reaction validation logic

Moved the isValidReaction function from compiler.go (line 1509) to a new dedicated file pkg/workflow/reactions.go. This improves code organization by:

  • Separating reaction-specific validation logic from the main compiler code
  • Following the existing pattern in the codebase where reaction-related functionality has dedicated files (e.g., reaction_outputs_test.go, reaction_discussion_test.go)
  • Making the codebase more maintainable and easier to navigate

3. Updated test validation

Modified TestInvalidReactionValue in compiler_test.go to handle error messages from both schema validation and custom validation, as the JSON schema validation now occurs before the custom isValidReaction check.

Verification

  • ✅ All unit tests passing
  • ✅ Code formatted and linted
  • ✅ Build successful
  • ✅ All workflows recompiled

Addresses review comments from @pelikhan in #2241.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove .serena files as per review feedback Remove .serena files and refactor isValidReaction to reactions.go Oct 23, 2025
Copilot AI requested a review from pelikhan October 23, 2025 20:44
@pelikhan pelikhan marked this pull request as ready for review October 23, 2025 20:47
@pelikhan pelikhan merged commit a28f376 into q/reaction-schema-default-validation-ab90b2019d4d10df Oct 23, 2025
6 checks passed
@pelikhan pelikhan deleted the copilot/stack-pr-2241 branch October 23, 2025 20:47
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>
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.

2 participants