devcontainers / devcontainers/features

[EPIC] Prefer DRY tool versioning

Aperta
#1,699 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Shell
Stelle
1.5k
Fork
621
Merge medio
6g 53m
PR unite (30g)
9

Descrizione

The examples in this repository often show a configuration approach where tool version numbers are explicitly specified in the devcontainer.json file.

However, best practice nowadays is to extract your tool versions to a dedicated file.

We should support this best practice in our examples by showing how to indirectly reference to versions.

## Examples of thing to change

https://github.com/devcontainers/features/blob/4170bca4d08a2be5d96a33251a45a0027cc5cacb/src/node/README.md?plain=1#L14-L20

https://github.com/devcontainers/features/blob/4170bca4d08a2be5d96a33251a45a0027cc5cacb/src/ruby/README.md?plain=1#L9-L11

## Example end state

```json
"features": {
"ghcr.io/devcontainers/features/node:2": {
"version": ".nvmrc"
}
}
```

```json
"features": {
"ghcr.io/devcontainers/features/ruby:2": {
"version": ".ruby-version"
}
}
```

## Discussion

Adopting the above approach allows us to achieve DRY version specification with modern development approaches. This means we can easily achieve parity between local developers, GitHub Agents, GitHub Actions, and Dev Containers :nirvana_emoji:

It is possible that the above features I have referenced already implicitly load such a version file. If so, this behavior is undocumented.

I am marking this GitHub issue as an "epic" because it affects many different features. And perhaps we will require several pull requests to address this.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con gli esempi referenziati in src/node/README.md e src/ruby/README.md, quindi esamina gli altri README delle feature che specificano esplicitamente le versioni degli strumenti in devcontainer.json. Verifica se le feature caricano già .nvmrc o .ruby-version, aggiorna gli esempi interessati in modo che utilizzino file di versione dedicati e documenta qualsiasi comportamento richiesto affinché le versioni locali, di Actions e del Dev Container possano rimanere allineate.

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

Valutazione

Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.