devcontainers / devcontainers/features

[EPIC] Prefer DRY tool versioning

Offen
#1,699 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Shell
Sterne
1.5k
Forks
621
Ø Merge
6 T. 53 Min.
Gemergte PRs (30 T.)
9

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit den referenzierten Beispielen in src/node/README.md und src/ruby/README.md und untersuchen Sie anschließend andere Feature-READMEs, die Tool-Versionen in devcontainer.json ausdrücklich angeben. Bestätigen Sie, ob die Features .nvmrc oder .ruby-version bereits laden, aktualisieren Sie die betroffenen Beispiele so, dass sie dedizierte Versionsdateien verwenden, und dokumentieren Sie jedes erforderliche Verhalten, damit die Versionen in der lokalen Umgebung, in Actions und im Dev Container aufeinander abgestimmt bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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