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

Abierto
#70,714 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
15.8k
Forks
5.6k
Merge medio
5 d 9 h
PR fusionados (30 d)
99

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de saltstack/salt

Todos los issues de saltstack/salt

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.