fix(build): Validate platform is arm64 or x86_64#535
Merged
Conversation
|
| Filename | Overview |
|---|---|
| agent/builder.py | Adds a runtime guard in ImageBuilder.__init__ that raises ValueError when platform is not "arm64" or "x86_64", correctly placed before self.platform is assigned. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ImageBuilder.__init__ called] --> B{platform in 'arm64', 'x86_64'?}
B -- No --> C[raise ValueError]
B -- Yes --> D[self.platform = platform]
D --> E[ContextManager created with platform]
E --> F[docker buildx build --platform platform]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
agent/builder.py:523
The `platform` parameter is typed as `str`, but the guard restricts it to the same two values already expressed as `Literal["arm64", "x86_64"]` in `ContextManager` (line 117). Using the `Literal` type here lets the type checker catch bad call sites statically instead of only at runtime.
```suggestion
platform: Literal["arm64", "x86_64"],
```
Reviews (2): Last reviewed commit: "fix(build): Validate platform is arm64 o..." | Re-trigger Greptile
5413e55 to
904124b
Compare
ssiyad
added a commit
that referenced
this pull request
Jun 10, 2026
fix(build): Validate platform is arm64 or x86_64 (backport #535)
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.
No description provided.