Skip to content

fix(build): Validate platform is arm64 or x86_64 (backport #535)#537

Merged
ssiyad merged 1 commit into
masterfrom
mergify/bp/master/pr-535
Jun 10, 2026
Merged

fix(build): Validate platform is arm64 or x86_64 (backport #535)#537
ssiyad merged 1 commit into
masterfrom
mergify/bp/master/pr-535

Conversation

@mergify

@mergify mergify Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This is an automatic backport of pull request #535 done by [Mergify](https://mergify.com).

@mergify mergify Bot assigned ssiyad Jun 9, 2026
@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown

Greptile Summary

Backport of #535. Adds an early-exit ValueError in ImageBuilder.__init__ when platform is not "arm64" or "x86_64".

  • Validation is placed before self.platform is assigned, which is the correct fail-fast pattern.
  • Allowed values match the Literal["arm64", "x86_64"] type annotation already present at line 110.

Confidence Score: 5/5

Single-line guard added to constructor; no logic paths are altered and the validation aligns with the existing type annotation.

The change is a two-line defensive check with no side effects. The allowed values match what the rest of the class already expects and passes to Docker. No edge cases are missed.

No files require special attention.

Important Files Changed

Filename Overview
agent/builder.py Adds a ValueError guard validating that platform is "arm64" or "x86_64" before assigning to self.platform; change is correct and consistent with the existing Literal type annotation.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["ImageBuilder.__init__(platform)"] --> B{"platform in\n('arm64', 'x86_64')?"}
    B -- No --> C["raise ValueError\n'Invalid platform ...'"]
    B -- Yes --> D["self.platform = platform"]
    D --> E["docker buildx build --platform {self.platform}"]
Loading

Reviews (1): Last reviewed commit: "fix(build): Validate platform is arm64 o..." | Re-trigger Greptile

@ssiyad ssiyad merged commit 1f6fcc3 into master Jun 10, 2026
4 of 5 checks passed
@ssiyad ssiyad deleted the mergify/bp/master/pr-535 branch June 10, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant