-
Notifications
You must be signed in to change notification settings - Fork 34
Add comprehensive trigger shorthand syntax parser with fuzz testing and IDE-integrated error messages #7160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…support - Create unified trigger parser with TriggerIR intermediate representation - Add support for all trigger pattern categories from spec: - Source control (push, pull request with filters) - Issue and discussion events - Manual invocation (manual, workflow completed) - Comment patterns - Release and repository lifecycle - Security patterns (dependabot, security alerts) - External integration (api dispatch) - Integrate with existing schedule preprocessing - Maintain backward compatibility with existing parsers - Add comprehensive unit and integration tests - All tests passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ility - Simple triggers like "push" and "pull_request" should remain as strings - Only convert to objects when filters, types, or conditions are needed - Update tests to reflect correct behavior - All trigger tests now passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Update test to expect empty maps instead of nil for simple events - This ensures proper YAML generation without null values - All trigger-related tests now passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add fuzz tester for new parser. |
|
🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS. |
|
✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️ |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
Smoke Test Results✅ File Writing: Created Status: FAIL (1/3 tests passed) Note:
|
Copilot Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Status: PASS @pelikhan - All smoke tests passed successfully.
|
Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Overall Status: PASS (4/5 - gh tool limitation is environmental)
|
|
Recent merged PRs: #7158 "Add --network host to Playwright Docker containers for localhost access"; #7163 "Exclude copilot and GitHub Actions bots from ai-moderator review"
|
|
Merged PR titles: Add --network host to Playwright Docker containers for localhost access; Add short trigger syntax for labeled events with explicit item types.
|
Smoke Test Results - Claude EngineLast 2 Merged PRs:
Test Results:
Overall Status: ✅ PASS
|
- Add FuzzParseTriggerShorthand to test ParseTriggerShorthand function - Validates parser handles arbitrary input without panicking - Tests all trigger pattern categories with valid/invalid variations - Includes edge cases: empty input, long strings, special characters - Validates TriggerIR structure consistency and correctness - Add FuzzTriggerIRToYAMLMap to test YAML map generation - Tests various event types and type combinations - Validates output structure for all cases - Comprehensive seed corpus with 100+ test cases - Follows existing fuzz test patterns in codebase - All fuzz tests pass validation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added comprehensive fuzz testing in commit 382afaf. Created
The fuzz tests validate:
Follows the existing fuzz test patterns in the codebase (similar to |
|
@copilot make sure the syntax error message uses the compiler error former and provides hints on valid syntax in the output . |
- Add detailed error messages with valid syntax examples - Include format expectations and valid options for each trigger type - Provide specific examples in error messages (e.g., 'push to main', 'issue opened') - List all valid activity types when invalid type is provided - Errors now show: what was provided, what's expected, valid options, and examples - Improves user experience when trigger syntax is incorrect Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Improved error messages in commit f43d3b5. All trigger parser errors now include:
Example error output: The errors flow through the existing compiler error handling and are displayed to users with the failed workflow context. |
|
@copilot the error should provide a source location (using the compiler error infrastructure) to provide a better error message experience |
- Update preprocessScheduleFields to accept markdown path and content - Create createTriggerParseError helper to wrap errors with CompilerError - Error messages now include file:line:column format (IDE-parseable) - Display source context with line numbers and visual indicators - Update all test calls to pass required parameters - Improves debugging experience with precise error locations Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added source location in commit 1903812. Error messages now include:
Example: The location is determined by finding the |
Add documentation for the new shorthand label trigger syntax that supports: - Basic format: on: issue labeled bug - Space-separated labels: on: issue labeled bug enhancement - Comma-separated labels: on: issue labeled bug, enhancement Covers features from PRs #7153, #7160, and #7169. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Extends the
on:field parser to support human-readable trigger shorthands that compile deterministically to GitHub Actions trigger configurations. Covers 31+ patterns across source control, issues, discussions, releases, security, and external integration events.Implementation
Unified parser (
trigger_parser.go) with intermediate representation (TriggerIR)Pattern categories
push to <branch>,pull_request merged,pull_request affecting <path>issue opened,discussion created+ 10 more activity typesmanual,manual with input <name>,workflow completed <workflow>dependabot pull request,security alert,code scanning alertrelease published,repository starred,repository forkedapi dispatch <event>Integration via
schedule_preprocessing.goon: pushremain as strings per GitHub Actions specFuzz testing (
trigger_parser_fuzz_test.go)FuzzParseTriggerShorthand- Tests parser with arbitrary input (100+ seed cases)FuzzTriggerIRToYAMLMap- Tests YAML map generationIDE-integrated error messages
Examples
Testing
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.