Skip to content

fix(azuredevops): run convertApiTimelineRecords when CICD is selected - #9317

Merged
klesh merged 1 commit into
apache:mainfrom
PDGGK:fix-azuredevops-timeline-records-domain-type
Nov 6, 2026
Merged

klesh merged 1 commit into
apache:mainfrom
PDGGK:fix-azuredevops-timeline-records-domain-type

Conversation

@PDGGK

@PDGGK PDGGK commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

convertApiTimelineRecords is the azuredevops_go subtask that turns Azure Pipelines timeline records (stages and jobs) into cicd_tasks. Its DomainTypes was CODEREVIEW, while the two subtasks it depends on, collectApiTimelineRecords and extractApiTimelineRecords, are CICD. makePipelinePlanV200 selects subtasks by domain type, so whenever a scope's entities do not include CODEREVIEW, the timeline records are collected and extracted but never converted:

  • Repositories hosted outside Azure Repos (GitHub, Bitbucket) and built with Azure Pipelines. The plan keeps only CICD (plus CODE for public repositories) for these, so this happens on every run.
  • Azure Repos scopes whose scope config selects CI/CD without Code Review.

For those scopes cicd_tasks stays empty. The deploymentPattern / productionPattern matches on stage and job names are lost, and the dora plugin, which also detects deployments through cicd_tasks, misses every deployment that can only be recognized at the stage or job level.

This PR registers the converter under CICD, the same domain type as the collector and extractor it depends on. Azure Repos scopes that include both Code Review and CI/CD (the default) plan the converter exactly as before.

Before, the subtasks planned for a private GitHub repository with all entities selected (the CI/CD part of the plan):

collectApiBuilds convertApiBuilds extractApiBuilds collectApiTimelineRecords extractApiTimelineRecords

After:

collectApiBuilds convertApiBuilds extractApiBuilds collectApiTimelineRecords convertApiTimelineRecords extractApiTimelineRecords

The result is the same for a public GitHub repository and for an Azure Repos scope with only CI/CD selected.

To check the effect on the domain layer, I ran the plugin's e2e fixtures (raw_tables/_raw_azuredevops_go_api_builds.csv and _raw_azuredevops_go_api_timeline_records.csv) against MySQL 8.4, running only the build and timeline subtasks that the plan selects for a CICD-only scope:

before: ran=[extractApiBuilds extractApiTimelineRecords]
        _tool_azuredevops_go_timeline_records=5 cicd_tasks(azuredevops_go)=0 production deployment tasks=0
after:  ran=[extractApiBuilds extractApiTimelineRecords convertApiTimelineRecords]
        _tool_azuredevops_go_timeline_records=5 cicd_tasks(azuredevops_go)=5 production deployment tasks=1

Does this close any open issues?

Closes #8943

Screenshots

Not applicable (backend only). The before/after output is above.

Other Information

Testing:

  • New test TestMakeDataSourcePipelinePlanV200ConvertsTimelineRecordsWithCicd in api/blueprint_v200_test.go checks the planned subtasks for a private GitHub repository and for an Azure Repos scope with CICD only. When I reverted only the DomainTypes change, both cases failed, and the diff shows convertApiTimelineRecords missing after extractApiTimelineRecords.
  • go test for plugins/azuredevops_go/api and plugins/azuredevops_go/tasks passes.
  • plugins/azuredevops_go/e2e passes against MySQL 8.4 (all 5 data-flow tests, including TestAzuredevopsTimelineDataFlow).
  • gofmt, go vet, and golangci-lint v2.15.0 on the two touched packages are clean.
  • PostgreSQL e2e and the rest of the suite are left to CI.

The subtask that converts Azure Pipelines timeline records into
cicd_tasks was registered under the CODEREVIEW domain type, while the
subtasks that collect and extract those records are registered under
CICD. The blueprint picks subtasks by domain type, so the converter was
left out of the plan whenever CODEREVIEW was not selected. That is
always the case for repositories hosted outside Azure Repos (GitHub,
Bitbucket), which only get CICD (plus CODE for public repositories), and
also for Azure Repos scopes configured with CICD only.

In those cases timeline records were collected and extracted, but no
cicd_tasks were written, so deployments recognized by stage or job
names never reached the DORA metrics.

Register the converter under CICD like the other timeline subtasks.

Closes apache#8943

Signed-off-by: Zihan Dai <dzh1436286758@gmail.com>

@klesh klesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.
Thanks for your contribution.

@klesh
klesh merged commit d20bf28 into apache:main Nov 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][AzureDevOps_GO plugin] convertApiTimelineRecords subtask never runs for external repos due to wrong DomainTypes

2 participants