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

[Bug][GitLab CICD Transformations] - Scope Config of a project configuration

Open JDanP opened this issue 4 months ago • 2 comments

Search before asking

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

What happened

Hi! I have a repository in GitLab which my team use with 2 git branches at least. They merge on branch "develop" from feature branches with a merge request. Then they always create another merge request to merge changes from branch "develop" into "main". Every time they merge into "main" it is deployed a new npm version of repository as a library with a job, and then with another automatic job it is bumped up the number of the version in the "package.json" file on branch "develop" so next time "develop" it is merged in "main", "main" can use this new version to publish itself in npm. And it goes like that. Now, the problem I can not understand in DORA metrics is that when I see the "Lead time for changes metrics" I see MRs merged in "develop".

Image

What do you expect to happen

It is supossed that the metrics shows only MRs set up in the rule of the Scope config. In that Scope config I set the name of the job that runs only in "main". It is called: "Publish NodeJs". But it does not respect the config

How to reproduce

I don´t know

Anything else

No response

Version

v1.0.2@41c047d

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

JDanP avatar Oct 21 '25 23:10 JDanP

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

Your scope config for GitLab CI/CD in DevLake v1.0.2 is designed to filter deployments by job name or branch using regex patterns, but the backend logic actually marks deployments as "production" mainly by matching the environment name against the EnvNamePattern regex in the scope config. If your production deployments are identified only by job or branch name (like "Publish NodeJs" on "main"), but the environment name doesn't match your EnvNamePattern, DevLake may incorrectly include deployments from other branches (like "develop") in DORA metrics such as Lead Time for Changes. This is a known limitation in v1.0.2—your configuration needs to ensure that the environment name for production deployments matches the pattern you set, or unwanted deployments may be counted. For more details, see the relevant code logic and documentation.

If you want to filter strictly by job name and branch, double-check that your environment naming in GitLab matches your scope config's production pattern. Otherwise, DevLake may not respect your intended filtering.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Oct 21 '25 23:10 dosubot[bot]

What are the merge options for all merge operations? merge, rebase, or squash?

klesh avatar Oct 24 '25 06:10 klesh