[PR #62] [MERGED] fix(cli): validate Dockerfile before creating template #148

Closed
opened 2026-10-29 14:20:16 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/62
Author: @ShiroKSH
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/29/2026
Merged by: @yingdi-shan

Base: main ← Head: fix/aenv-build-preflight


📝 Commits (1)

  • bae4d3f fix(cli): validate Dockerfile before creating template

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 crates/aenv/src/commands/build.rs (+1 -1)

📄 Description

What

Validate and translate the Dockerfile before creating the remote template record.

Why

aenv build currently sends POST /v3/templates before checking whether the Dockerfile contains unsupported instructions. A later validation error leaves a Waiting template/build behind and can retain the requested alias even though no build was started.

N/A — focused CLI bug fix.

Scope and non-goals

Only the preflight order changes. Supported Dockerfiles keep the same request payloads and build flow.

Design and behavior changes

Build the local Dockerfile plan before the first remote mutation. Invalid Dockerfiles now fail without creating server-side state.

Compatibility and operations

  • Public API or generated protocol: N/A
  • Configuration or defaults: N/A
  • Snapshot manifest, artifact layout, or storage format: N/A
  • Upgrade and rollback: N/A
  • Host requirements, permissions, ports, or dependencies: N/A

Validation

  • cargo fmt --all -- --check
  • cargo clippy -p aenv --all-targets -- -D warnings
  • cargo test -p aenv commands::build::tests

Commands and results:

cargo test -p aenv commands::build::tests
13 passed; 0 failed

cargo fmt --all -- --check
passed

cargo clippy -p aenv --all-targets -- -D warnings
passed

Risks and reviewer notes

Low risk: the change only moves an existing fallible, local validation step before template creation.

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • Existing Dockerfile parser tests cover supported instructions and the rejected COPY/ADD paths.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • No generated code was changed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/62 **Author:** [@ShiroKSH](https://github.com/ShiroKSH) **Created:** 7/29/2026 **Status:** ✅ Merged **Merged:** 7/29/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `fix/aenv-build-preflight` --- ### 📝 Commits (1) - [`bae4d3f`](https://github.com/kvcache-ai/AgentENV/commit/bae4d3fc332a11d030629097e0a0bbd732939095) fix(cli): validate Dockerfile before creating template ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/aenv/src/commands/build.rs` (+1 -1) </details> ### 📄 Description ## What Validate and translate the Dockerfile before creating the remote template record. ## Why `aenv build` currently sends `POST /v3/templates` before checking whether the Dockerfile contains unsupported instructions. A later validation error leaves a `Waiting` template/build behind and can retain the requested alias even though no build was started. ## Related issue N/A — focused CLI bug fix. ## Scope and non-goals Only the preflight order changes. Supported Dockerfiles keep the same request payloads and build flow. ## Design and behavior changes Build the local Dockerfile plan before the first remote mutation. Invalid Dockerfiles now fail without creating server-side state. ## Compatibility and operations - Public API or generated protocol: N/A - Configuration or defaults: N/A - Snapshot manifest, artifact layout, or storage format: N/A - Upgrade and rollback: N/A - Host requirements, permissions, ports, or dependencies: N/A ## Validation - [x] `cargo fmt --all -- --check` - [x] `cargo clippy -p aenv --all-targets -- -D warnings` - [x] `cargo test -p aenv commands::build::tests` Commands and results: ```text cargo test -p aenv commands::build::tests 13 passed; 0 failed cargo fmt --all -- --check passed cargo clippy -p aenv --all-targets -- -D warnings passed ``` ## Risks and reviewer notes Low risk: the change only moves an existing fallible, local validation step before template creation. ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] Existing Dockerfile parser tests cover supported instructions and the rejected `COPY`/`ADD` paths. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] No generated code was changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:20:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#148
No description provided.