fix: recover ACR log streams after replacement - #9957
Open
Jon Gallant (jongio) wants to merge 1 commit into
Open
fix: recover ACR log streams after replacement#9957Jon Gallant (jongio) wants to merge 1 commit into
Jon Gallant (jongio) wants to merge 1 commit into
Conversation
Fixes Azure#9956 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The 412 recovery path can retain a stale cursor and omit the beginning of a replacement log.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
cli/azd/pkg/containerregistry/remote_build.go — Reset or validate the cursor after a 412 replacement race |
What changed in this PR
Improves ACR remote-build log streaming when log blobs are replaced or truncated.
Changes:
- Resets stale read cursors and retries range conflicts.
- Adds ETag-bound downloads and regression tests.
| File | Description |
|---|---|
remote_build.go |
Adds cursor recovery and conditional range downloads. |
remote_build_logs_test.go |
Tests replacement, cancellation, and failure paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+322
to
+324
| if responseErr.StatusCode == http.StatusRequestedRangeNotSatisfiable { | ||
| written = 0 | ||
| } |
Victor Vazquez (vhvb1989)
approved these changes
Sep 10, 2026
JeffreyCA
approved these changes
Sep 10, 2026
JeffreyCA
left a comment
Contributor
There was a problem hiding this comment.
Looks good, the Copilot comment seems worth addressing
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.

Fixes #9956
Summary
Recover ACR log streaming when a build replaces or truncates its log blob, instead of aborting publishing with HTTP 416 while the remote build continues.
Changes
Validation
go test -race ./pkg/containerregistry -count=1,golangci-lint run ./pkg/containerregistry/..., repeated stream tests, Go modernization checks, and CLI build passed. A private patched CLI completed remote image publishing in a development rollout.#9939 handles the related fallback policy separately. This PR does not change fallback behavior.