theupdateframework / theupdateframework/python-tuf
ngclient: Make updater.config immutable
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 304
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 17
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue の例を使って設定がいつ読み取られるかを特定しながら、refresh() を通じて Updater.config と UpdaterConfig を追跡します。読み取り専用プロパティと凍結された設定のオプションを比較し、その後、Updater が設定を使用した後に設定を変更できないこと、および既存の動作が引き続きカバーされていることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, backend
- issue の種類
- リファクタリング
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100