fix(orch): denormalize upload metric file type#2865
Conversation
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 0d0b76b. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Code Review
This pull request refactors sandbox upload metrics by replacing generic artifact and header identifiers with specific file type constants and introducing the uploadBlobWithMetrics helper to track snapshot and metadata uploads. There are no review comments, and I have no feedback to provide.
❌ 1 Tests Failed:
View the full list of 3 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: V4 rootfs metric emits "rootfs.ext4" instead of "rootfs"
- Added mapping logic to convert fileType to the correct metric constant (uploadFileRootfs) before calling recordUploadCompression, ensuring V4 metrics emit 'rootfs' like V3.
Or push these changes by commenting:
@cursor push 0203492d5b
Preview (0203492d5b)
diff --git a/packages/orchestrator/pkg/sandbox/build_upload_v4.go b/packages/orchestrator/pkg/sandbox/build_upload_v4.go
--- a/packages/orchestrator/pkg/sandbox/build_upload_v4.go
+++ b/packages/orchestrator/pkg/sandbox/build_upload_v4.go
@@ -93,7 +93,11 @@
compressedSize = size
}
- recordUploadCompression(ctx, string(fileType), cfg, size, compressedSize)
+ metricFileType := uploadFileMemfile
+ if fileType == build.Rootfs {
+ metricFileType = uploadFileRootfs
+ }
+ recordUploadCompression(ctx, metricFileType, cfg, size, compressedSize)
selfBuild = headers.BuildData{Size: size, Checksum: checksum, FrameData: ft}
}You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit 1350fd8. Configure here.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1350fd8b17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


Summary
Use one denormalized
file_typemetric attribute for upload compression metrics (memfile,memfile-header,rootfs,rootfs-header,snap,meta) instead of splittingartifactandfile_type.Test plan
cd packages/orchestrator && go test ./pkg/sandbox -run TestNonexistentcd packages/orchestrator && golangci-lint run ./pkg/sandbox/...