[BUG] Huge APIs (with many Operations and other artifacts) have the publisher tool fail
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia dal percorso di creazione o aggiornamento della Management API dello strumento di pubblicazione e verifica come gestisce le risposte 422, incluso il comportamento esistente di nuovo tentativo per 409. Riproduci il problema con un'API contenente un numero molto elevato di operazioni, quindi verifica che il polling dello stato attenda con un timeout limitato e che le operazioni riuscite o non riuscite producano il risultato di workflow appropriato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Release version
5.00 and onwards
Describe the bug
I have tried to transfer "The Jira Service Management Public REST API" from one Service to another using the publisher tool. As the amount of operations and possibly other artifacts is significant, the Management API Call to create or update the API results in the Management API returning 422 after a while. Which is fine if it was handled, but of course that is not the case, so the Publisher fails.
Expected behavior
Here is what I expect publisher to do:
- Catch the 422 Error: Modify the Publisher Tool to explicitly catch the 422 error. The tool should recognize this specific HTTP status code and handle it appropriately rather than immediately retrying or failing.
- Implement a Status Check: After catching the 422 error, introduce a function to query the status of the API operation using the Azure Management API. You can use endpoints like GET /apis/{apiId} to check the current status of the ongoing API update.
- Retry Mechanism: If the status indicates that the API operation is still "in progress," implement a retry loop with a delay (e.g., using sleep) until the process is finished. Make sure to introduce a sensible timeout to avoid indefinite retries.
- Proceed or Abort Workflow: Based on the final status of the operation, either proceed with the next step of the deployment if the update was successful or abort the workflow with an appropriate error message if the operation ultimately fails.
This approach ensured that the script avoided unnecessary retries and handled conflicts like the 409 error by waiting for the ongoing operation to complete before attempting further updates.
Actual behavior
After the timeout, the Management APIs return of 422 breaks publisher which aborts with an error. Actually, the requested operation is continued to be carried out in the backend, so ultimately business-logic wise the call has succeeded, we just don't know about it and are left with an unhandled exception.
Reproduction Steps
I'd try to have publisher publish the "The Jira Service Management Public REST API", or any other API with a HUGE amount of operations and perhaps other artifacts.
- Lingua principale
- C#
- Stelle
- 448
- Fork
- 247
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/apiops
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di Azure/apiops
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nightscout/nocturne#1425 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Difficoltà 2/5 1-2 giorni Idoneità per principianti 75/100
Altinn/altinn-auth#4143 ·