theupdateframework / theupdateframework/python-tuf
ngclient: Make updater.config immutable
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 1.7k
- Forks
- 304
- Ø Merge
- 1 T. 2 Std.
- Gemergte PRs (30 T.)
- 17
Beschreibung
This comes from #2363 / #2359 : we should make the config somehow immutable once it's been used by Updater. This should be a difficult mistake to make:
updater = Updater(...)
updater.refresh()
updater.config.offline = True
(the issue is refresh() already used config.offline: the value can't be changed during lifetime of Updater. Likely this makes sense for all config)
I originally suggested reading the updater.config.offline value only once during initialization, but that still makes writing the above code possible. Would be better if it failed linting.
I suppose two possible actions:
- Updater.config becomes a read only property (or not public at all)
- Could make UpdaterConfig
frozen=Trueas well
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, Updater.config und UpdaterConfig durch refresh() zu verfolgen, und verwende das Beispiel des Issues, um zu ermitteln, wann die Konfiguration gelesen wird. Vergleiche die schreibgeschützte Property und die Optionen für eine eingefrorene Konfiguration. Überprüfe anschließend, dass die Konfiguration nicht mehr geändert werden kann, nachdem Updater sie verwendet hat, und dass das bestehende Verhalten weiterhin abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api, backend
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100