michelengelen opened a new issue, #7510:
URL: https://github.com/apache/incubator-devlake/issues/7510

   ### 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
   
   Issues that receive a label will not be updated when the label gets removed.
   
   Example: We do track user interaction with labels on issues in github. When 
a user opens a new issue it gets automatically labeled as "waiting for 
maintainer". This is to indicate to us that this needs attention.
   Now when we ...
   - need some more information from the user
   - add the issue to our board
   - or close the issue
   ... we remove that label ("waiting for maintainer")
   
   The problem we face is that the issue will still be associated to that label 
even if it got removed from the issue. This is messing with our metrics atm.
   
   This is one of the queries we use to collect data regarding labels:
   ```sql
   with issue_list as(
     select
       i.id as issue_id,
       i.url,
       i.issue_key,
       i.title,
       i.creator_name,
       i.created_date as issue_created_date,
       i.status
     from
       issues i
       join board_issues bi on i.id = bi.issue_id
       join boards b on bi.board_id = b.id
       join issue_labels il on il.issue_id = i.id
     where
       $__timeFilter(i.created_date)
       and il.label_name = 'status: waiting for maintainer'
       and i.status != 'DONE'
       and b.id in ('github:GithubRepo:1:260240241')
   )
   
   select 
     issue_key,
     title,
     creator_name,
     issue_created_date,
     status,
     (TIMESTAMPDIFF(MINUTE,issue_created_date,NOW()))/1440 as 
'queue_time_in_days',
     url
   from issue_list
   ORDER BY queue_time_in_days ASC 
   ```
   
   You can check this by looking at the result with id 
[13171](https://github.com/mui/mui-x/issues/13171). In the screenshot below 
this is incorrectly fetched.
   
   <img width="2579" alt="Screenshot 2024-05-24 at 11 08 43" 
src="https://github.com/apache/incubator-devlake/assets/32863416/622e4328-0a28-493d-82a0-74a9fb0a224e";>
   
   
   ### What do you expect to happen
   
   Issues that had the label removed should not be in the results when querying 
for issues by label.
   
   ### How to reproduce
   
   just query an issue (or a list of issues) with a query similar to the above.
   
   ### Anything else
   
   we just recently noticed, but this is a constant problem
   
   ### Version
   
   v1.0.0-beta7
   
   ### 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