Skip to content

Handle idempotent response on tarball upload url - #109

Merged
thelovekesh merged 1 commit into
mainfrom
fix/update-tarball-idempotent-response
Nov 7, 2025
Merged

Handle idempotent response on tarball upload url#109
thelovekesh merged 1 commit into
mainfrom
fix/update-tarball-idempotent-response

Conversation

@thelovekesh

Copy link
Copy Markdown
Collaborator

If the package is already published, we need to ensure idempotency for the same user. This PR adds changes to bail early with idempotent response once the package is published for the same user.

@thelovekesh
thelovekesh requested a review from Copilot November 7, 2025 07:42
@github-actions

github-actions Bot commented Nov 7, 2025

Copy link
Copy Markdown

📦 wpm cli builds 📦

@thelovekesh
thelovekesh merged commit df59ed1 into main Nov 7, 2025
16 checks passed
@thelovekesh
thelovekesh deleted the fix/update-tarball-idempotent-response branch November 7, 2025 07:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for handling idempotent upload requests in the registry client. When a package upload has already been completed, the server now returns a message field instead of an id/url, which is treated as a successful operation rather than an error.

  • Changed UploadTarballResponse fields from strings to pointers to support optional fields
  • Added Message field to handle idempotent response scenarios
  • Introduced idempotencyRespError custom error type for special success handling of duplicate uploads

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cli/registry/client/client.go Modified UploadTarballResponse to use pointer types for Id and Url, added optional Message field for idempotency responses
cli/command/publish/publish.go Added idempotencyRespError type, updated response handling to check for idempotency message and display success, adjusted nil checks for pointer fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/command/publish/publish.go
Comment thread cli/command/publish/publish.go
@thelovekesh thelovekesh added the command any changes to the wpm cli command label Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command any changes to the wpm cli command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants