[TECH DEBT] Deprecate the callback argument of AsyncAuth.authenticate()

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

メンテナーはふだん 3 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python

調査の方向性

Start by locating AsyncAuth.authenticate() and its tests in the Salt codebase; the issue does not name specific files or tests. Check how salt.utils.versions.warn_until is used for deprecations, then add the warning on master when a callback is passed, pointing callers to await or add_done_callback(). Done means the warning is covered by tests and the 3008.x behavior remains unchanged.

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

説明

tech-debt
Description of the tech debt to be addressed, include links and screenshots

AsyncAuth.authenticate(callback=None) takes an optional callback that is called with the result when the sign-in succeeds. It is left over from the Tornado callback style.

  • Nothing in salt/ passes a callback. Every caller does await auth.authenticate().
  • It is not documented.
  • With #70603 the callback is only called when the sign-in succeeds. A failed sign-in never reaches it, so a caller using a callback is not told about the failure.
  • authenticate() returns a task. A caller that wants a notification can use task.add_done_callback(), which is also called when the sign-in fails.
Proposed change

Do not change this in #70603 or its 3008.x version, which only fix cancellation and error handling.

  1. On master, warn with salt.utils.versions.warn_until when a callback is passed, and point to await or add_done_callback().
  2. Remove the argument once the warning period is over.

Leave 3008.x as it is.

Related: #70603, #70366, #70712.

Versions Report

No user-visible change until the warning is added. Targets the master branch.

主要言語
Python
スター
15.8k
フォーク
5.6k
平均マージ
5日 9時間
マージ済み PR(30日)
99

環境構築

はじめの一歩

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

saltstack/salt のほかの issue

saltstack/salt の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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