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

Aperta
#70,714 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
15.8k
Fork
5.6k
Merge medio
5g 9h
PR unite (30g)
99

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di saltstack/salt

Tutte le issue di saltstack/salt

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.