Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add `crossplane project simulate`

Aperta
#367 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
cli

Direzione di ricerca

Inizia da design/one-pager-cli-simulate.md e dal design accettato di crossplane/cli#181, quindi esamina come project run costruisce le funzioni incorporate. Segui il meccanismo crossplane-diff e le fasi elencate discover, prepare, render, diff e report. Il lavoro è completo quando il comando e ogni criterio di accettazione, incluse le modalità di input, gli XR bloccati, i claim, i formati di output e la discovery con ambito limitato, funzionano come descritto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
What

Implement crossplane project simulate as an alpha command, per the accepted design (crossplane/cli#181, design/one-pager-cli-simulate.md).
provider plan servers lands separately, until then the command behaves as --skip-plan always.

This includes the groundwork the design bases simulate on: bringing the crossplane-diff machinery into crossplane/cli as internal packages, with its maintainers' involvement, per "Building on crossplane-diff, Not Beside It".

The flow:

  1. Discover. Parse the project file, find Compositions under the project's API paths, list the XRs on the target cluster whose type each Composition composes. --namespace and --name scope the run.
  2. Prepare. Build the project's embedded functions locally, exactly as project run does.
  3. Render. Re-render each XR with the local Composition and functions, feeding in observed composed resources; resolve required resources with the resolver.
  4. Diff. Calculator + server-side dry-run + removal detection.
  5. Report. Per-XR diffs, Plan: N to add, M to change, K to destroy summary, output formats below.

Also in scope, per the design:

  • No-project input mode: -f accepts changed Composition or XR files directly; matching XRs are discovered on the cluster, functions run from the packages installed on the cluster, everything not overridden locally is fetched live.
  • Pinned XRs: compositionUpdatePolicy: Manual XRs print as deferred by default, simulate with --include-pinned. Exception: when the working tree changes an embedded function, pinned XRs are simulated against their pinned CompositionRevision fetched from the cluster with the locally built functions (function packages are not pinned with the revision until crossplane/crossplane#6139).
  • Claims: a claim passed as a changed file is converted to its XR with the CLI's existing conversion machinery and simulated; results print under the claim's name.
  • Output formats: -o plan (annotated manifest, default), -o diff (line-by-line unified diff, Markdown diff-block compatible, what crossplane-diff emits today), -o json|yaml (one typed result per resource).
  • Flags: as in the design's kong struct (minus the plan-layer flags): -f, --namespace, --name, --include-pinned, --max-iterations, --timeout, --max-concurrency, -o.
Acceptance criteria
  • Resolver, calculator, dry-run, and comp discovery live as internal packages in crossplane/cli, with crossplane-diff maintainer agreement on ownership recorded (CODEOWNERS).
  • crossplane project simulate (alpha) previews Composition, embedded function, and XR changes against a live cluster.
  • -f composition.yaml works without a project.
  • Pinned XRs print as deferred with the documented message; the function-change exception simulates them against their pinned revision.
  • Claims convert and simulate; output uses the claim's name.
  • Removed resources appear as deletes; nothing silently disappears from the preview.
  • All formats work; JSON/YAML results are typed and stable enough for CI gating.
  • Cost scales with what is previewed: no cluster-wide work beyond the scoped discovery.
Out of scope
  • Plan servers, --provider-images, --skip-plan, --keep-plan-servers (follow-up issue: plan layer)
  • Replace detection and known-after-apply values (provider knowledge; plan layer)
Lingua principale
Go
Stelle
19
Fork
33
Merge medio
2g 21h
PR unite (30g)
45

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di crossplane/cli

Tutte le issue di crossplane/cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.