telemetry: structured git mirror checkout, hydration, and maintenance reports - #43
Merged
Merged
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
piob-io
marked this pull request as ready for review
August 24, 2026 21:40
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
August 24, 2026 21:46
72baab9 to
dd7a3dd
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
August 24, 2026 21:53
dd7a3dd to
16750a1
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
August 24, 2026 22:00
16750a1 to
b348b13
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
August 24, 2026 22:08
b348b13 to
e86d13b
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
August 24, 2026 22:20
e86d13b to
e836bd2
Compare
ajwerner
approved these changes
Aug 25, 2026
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
August 31, 2026 13:16
e836bd2 to
b67c523
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
August 31, 2026 13:23
b67c523 to
941615e
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
4 times, most recently
from
September 4, 2026 20:07
6dedeef to
75491d8
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
September 8, 2026 13:16
75491d8 to
0dbdb43
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
September 8, 2026 13:26
0dbdb43 to
58ce834
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
3 times, most recently
from
September 9, 2026 13:15
8e3e269 to
f6c5f4a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f6c5f4a. Configure here.
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
September 9, 2026 13:21
f6c5f4a to
edec05e
Compare
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
September 16, 2026 18:29
edec05e to
27e77c7
Compare
devin-ai-integration
Bot
changed the base branch from
main
to
devin/1789579599-bounded-mirror-maintenance
September 16, 2026 18:29
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
September 16, 2026 19:47
27e77c7 to
8143300
Compare
… reports Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
force-pushed
the
devin/1787595928-git-mirror-telemetry
branch
from
September 17, 2026 12:55
8143300 to
c5dcd97
Compare
devin-ai-integration
Bot
changed the base branch from
devin/1789579599-bounded-mirror-maintenance
to
main
September 17, 2026 12:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Upgrades the action's guest→vm-agent internal-metrics channel from counters to structured payloads, so the fa agent can build per-checkout / per-hydration / per-maintenance-run ClickHouse rows. Companion to FastActions/fa#5231 (agent-side ingest) and FastActions/fa#5450 (target-mirror stamping). Rebased onto main after #55 (bounded incremental mirror maintenance) merged; the single commit instruments
runMirrorMaintenanceandsyncMirrorFromRemote.src/mirror-telemetry.ts(new): dumb payload builders with closed enums —ServingMode(mirror/hydrating/fallback-contention/fallback-error/bypass),Outcome(success/failure/timeout) — pluspackSizeBytes/packNames(one readdir ofobjects/pack),dirSizeBytes(du -sb, runner-local workspace only),refCount(git show-ref | wc -l), andclassifyError. All reporting is fire-and-forget with every error swallowed; telemetry can never fail the job.src/internal-metrics.ts: addsreportStructuredMetric(metricType, payload)which rides the existing/internalenvelope in a newpayloadfield (same 5s timeout, errors swallowed); legacyreportInternalMetricunchanged.src/git-source-provider.ts:getSourceemits one checkout report from afinallyblock (so fallback and failure paths still report), with serving mode chosen where the mirror path is picked: 409/Code.Aborted→fallback-contention, other cache/mirror failures →fallback-error, initial mirror clone →hydrating(plus a hydration clone-detail report with duration/bytes/ref count), otherwisemirrororbypass. Phase durations: sticky-disk setup, clone-from-mirror, delta fetch (bytes + ms), full checkout, submodules, LFS; repo shape: mirror size, ref count, shallow/filter/submodules/LFS flags.Every report names its target mirror. Checkout, hydration, and maintenance payloads carry
sticky_disk_key = stickyDiskKeyFor(owner, repo)(<owner>-<repo>, the same keysetupCacherequests), set before cache setup sofallback-contention/fallback-error/bypassrows — where no disk is ever mounted — still say which mirror they were about. The agent uses it to stamp the row's mirror identity; it is never an OTel label.Mirror measurements never walk the sticky disk. Every mirror size (
mirror_size_bytes, hydrationclone_bytes, refresh/gcbytesdeltas) is the byte total of<mirror>/objects/pack— a flat handful of large files, so one readdir plus a few stats instead of aduover every loose object and ref, each of which is a cold random read on a freshly mounted block device. Because Post step: bounded incremental mirror maintenance; maintenance failure no longer vetoes the commit #55's mirror sync runs withfetch.unpackLimit=1, every fetch lands as a pack, so refreshbytesis exactly the fetched bytes; gcbytesis the pack-consolidation saving only (kept packs are never rewritten, so it is the delta of the rolled-up small packs). Only the workspacedelta_fetch_bytesstill usesdu -sb, on the runner-local.git/objectsthat holds just the delta.State is persisted before any measurement.
setBlacksmithCachePerformedHydration/setBlacksmithCacheMirrorChanged(true)run as soon asensureMirrorreturns, andsyncMirrorFromRemotetakes anonMirrorChangedcallback fired the moment the mirror has changed (post-fetch, or purge-only), before its own size read — so a cancel during telemetry can never leave the post step treating a changed mirror as unchanged.src/blacksmith-cache.ts+src/main.ts:syncMirrorFromRemoterecords duration and pack-size delta (durationMs,bytes= fetched,mirrorSizeBytes; only a delta where both reads succeeded is reported), and a structuredrefreshmaintenance row is emitted wherever the sync runs — the main step for full checkouts, the post step for the deferred shallow-checkout sync. The post-steprunMirrorMaintenance(Post step: bounded incremental mirror maintenance; maintenance failure no longer vetoes the commit #55's.keepmarking + geometric repack +pack-refs) measures duration and reclaimed pack bytes and emits a maintenance row under the existinggcoperation — the agent's operation enum is closed (refresh|gc|fsck) andgcis the pack-consolidation slot, whichever git verb performs it, so no fa/ClickHouse/dashboard change is needed.No-op maintenance emits no row.
OperationResult.skippedmeans the operation did no work; skipped syncs and skipped maintenance are not reported.cleanup()starts frommaintenanceResult = {success: true, timedOut: false, skipped: true}, so a mirror that is not maintained (no mirror, sync failed, or not committing) never yields a row; when maintenance does run, the sorted.packnames are snapshotted before and after (pack names are content hashes, so any roll-up rewrites the set) and a run that changed nothing is markedskipped, so thegccounter and rows reflect real repack work rather than one row per commit path:Maintenance failure/timeout keeps Post step: bounded incremental mirror maintenance; maintenance failure no longer vetoes the commit #55's semantics (logged,
git_mirror_gc_failuremetric, commit still lands) and additionally produces agcrow withoutcome=failure|timeout.__test__/mirror-gc-git.test.tsexercises the telemetry against real git (single-pack mirror → geometric repack rolls nothing →skipped; two similarly sized packs → rolled to one → real run withdurationMs/mirrorSizeBytes;shouldCommit=false→skipped), plus the pack measurement helpers (loose objects excluded; missing pack dir measures 0, not unmeasurable). Post step: bounded incremental mirror maintenance; maintenance failure no longer vetoes the commit #55'smirror-maintenance-git.test.ts/mirror-cleanup.test.tsassert the sameskipped/measurement fields on their fixtures.Existing failure counters unchanged — fleet alerting surface preserved. No fsck run exists in the action today, so no fsck row is emitted (the enum supports it for when one is added). Final hydration persistence truth is stamped agent-side at teardown; the guest reports contribute clone-phase detail only.
dist/index.jsrebuilt (tsc && ncc build).Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled. (Staging)Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Link to Devin session: https://app.devin.ai/sessions/53ae2d32138144f4832eae008103aa71
Open in Devin Desktop: https://app.devin.ai/desktop/session/53ae2d32138144f4832eae008103aa71?variant=devin
Requested by: @piob-io