Skip to content

builds: backfill queue_time for builds triggered this year#13083

Draft
ericholscher wants to merge 1 commit into
claude/build-queued-duration-tracking-YbGsvfrom
claude/backfill-queue-time-this-year
Draft

builds: backfill queue_time for builds triggered this year#13083
ericholscher wants to merge 1 commit into
claude/build-queued-duration-tracking-YbGsvfrom
claude/backfill-queue-time-this-year

Conversation

@ericholscher
Copy link
Copy Markdown
Member

Stacked on top of #13080 (targets that branch, not main).

Why a separate PR

The backfill is a one-time data migration with different risk and review concerns than the schema/feature change in #13080, so it's split out to be reviewed and reverted independently.

Decisions

Bounded to this year. task_executed_at only exists from 2025-09-30 onward, so older builds can't be backfilled at all. We further limit the window to builds since 2026-01-01 to keep the at-deploy DML small rather than rewriting every eligible row.

Runs after deploy, in batches, idempotently. It only fills rows where the value is still null and never overwrites, so it's safe to re-run; batching avoids holding a long lock on a large table.

Computed in Python, not SQL. Extracting epoch seconds from a timestamp delta differs between PostgreSQL (production) and SQLite (tests); computing in Python keeps behavior identical across both.

Merge order

Merge after #13080, since it depends on the column that PR adds.


🤖 Generated by the Claude Code AI agent.


Generated by Claude Code

@ericholscher ericholscher force-pushed the claude/build-queued-duration-tracking-YbGsv branch from 7f97dab to 850ac09 Compare June 2, 2026 05:29
@ericholscher ericholscher force-pushed the claude/backfill-queue-time-this-year branch from 7a88279 to 4ecd1ae Compare June 2, 2026 05:29
@ericholscher ericholscher force-pushed the claude/build-queued-duration-tracking-YbGsv branch from 850ac09 to d1128c5 Compare June 4, 2026 20:08
Add a batched data migration that backfills `queue_time` from
`task_executed_at - date` for builds created since 2026-01-01. Older builds
predate `task_executed_at` and cannot be backfilled. Runs after deploy in
batches to avoid locking the table.
@ericholscher ericholscher force-pushed the claude/backfill-queue-time-this-year branch from 4ecd1ae to 8e28344 Compare June 4, 2026 20:10
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 dev | 🛠️ Build #32997427 | 📁 Comparing 8e28344 against latest (e41c7c3)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 docs | 🛠️ Build #32997428 | 📁 Comparing 8e28344 against latest (e08ef8f)

  🔍 Preview build  

54 files changed · + 1 added · ± 53 modified

+ Added

± Modified

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.

2 participants