netlify / open-api

Open API specification of Netlify's API
https://open-api.netlify.com/#/default
MIT License
263 stars 84 forks source link

Feat: Don't retry function upload on 400 or 422 status #478

Closed erikw closed 1 year ago

erikw commented 1 year ago

~# WIP Don't retry function upload on 4xx. A 4xx response~

When a function upload receives a 400 or 422 status code, we know that retrying the upload will fail. This change returns early rather than retrying.

netlify[bot] commented 1 year ago

Deploy Preview for open-api ready!

Name Link
Latest commit 25f5b63b0dda80372215462ac26b381bfcd5a565
Latest deploy log https://app.netlify.com/sites/open-api/deploys/650ad802998da00008fed3bd
Deploy Preview https://deploy-preview-478--open-api.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

jenae-janzen commented 1 year ago

Something I would suggest we had is a property (a boolean flag of some sort) that we can use to enable this new behaviour and that way feature flag it on Buildbot's side.

I added this to the options struct, but am also open to passing it in as a parameter. I started adding it in Buildbot here, but it's not set up quite right yet and I haven't set up the flag in DevCycle yet.

jenae-janzen commented 1 year ago

This is ready for review. We set skipRetry to false by default if no value is received for the feature flag. The accompanying change is also ready for review, but depends on this change going out first because this is where options is defined.