Add intelligent trigger system for demo generation#4
Merged
DeDuckProject merged 5 commits intomainfrom Mar 12, 2026
Merged
Conversation
…command Introduces a trigger config section to git-glimpse.config.ts that controls when and whether the demo pipeline fires, reducing unnecessary LLM/Playwright resource usage on PRs that don't affect UI. - Three modes: auto (default), on-demand, smart (threshold-based) - User-configurable include/exclude glob patterns replace hardcoded isUIFile heuristics - /glimpse PR comment command for on-demand triggering (supports --force and --route flags) - action/src/index.ts now handles both pull_request and issue_comment events - Posts a skip comment with explanation and /glimpse hint when pipeline is skipped - 29 new unit tests covering command parser, file filter, and trigger decision logic https://claude.ai/code/session_01F7qRXukhynYjUukzhaBzSK
GitGlimpse — SkippedOn-demand mode is enabled. Comment Generated by git-glimpse |
Configure the example app to use trigger.mode: 'on-demand' so the pipeline only runs when /glimpse is commented on a PR. Added issue_comment event to the demo workflow to support this. https://claude.ai/code/session_01F7qRXukhynYjUukzhaBzSK
Owner
Author
|
/glimpse |
On issue_comment events, GitHub checks out the default branch by default, which doesn't have the trigger code. Now we explicitly check out the PR head ref. Also added a job-level `if` guard to skip non-PR comments and comments that don't contain /glimpse. https://claude.ai/code/session_01F7qRXukhynYjUukzhaBzSK
Owner
Author
|
/glimpse |
Owner
Author
|
/glimpse |
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.
Summary
This PR introduces a comprehensive trigger system that intelligently decides when to run the demo generation pipeline. It adds support for multiple trigger modes (auto, on-demand, smart), comment-based commands, file filtering with glob patterns, and change magnitude thresholds.
Key Changes
Trigger Modes
/glimpsecomment commandComment Command Support
/glimpsecommand parsing with support for flags:--force: Override all filters and thresholds--route /path: Specify a route to demo (parsed but not yet used)issue_commentevents in addition topull_requesteventsFile Filtering
filterUIFiles()function supports glob-based include/exclude patternsisUIFile()heuristic when no patterns are configuredChange Magnitude Calculation
computeChangeMagnitude()to sum additions and deletions across filesConfiguration
TriggerConfigschema with sensible defaultsgit-glimpse.config.tsor GitHub Actions inputtrigger-modeSkip Comments
postSkipComment()function posts/updates a comment when pipeline is skippedImplementation Details
evaluateTrigger()with clear precedence:pull_requestandissue_commentevents with proper PR resolution for commentshttps://claude.ai/code/session_01F7qRXukhynYjUukzhaBzSK