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

Offen
#1,703 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Refactoring
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
typescript
Bereich
cli, tooling

Rechercherichtung

Lies zuerst die beiden AgentEnvSpec-Schemadateien und das bestehende networkConfig-Muster und verfolge dann die aufgeführten CLI- und CDK-Verbraucher: packaging/container.ts, dev/config.ts, dev/container-dev-server.ts, deploy/preflight.ts, AgentEnvironment und ContainerSourceAsset. Die Aufgabe ist erledigt, wenn die ausschließlich für Container geltenden Felder konsistent gruppiert sind, die Dokumentation und Asset-Snapshots aktualisiert wurden und der Migrationshinweis oder die Back-Compat-Entscheidung behandelt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
339
Forks
129
Ø Merge
19 Std. 21 Min.
Gemergte PRs (30 T.)
125

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus aws/agentcore-cli

Alle Issues in aws/agentcore-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.