Skip to content

Omit definitions from returned references - #7296

Merged
crazy-max merged 1 commit into
moby:masterfrom
tamird:gateway-return-reference-ids
Oct 20, 2026
Merged

crazy-max merged 1 commit into
moby:masterfrom
tamird:gateway-return-reference-ids

Conversation

@tamird

@tamird tamird commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Returning a gateway frontend result serialized the solved references' LLB definitions again. The Return handler already resolves those references by ID 1, so a large definition plus result metadata could exceed the gRPC message limit after Solve succeeded.

Omit definitions from references serialized in Return. Keep them in Solve responses and client references so Reference.ToState can still reconstruct their LLB state.

Prepared by Codex on Tamir's behalf.

@tonistiigi tonistiigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this new test adds much and you can skip it. We should already have coverage that the definition still gets returned to client/frontend in integration tests.

Returning a gateway frontend result serialized the solved references'
LLB definitions again. The Return handler already resolves those
references by ID [1], so a large definition plus result metadata could
exceed the gRPC message limit after Solve succeeded.

Omit definitions from references serialized in Return. Keep them in
Solve responses and client references so Reference.ToState can still
reconstruct their LLB state.

Prepared by Codex on Tamir's behalf.

[1]: https://github.com/moby/buildkit/blob/64aefaef4d7dbb993156a0839958e4342aeb4c51/frontend/gateway/gateway.go#L1102-L1168

Signed-off-by: Tamir Duberstein <tamird@gmail.com>
@tamird
tamird force-pushed the gateway-return-reference-ids branch from 09340e7 to c3fdbd4 Compare October 19, 2026 22:05
@tamird

tamird commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

I don't think this new test adds much and you can skip it.

Removed the mock client and test in c3fdbd4. The existing testFrontendUseSolveResults integration test covers the Solve/ToState path and exported result. go test ./frontend/gateway/grpcclient passes.

Prepared by Codex on Tamir's behalf.

@crazy-max crazy-max added this to the v0.35.0 milestone Oct 20, 2026
@crazy-max
crazy-max merged commit 51af51f into moby:master Oct 20, 2026
212 checks passed
@tamird
tamird deleted the gateway-return-reference-ids branch October 20, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants