1
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-10-02 13:29:10 +00:00

Fix artifact v4 upload above 8MB (#31664) (fix lint errors)

This commit is contained in:
Earl Warren 2024-09-29 09:58:47 +02:00
parent 8f0a05a7e4
commit a226064711
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -181,7 +181,7 @@ func TestActionsArtifactV4UploadSingleFileWithPotentialHarmfulBlockID(t *testing
defer tests.PrepareTestEnv(t)() defer tests.PrepareTestEnv(t)()
token, err := actions_service.CreateAuthorizationToken(48, 792, 193) token, err := actions_service.CreateAuthorizationToken(48, 792, 193)
assert.NoError(t, err) require.NoError(t, err)
// acquire artifact upload url // acquire artifact upload url
req := NewRequestWithBody(t, "POST", "/twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact", toProtoJSON(&actions.CreateArtifactRequest{ req := NewRequestWithBody(t, "POST", "/twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact", toProtoJSON(&actions.CreateArtifactRequest{
@ -208,7 +208,7 @@ func TestActionsArtifactV4UploadSingleFileWithPotentialHarmfulBlockID(t *testing
// verify that the exploit didn't work // verify that the exploit didn't work
_, err = storage.Actions.Stat("myfile") _, err = storage.Actions.Stat("myfile")
assert.Error(t, err) require.Error(t, err)
// upload artifact blockList // upload artifact blockList
blockList := &actions.BlockList{ blockList := &actions.BlockList{
@ -217,7 +217,7 @@ func TestActionsArtifactV4UploadSingleFileWithPotentialHarmfulBlockID(t *testing
}, },
} }
rawBlockList, err := xml.Marshal(blockList) rawBlockList, err := xml.Marshal(blockList)
assert.NoError(t, err) require.NoError(t, err)
req = NewRequestWithBody(t, "PUT", blockListURL, bytes.NewReader(rawBlockList)) req = NewRequestWithBody(t, "PUT", blockListURL, bytes.NewReader(rawBlockList))
MakeRequest(t, req, http.StatusCreated) MakeRequest(t, req, http.StatusCreated)
@ -244,7 +244,7 @@ func TestActionsArtifactV4UploadSingleFileWithChunksOutOfOrder(t *testing.T) {
defer tests.PrepareTestEnv(t)() defer tests.PrepareTestEnv(t)()
token, err := actions_service.CreateAuthorizationToken(48, 792, 193) token, err := actions_service.CreateAuthorizationToken(48, 792, 193)
assert.NoError(t, err) require.NoError(t, err)
// acquire artifact upload url // acquire artifact upload url
req := NewRequestWithBody(t, "POST", "/twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact", toProtoJSON(&actions.CreateArtifactRequest{ req := NewRequestWithBody(t, "POST", "/twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact", toProtoJSON(&actions.CreateArtifactRequest{
@ -282,7 +282,7 @@ func TestActionsArtifactV4UploadSingleFileWithChunksOutOfOrder(t *testing.T) {
}, },
} }
rawBlockList, err := xml.Marshal(blockList) rawBlockList, err := xml.Marshal(blockList)
assert.NoError(t, err) require.NoError(t, err)
req = NewRequestWithBody(t, "PUT", blockListURL, bytes.NewReader(rawBlockList)) req = NewRequestWithBody(t, "PUT", blockListURL, bytes.NewReader(rawBlockList))
MakeRequest(t, req, http.StatusCreated) MakeRequest(t, req, http.StatusCreated)