fs24-chrter opened a new issue, #9385:
URL: https://github.com/apache/devlake/issues/9385

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   Copilot review activity is classified as human activity despite GitHub 
identifying the review author as a bot:
   ```
   {
     "id": 175728472,
     "login": "copilot-pull-request-reviewer[bot]",
     "type": "Bot"
   }
   ```
   
   The corresponding DevLake account has the correct numeric identity but 
incorrect classification:
   ```
   id:        github:GithubAccount:1:175728472
   user_name: copilot-pull-request-reviewer
   is_bot:    0
   ```
   
   Full recollection did not correct this.
   
   We identified two failure paths:
   
   GraphQL: the GraphQL decoder populates overlapping ID/login fields in both 
the User and Bot fragments. GraphqlInlineActorQuery.Account() checks the user 
fragment first and returns it, bypassing the bot login normalization. We 
reproduced this locally using the pinned implementation and its exact decoder 
dependency.
   
   REST comments: raw review-comment records contain login = Copilot and type = 
Bot. The shared account pre-extractor copies the login and ID but discards the 
type. Without a populated profile type or [bot] suffix, subsequent conversion 
produces is_bot = 0.
   
   ### What do you expect to happen
   
   Accounts identified by GitHub as bots should consistently produce 
accounts.is_bot = 1, regardless of the collection endpoint or repository 
processed.
   
   
   
   ### How to reproduce
   
   1. Run DevLake v1.0.3-beta18.
   2. Configure GitHub collection using GraphQL for a repository containing a 
Copilot-reviewed PR.
   3. Verify the actual review author through GitHub’s REST API, replacing 
OWNER/REPO and PR_NUMBER:
   
   gh api --paginate 'repos/OWNER/REPO/pulls/PR_NUMBER/reviews' \
     --jq '.[] | .user | {id,login,type}'
   
   Copilot’s reviewer should have type Bot.
   
   4. Collect the repository data, including PRs, reviews, and comments.
   5. Observe an unsuffixed login and is_bot = 0 for the bot reviewer account.
   
    Collect Data in Full Refresh Mode did not solve the issue.
   
   ### Anything else
   
   Changing the entries in account table to bot does not help because accounts 
will be overwritten on every sync.
   
   ### Version
   
   v1.0.3-beta18@6502e54
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to