Skip to content

chore(launchpad): Return created instead of OK upon chunks being successfully uploaded #97559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,5 @@ def post(self, request: Request, project) -> Response:
update_org_auth_token_last_used(request.auth, [project.id])

return Response(
{"state": ChunkFileState.OK, "missingChunks": [], "artifactId": artifact_id}
{"state": ChunkFileState.CREATED, "missingChunks": [], "artifactId": artifact_id}
)
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def test_assemble_basic(
HTTP_AUTHORIZATION=f"Bearer {self.token.token}",
)
assert response.status_code == 200, response.content
assert response.data["state"] == ChunkFileState.OK
assert response.data["state"] == ChunkFileState.CREATED
assert set(response.data["missingChunks"]) == set()
assert response.data["artifactId"] == artifact_id

Expand Down Expand Up @@ -440,7 +440,7 @@ def test_assemble_with_metadata(
HTTP_AUTHORIZATION=f"Bearer {self.token.token}",
)
assert response.status_code == 200, response.content
assert response.data["state"] == ChunkFileState.OK
assert response.data["state"] == ChunkFileState.CREATED
assert set(response.data["missingChunks"]) == set()
assert response.data["artifactId"] == artifact_id

Expand Down Expand Up @@ -500,7 +500,7 @@ def test_assemble_with_missing_chunks(self) -> None:
)

assert response.status_code == 200, response.content
assert response.data["state"] == ChunkFileState.OK
assert response.data["state"] == ChunkFileState.CREATED

def test_assemble_response(self) -> None:
content = b"test response content"
Expand All @@ -518,7 +518,7 @@ def test_assemble_response(self) -> None:
)

assert response.status_code == 200, response.content
assert response.data["state"] == ChunkFileState.OK
assert response.data["state"] == ChunkFileState.CREATED

def test_assemble_with_pending_deletion_project(self) -> None:
self.project.status = ObjectStatus.PENDING_DELETION
Expand Down Expand Up @@ -637,7 +637,7 @@ def test_check_existing_assembly_status(self) -> None:

# Even if assembly status exists, endpoint doesn't check it
set_assemble_status(
AssembleTask.PREPROD_ARTIFACT, self.project.id, checksum, ChunkFileState.OK
AssembleTask.PREPROD_ARTIFACT, self.project.id, checksum, ChunkFileState.CREATED
)

response = self.client.post(
Expand Down Expand Up @@ -671,7 +671,7 @@ def test_integration_task_sets_status_api_can_read_it(self) -> None:

# Even if task sets status, this endpoint doesn't read it
set_assemble_status(
AssembleTask.PREPROD_ARTIFACT, self.project.id, total_checksum, ChunkFileState.OK
AssembleTask.PREPROD_ARTIFACT, self.project.id, total_checksum, ChunkFileState.CREATED
)

response = self.client.post(
Expand Down
Loading