Consolidate Container-only fields (dockerfile, buildContextPath, customDockerBuildArgs) into a containerConfig object

Đang mở
#1,703 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Trước tiên, hãy đọc hai tệp schema AgentEnvSpec và pattern networkConfig hiện có, sau đó lần theo các consumer CLI và CDK được liệt kê: packaging/container.ts, dev/config.ts, dev/container-dev-server.ts, deploy/preflight.ts, AgentEnvironment và ContainerSourceAsset. Công việc được xem là hoàn tất khi các trường chỉ dành cho container được nhóm nhất quán, tài liệu và các snapshot của asset được cập nhật, đồng thời ghi chú migration hoặc quyết định về Back-Compat đã được xử lý.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

With aws/agentcore-cli#1284, Container agents now have three flat, Container-only fields on AgentEnvSpec: dockerfile, buildContextPath, and customDockerBuildArgs — plus cross-cutting "only allowed for Container builds" validators for each.

Both AgentEnvSpecSchema copies (CLI and @aws/agentcore-cdk) already carry a standing comment near the validators:

If adding more Container-specific fields, consider consolidating into a containerConfig object (see networkConfig pattern)

We've now hit that threshold. This tracks grouping them under a single optional object:

containerConfig?: {
  dockerfile?: string;
  buildContextPath?: string;
  customDockerBuildArgs?: Record<string, string>;
}
Benefits
  • One build !== 'Container' && data.containerConfig check instead of three per-field validators.
  • Future container-only options land inside containerConfig with no new cross-cutting validators.
  • Clearer grouping in the schema and docs (mirrors the existing networkConfig pattern).
Why it's deferred

This is a breaking schema change: it moves the already-shipped dockerfile field, touches every consumer, existing user agentcore.json files, and asset snapshots — and would have ballooned a contributor PR. Better as its own scoped change (with a migration note / back-compat shim if we want to keep accepting the flat form for a release).

Scope
  • CLI: src/schema/schemas/agent-env.ts (+ compacted mirror), consumers (packaging/container.ts, dev/config.ts, dev/container-dev-server.ts, deploy/preflight.ts), docs, snapshots.
  • @aws/agentcore-cdk: src/schema/schemas/agent-env.ts (+ compacted mirror), AgentEnvironment, ContainerSourceAsset.

Ref: review comment on aws/agentcore-cli#1284.

Ngôn ngữ chính
TypeScript
Star
339
Fork
129
Merge trung bình
19 giờ 21 phút
Pull request đã merge (30 ngày)
125

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/agentcore-cli

Tất cả issue của aws/agentcore-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.