Repository navigation
Closed
Labels
Description
General Goal
This is the first stage of implementing a new feature that allows GitFix to handle follow-up changes requested in the comments of open Pull Requests. This issue focuses on updating the daemon to watch for these comments and enqueue new jobs for the worker.
Task Description
The daemon.js script needs to be updated to poll for comments on open PRs in the monitored repositories. When a comment matches specific criteria, a new task should be added to the queue for a worker to process.
Implementation Steps
-
Update
src/daemon.js:- Create a new function,
pollForPullRequestComments, that will be called within the main polling loop. - This function should:
- Fetch all open pull requests for the monitored repositories.
- For each pull request, fetch its comments.
- Filter the comments based on the following criteria:
- The comment body must include the string
!gitfix. - The author of the comment should not be the bot itself.
- The author should be checked against a whitelist and not be on a blacklist.
- The comment body must include the string
- Create a new function,
-
Add New Environment Variables:
- Introduce the following new variables in the
.env.exampleandREADME.mdfiles:GITHUB_BOT_USERNAME: The GitHub username of the bot, to ignore its own comments.GITHUB_USER_WHITELIST: A comma-separated list of GitHub usernames that are allowed to trigger follow-up tasks. If empty, all users are allowed.GITHUB_USER_BLACKLIST: A comma-separated list of GitHub usernames that are not allowed to trigger follow-up tasks.
- Introduce the following new variables in the
-
Enqueue New Job Type:
- When a valid comment is detected, a new job of type
processPullRequestCommentshould be added to the BullMQ. - The job data should contain all the necessary information for the worker, including:
pullRequestNumbercommentBodycommentAuthorrepoOwnerrepoNamebranchName(from the PR's head ref)- The target LLM (e.g., 'opus', 'sonnet', parsed from
!gitfix:opus).
- When a valid comment is detected, a new job of type
Acceptance Criteria
- The daemon successfully identifies comments with
!gitfix. - The daemon correctly filters comments based on the author, whitelist, and blacklist.
- A new
processPullRequestCommentjob is created in the queue with the correct data for each valid comment. - The system remains stable and continues to process new issues as before.
Next Steps
The next issue will cover the implementation of the worker to process these new processPullRequestComment jobs.
Activity
integry commentedon Jul 21, 2025
Suggested Implementation for `src/daemon.js`
Here is a suggested implementation for the changes in `src/daemon.js`. This code introduces a new function to poll for PR comments and adds it to the main loop.
propr-dev commentedon Jul 21, 2025
🤖 AI processing has started for this issue using opus model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
opusai-fix/40-feat-monitor-pr-comments--20250722-0134-opus-vjbmainissue-40-20250722-0134-opus-vjbfix(ai): Resolve issue #40 - Feat: Monitor PR comments for follow-up …
Merge pull request #42 from integry/ai-fix/40-feat-monitor-pr-comment…
feat(ai): All checks pass. Here's what changed: