rogeriospinaintelipost commented on issue #6264:
URL: 
https://github.com/apache/incubator-devlake/issues/6264#issuecomment-1768657899

   @Startrekzky 
   This is my project's sctructure and I dont have any problem with that, works 
great!
   ![Untitled - Frame 
1](https://github.com/apache/incubator-devlake/assets/108951098/84daaec7-2b79-48d6-a5bb-c39d0adae0d2)
   
   This is my structure for Teams, note that user B works in both teams. Their 
authored deployment commits counts for both teams. I did not find any link 
between project/scopes and teams/users. Ex: A deploy fired to Scope B repo, 
should belong to Project B, and it works, but how to link that with only one 
team if the author are linked in multiple teams?
   ![Untitled - Frame 
2](https://github.com/apache/incubator-devlake/assets/108951098/4979c930-0d47-4884-a001-ff8886264664)
   
   On Dashboard query I noticed that there is a join with project_mapping, but 
it is not enough to find the right team.
   ````
   SELECT
        cdc.cicd_deployment_id,
        max(cdc.finished_date) as deployment_finished_date
   FROM cicd_deployment_commits cdc
   JOIN commits c on cdc.commit_sha = c.sha
        join user_accounts ua on c.author_id = ua.account_id
        join users u on ua.user_id = u.id
        join team_users tu on u.id = tu.user_id
        join teams t on tu.team_id = t.id
   JOIN project_mapping pm on cdc.cicd_scope_id = pm.row_id and pm.`table` = 
'cicd_scopes'
   WHERE
        t.name in ($team)
        and cdc.result = 'SUCCESS'
        and cdc.environment = 'PRODUCTION'
   GROUP BY 1
   HAVING $__timeFilter(max(cdc.finished_date))
   ````
   


-- 
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