incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Bug][GitHub][DORA] Case-sensitive environment filtering breaks DORA metrics for lowercase deployment sources

Open dmora opened this issue 1 month ago • 1 comments

Search before asking

  • [x] I searched in the issues and found no similar issues.

What happened

DORA dashboard queries use case-sensitive environment = 'PRODUCTION' filters, which fail to match deployments created with lowercase "production" values, resulting in 100% data loss for DORA metrics.

Testing with 249 repositories and 409 production deployments confirmed:

  • Data collected: SELECT COUNT(*) FROM cicd_deployments WHERE environment = 'production' → 409
  • Dashboard query: SELECT COUNT(*) FROM cicd_deployments WHERE environment = 'PRODUCTION' → 0

What do you expect to happen

DORA dashboards should display metrics for all production deployments regardless of environment field case. The filtering should be case-insensitive or normalize values during ingestion.

How to reproduce

  1. Configure GitHub connection with deployments collection enabled (v0.20+ default)
  2. Create deployments with lowercase environment via GitHub API or deployment tools
  3. Sync data to DevLake - verify: SELECT environment FROM cicd_deployments LIMIT 5
  4. Open DORA dashboard (UID: qNo8_0M4z)
  5. Observe: Deployment Frequency = 0, Lead Time = 0

Anything else

Root Cause: GitHub Deployments API accepts environment as free-text field with no case normalization. Dashboard queries in DORA.json assume uppercase, but GitHub's documentation and many deployment tools use lowercase.

Affected Dashboards (11 total):

  • DORA (qNo8_0M4z)
  • DORA (by Team) (66YkL8y4z)
  • DORA Details - Deployment Frequency, Lead Time, CFR, MTTR
  • All _nobots variants

Workaround: Update dashboard queries to use case-insensitive matching:

-- Before (broken)
WHERE cdc.environment = 'PRODUCTION'

-- After (works)
WHERE UPPER(cdc.environment) = 'PRODUCTION'

Or create normalized view:

CREATE VIEW v_cicd_deployments_normalized AS
SELECT *, UPPER(environment) as environment FROM cicd_deployments;

Impact:

  • Severity: High (P1) - DORA metrics completely non-functional (show 0)
  • Scope: All users with lowercase deployment sources
  • Metrics affected: Deployment Frequency, Lead Time for Changes

Additional Context:

  • GitHub API docs use lowercase: https://docs.github.com/en/rest/deployments/deployments
  • Webhook examples use uppercase (ArgoCD discussion #6162)
  • No existing issues found about this mismatch

Version

v1.0.3-beta8@cfe519c

Are you willing to submit PR?

  • [x] I'm willing to submit a PR (dashboard query updates)

Code of Conduct

dmora avatar Nov 24 '25 22:11 dmora

Hi @dmora! I'm Dosu and I’m helping the incubator-devlake team.

This is a confirmed bug: DORA dashboard queries filter for environment = 'PRODUCTION' in a case-sensitive way, but GitHub deployments often use lowercase (e.g., production). The ingestion pipeline stores environment names as-is, so deployments with lowercase environments are missed by the dashboards, causing metrics like Deployment Frequency and Lead Time to show zero for affected users. There is no case normalization during ingestion or in the dashboard queries source, source.

To fix or work around this, update all relevant dashboard queries to use case-insensitive matching, for example:

WHERE UPPER(cdc.environment) = 'PRODUCTION'

Alternatively, create a normalized view:

CREATE VIEW v_cicd_deployments_normalized AS
SELECT *, UPPER(environment) as environment FROM cicd_deployments;

and update the dashboards to use this view.

No existing issues or PRs address this yet. Until an official fix is released, updating your dashboard queries as above will restore correct DORA metrics for all environment name cases.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

dosubot[bot] avatar Nov 24 '25 22:11 dosubot[bot]