Expose internalArtifactTwirpClient
options
(especially maxAttempts
) to uploadArtifact
and friends
#1864
Labels
enhancement
New feature or request
Describe the enhancement
The current exported
uploadArtifact
api:toolkit/packages/artifact/src/internal/upload/upload-artifact.ts
Lines 24 to 28 in 7f5921c
Takes a parameter
toolkit/packages/artifact/src/internal/shared/interfaces.ts
Line 20 in 7f5921c
That only exposes the two fields visible once an artifact is created:
toolkit/packages/artifact/src/internal/shared/interfaces.ts
Line 36 in 7f5921c
toolkit/packages/artifact/src/internal/shared/interfaces.ts
Line 47 in 7f5921c
And it passes no arguments to
internalArtifactTwirpClient
toolkit/packages/artifact/src/internal/upload/upload-artifact.ts
Line 47 in 7f5921c
But,
internalArtifactTwirpClient
takesmaxAttempts
,retryIntervalMs
, andretryMultiplier
:toolkit/packages/artifact/src/internal/shared/artifact-twirp-client.ts
Lines 184 to 188 in 7f5921c
Code Snippet
I think there's some value in distinguishing between values which are visible after an artifact is uploaded with the values for how the artifact is uploaded, hence sticking them in a sub object. I lean here towards extending the current options argument instead of adding a second options argument to the
uploadArtifact
call itself. But any approach would be fine.Additional information
There are people who trip on outages from this api, as seen in actions/upload-artifact#569.
I'd like to be able to configure my actions/workflows to give up sooner (or try longer, but, in my case definitely give up sooner) when uploading an artifact fails.
In my case, two failed artifact uploads added 6 minutes to a 4 minute run. If I had CI for a private repository doing that, I'd expect those 6 minutes to be billed and that could add up over time.
While I'm mostly interested in exposing
maxAttempts
touploadArtifact
(and eventually getting it added to actions/upload-artifact), I think exposingretryIntervalMs
andretryMultiplier
isn't unreasonable. Similarly, I'd want to be able to use these options fordownloadArtifact
andlistArtifacts
as well...toolkit/packages/artifact/src/internal/client.ts
Lines 40 to 45 in 7f5921c
toolkit/packages/artifact/src/internal/client.ts
Lines 57 to 59 in 7f5921c
toolkit/packages/artifact/src/internal/download/download-artifact.ts
Lines 152 to 158 in 7f5921c
toolkit/packages/artifact/src/internal/find/list-artifacts.ts
Lines 115 to 118 in 7f5921c
If exposing them directly through the API is too much, I'd be happy to have them exposed via environment variables as that would save me the effort of getting the middle consumers (actions/upload-artifact,...) to update and expose the knobs.
The text was updated successfully, but these errors were encountered: