theupdateframework / theupdateframework/python-tuf

ngclient: Make updater.config immutable

オープン
#2,471 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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=True as well

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue の例を使って設定がいつ読み取られるかを特定しながら、refresh() を通じて Updater.config と UpdaterConfig を追跡します。読み取り専用プロパティと凍結された設定のオプションを比較し、その後、Updater が設定を使用した後に設定を変更できないこと、および既存の動作が引き続きカバーされていることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, backend
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。