bramhanandlingala opened a new pull request, #9049:
URL: https://github.com/apache/devlake/pull/9049

   ## Summary
   Fixes #9041. Copilot seats from GitHub's enterprise API were being
   tagged with the connection's "shell" org instead of the org that
   actually granted the seat, which made the DORA dashboard's adoption
   percentage wrong (often zero) for any org besides the shell org. Two
   dashboard queries also mislabeled NULL adoption as the highest tier
   instead of excluding it.
   
   ## Root cause
   - `seat_extractor.go` hardcoded every seat's organization to
     `connection.Organization`, ignoring the per-seat `organization`
     field the enterprise seats endpoint actually returns.
   - Both DORA dashboards' adoption-tier `CASE` statements used `ELSE` as
     a catch-all, so NULL adoption silently got labeled `>75%` / `high`
     instead of being excluded.
   
   ## Fix
   - Parse the API's per-seat `organization` field
     (`metrics_extractor.go`) and prefer it over the connection's
     configured org, falling back only when the API doesn't supply one
     (`seat_extractor.go`).
   - Replace `ELSE` with explicit `WHEN` + `WHERE ... IS NOT NULL` in
     both dashboards' tier queries (MySQL and PostgreSQL).
   - Refactored seat parsing into a standalone function and added unit
     tests covering org-scoped, enterprise-with-org, and
     enterprise-with-empty-org cases.
   
   Closes #9041


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