sentry-cli
sentry-cli copied to clipboard
Infinite loop in `build upload` if assemble "created" response lacks `artifact_url`
Description
I encountered this code while trying to write an integration test which simulated server responses.
In this code:
https://github.com/getsentry/sentry-cli/blob/1886edc0fff0a79aec90abc4563786040a4c315e/src/commands/build/upload.rs#L564-L600
If the backend's assemble endpoint only ever returns a "created" response, and this response lacks an "artifact_url" (which could happen if we ever remove this field from the server's responses in the future for whatever reason), we will get stuck in an infinite loop.
Two thoughts:
- The final
ifstatement should also check if we return "created", not just "Error" or "OK" - There needs to be some sort of timeout and/or maximum iteration count on this loop, so that it is impossible to get stuck in an infinite loop.
Thanks for filing, do you have that script you used for the integration test?