[Bug][CircleCI] collectJobs and collectWorkflows collect on_hold workflows again on every run, so the raw tables grow without a limit
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Search before asking
- I had searched in the issues and found no similar issues.
What happened
The CircleCI plugin collects the same jobs and workflows again on every incremental run, without a limit. The raw tables _raw_circleci_api_jobs and _raw_circleci_api_workflows grow every day, and the circleci task gets slower every day.
Both collectors have a "collect unfinished details" step:
| Subtask | Input query | Statuses |
|---|---|---|
collectJobs |
UnfinishedJobsInputClauses (backend/plugins/circleci/tasks/job_collector.go) |
running, not_running, queued, on_hold |
collectWorkflows |
CollectUnfinishedDetails.BuildInputIterator (backend/plugins/circleci/tasks/workflow_collector.go) |
running, on_hold, failing |
These queries have no age limit. A CircleCI approval job (type: approval) that nobody approves stays on_hold for ever, and its workflow stays on_hold too. So DevLake collects all jobs of such a workflow again on every run, for ever. The set of these workflows only grows.
The step runs with Incremental: true (helpers/pluginhelper/api/api_collector_stateful.go), so the collector only adds rows to the raw table. The old rows for the same jobs stay.
Environment
| DevLake version | v1.0.3-beta14 (the code is the same on main at 351d86738) |
| Plugin | circleci |
| Database | MySQL 8.4 |
| CircleCI | CircleCI Cloud (circleci.com API v2) |
| Trigger | Nightly blueprint (incremental, skipCollectors=false), 2 CircleCI projects |
Data from our instance
- 14,356 workflows are
on_holdand 810 arefailing. They were created from February to November 2026. The jobs that stayon_holdare approval jobs that nobody approved (for examplehold-deploy,hold-tests,start-development). - One nightly run added 166,536 rows to
_raw_circleci_api_jobs:
| Source of the raw rows | Rows | Workflows |
|---|---|---|
| "unfinished details" step | 166,508 | 14,866 |
| new workflows | 28 | 4 |
_raw_circleci_api_jobshas about 9.3M rows (10.3 GB) for about 248k jobs. It grows by about 160k rows per day, also on weekends.extractJobsreads the full raw table on every run (see #9305), so thecirclecitask takes 3–8 hours per run.
What do you expect to happen
DevLake should collect an unfinished workflow again only for a limited time after it was created. The raw tables should grow only with new CI activity.
How to reproduce
- Use a CircleCI project with a workflow that has an approval job (
type: approval). - Trigger the workflow and do not approve the job.
- Add the project to a blueprint and run the blueprint (incremental) several times.
- Each run adds all jobs of that workflow to the raw table again:
SELECT url, COUNT(*) FROM _raw_circleci_api_jobs GROUP BY url ORDER BY 2 DESC LIMIT 10;
-- the same /v2/workflow/<id>/job URL appears once per run
Anything else
Proposed fix (plan of attack)
In UnfinishedJobsInputClauses and in the workflow collector's unfinished-details iterator, select only workflows created in a lookback window:
dal.Where("... AND created_date >= ?", time.Now().AddDate(0, 0, -lookbackDays))
- Compute the date in Go, so the query works on MySQL and PostgreSQL.
- Use a default of 30 days. It can be an option if maintainers prefer.
- For the job query, join the workflow table (or use the job's workflow
created_date) to apply the window.
Data that supports a 30-day window: in our instance, 99.6% of approved workflows got their approval within 14 days. All approvals except 1 of about 1,860 came within 30 days.
Rejected alternatives
- Do not treat
on_holdas a final status. A workflow that gets its approval later would then never be collected again, so its deploy jobs after the approval would be missing from DORA deployments. - Delete the previous raw rows of the same input before collecting it again. This needs a change in the framework collector and is more complex.
I can start work on a PR for this if the DevLake maintainers approve this approach.
Version
v1.0.3-beta14
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Go
- Star
- 3.2k
- Fork
- 832
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 75
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/devlake
-
[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)Có thể đã có người làm @VictorColomb đã nhận 2 ngày trước. Đang mởtype/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/devlake#9283 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug][Tempo] Team pagination relies on metadata.total, which Tempo v4 doesn't return: only the first 50 teams are listed/collectedCó thể đã có người làm @ShivamSharma43 đã nhận hôm nay. Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Refactor][CircleCI] Make extractJobs and extractWorkflows incremental with NewStatefulApiExtractorCó thể đã có người làm @zahorniak đã nhận hôm nay. Đang mở
apache/devlake#9305 · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug][Tempo] Ingestion issue on teamsCó thể đã có người làm @Goldloli đã nhận hôm nay. Đang mởtype/bug
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/devlake
Issue tương tự
-
Fix mode unpins a reusable workflow call when the same repository is also used as a step actionĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
github/gh-actions-lock#261 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
labmonkeys-space/nl6#974 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
model:sonnet phase-2-optimize runtime:claude security size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
FootprintAI/Containarium#3471 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] serviceenvupdater filter does not update KUBERNETES_SERVICE_HOST/PORT in init containersCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openyurtio/openyurt#2845 ·
Maintainer thường phản hồi trong vòng 7 ngày
-
fuzz.yml skips three fuzz targets, and the Action's user input describes only ~/.claudeCó thể đã có người làm @predictor2718 đã nhận hôm nay. Đang mởgithub_actions P3 tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày