CLI sorts Feature options fewest-first, against spec
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- cli
Direzione di ricerca
Inizia in devcontainers/cli, in src/spec-configuration/containerFeaturesOrder.ts, concentrandoti su optionsCompareTo e sull’ordinamento in base al numero di opzioni. Esegui il test esistente per l’ordine dei container-features in src/test/container-features/containerFeaturesOrder.test.ts con il fixture configs/feature-dependencies/dependsOn/local-with-options, quindi aggiorna l’ordine previsto in modo che il maggior numero di opzioni definite dall’utente venga prima.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Note on repo choice: Per the
devcontainers/cliCONTRIBUTING guide, issues concerning the CLI should be filed in this spec repository, so I've opened it here even though it's aboutdevcontainers/clibehavior. Please let me know if you'd prefer it moved to thedevcontainers/clirepo instead.
Summary
When sorting Features within an installation round, the spec says Features are ordered by the greatest number of user-defined options first, but containerFeaturesOrder.ts orders by the fewest options first.
Specification
Features spec — Definition: Round Stable Sort:
Greatest number of user-defined options (note omitting an option will default that value to the Feature's default value and is not considered a user-defined option)
Implementation
optionsCompareTo returns aKeys.length - bKeys.length, which is negative when a has fewer options, so the Feature with fewer options sorts earlier:
This is the option tiebreaker for every source type (OCI, file-path, direct-tarball, legacy).
Test evidence
The existing test valid dependsOn with round sorting based on options (fixture configs/feature-dependencies/dependsOn/local-with-options) pins the fewest-first behavior — the ./b variant with {} (zero options) is expected first, ahead of the two-option variants:
So the implementation and its tests are internally consistent; only the behavior disagrees with the spec.
Proposed fix
Sort by the greatest option count to match the spec (bKeys.length - aKeys.length), with the fixture/expected order updated accordingly. This changes the install order of the same Feature requested with differing option sets within a round.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 5.7k
- Fork
- 497
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di devcontainers/spec
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
devcontainers/spec#754 · 1 commento · 2 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
devcontainers/spec#735 · 1 commento ·
-
Tighten lockfile spec Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
devcontainers/spec#579 · 1 commento ·
-
ToeySuKhothai_Pull Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
devcontainers/spec#771 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
devcontainers/spec#770 · 1 commento ·
Tutte le issue di devcontainers/spec
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
from:qa priority:P2 reliability tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
spec-kitty/spec-kitty#4874 ·
-
0. Needs triage bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nextcloud/fulltextsearch#1011 ·
-
automation code-quality cookie deep-report documentation improvement quick-win task-mining
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100