Skip to content

Conversation

@breardon2011
Copy link
Contributor

Description

Fixes #2552 by moving the comment reaction (👀) earlier in the event processing flow to provide immediate user feedback.

Problem

Previously, Digger only added a reaction to comments AFTER:

  • Loading the digger config
  • Checking if comment was from a bot
  • Validating various configuration options

This meant that if a comment was from an untrusted bot, or if config loading failed, or if other early validation checks failed, no reaction was added. Users wouldn't get any feedback that Digger had seen their command.

Solution

Move the call to happen immediately after:

  1. Verifying the comment is on a pull request
  2. Verifying the comment action is created
  3. Verifying the comment starts with digger
  4. Getting the GitHub service

Benefits

  • Immediate feedback: Users see the 👀 reaction within seconds of posting
  • Better UX: Even ignored commands are acknowledged, reducing confusion
  • Debugging: Makes it clear that Digger is running and processing comments
  • Transparency: Shows the comment was received, even if not acted upon
  • Complements PR Allow trusted bot comments via trusted_appIDs #2554: Works well with the trusted bot handling

Changes

Files Modified

    • Moved reaction code from line 224 to line 138
  • Added documentation in

Code Flow Before

Code Flow After

Testing

Users can now verify that:

  1. Untrusted bot comments get reactions (but are still ignored per security policy)
  2. Comments on draft PRs get reactions (but are skipped per config)
  3. Comments when config is invalid get reactions (with error message)
  4. All valid comments continue to work as before

See for detailed test scenarios.

Related

Notes

  • This change has minimal performance impact (same API call, just earlier timing)
  • The EE controllers (Bitbucket, GitLab) could benefit from the same pattern but are not included in this PR
  • Easy to revert if needed by moving the code block back

Code Agent added 6 commits January 30, 2026 01:13
Move CreateCommentReaction call earlier in the flow to provide immediate
user feedback. Previously, the reaction was added after config loading
and bot checks, meaning untrusted bots or early validation failures
would never get a reaction.

Now the reaction is added right after:
- Verifying it's a digger command
- Getting the GitHub service
- Before any config loading or validation

This ensures users always see acknowledgment (👀) that Digger received
their command, even if it's later ignored due to:
- Untrusted bot account
- Draft PR restrictions
- Config errors
- Other validation failures

Benefits:
- Immediate visual feedback to users
- Better UX for debugging
- Transparent acknowledgment of all commands
- Complements PR #2554's trusted bot handling

Related: #2553
- TESTING_SUMMARY.md: Quick start guide and deployment checklist
- sandbox_test_issue_2552.md: Detailed test scenarios and verification steps
- test_reaction_timing.sh: Automated script to verify reaction timing in logs
- ISSUE_2552_FIX.md: Complete documentation of the problem and solution

These files provide everything needed to test and verify the fix works
correctly in sandbox before production deployment.
Show before/after behavior with clear examples and timelines to help
reviewers understand the user experience improvement.
Final summary documenting all work completed, testing status,
and next steps for review and deployment.
Provides easy navigation to all documentation files with quick
start guides for different audiences (reviewers, testers, developers).
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.

Support terragrunt run --all

2 participants