Skip to content

GCLOUD2-25466 use PATCH instead of PUT in projects.Update#245

Merged
pedrodeoliveira merged 1 commit intomasterfrom
GCLOUD2-25466-projects-update-patch
Apr 28, 2026
Merged

GCLOUD2-25466 use PATCH instead of PUT in projects.Update#245
pedrodeoliveira merged 1 commit intomasterfrom
GCLOUD2-25466-projects-update-patch

Conversation

@pedrodeoliveira
Copy link
Copy Markdown
Contributor

@pedrodeoliveira pedrodeoliveira commented Apr 28, 2026

Summary

  • PUT /cloud/v1/projects/{project_id} is retiring on 2026-06-11 (see GCLOUD2-23608). The endpoint accepts an identical body via PATCH.
  • Switch project/v1/projects.Update() to call c.Patch so this SDK keeps working after the sunset date — no body or signature changes.
  • Updated the corresponding TestUpdate HTTP-method assertion.

Test plan

  • go test ./gcore/project/v1/projects/... passes
  • End-to-end : built gcoreclient from this branch, ran project createproject update -dproject delete. Debug output confirms PATCH /cloud/v1/projects/<id> returning 200 OK.

PUT /cloud/v1/projects/{project_id} is being retired on 2026-06-11
(GCLOUD2-23608). The endpoint accepts an identical body via PATCH, so
switch the SDK call to keep gcorelabscloud-go (and Terraform Provider
v0.x, which depends on it) working past the sunset date.
Copilot AI review requested due to automatic review settings April 28, 2026 10:32
@pedrodeoliveira pedrodeoliveira self-assigned this Apr 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Project SDK’s projects.Update() call to use PATCH instead of PUT to stay compatible with the /cloud/v1/projects/{project_id} endpoint retirement (while keeping request/response shapes unchanged for downstream consumers like the Terraform provider).

Changes:

  • Switch gcore/project/v1/projects.Update() from c.Put to c.Patch.
  • Update TestUpdate to assert PATCH instead of PUT.

Reviewed changes

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

File Description
gcore/project/v1/projects/requests.go Changes the update request HTTP verb from PUT to PATCH while keeping the same URL, body builder, and success codes.
gcore/project/v1/projects/testing/requests_test.go Aligns the unit test’s HTTP method assertion with the new PATCH behavior.

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

@pedrodeoliveira pedrodeoliveira merged commit 9ca97b3 into master Apr 28, 2026
10 checks passed
@pedrodeoliveira pedrodeoliveira deleted the GCLOUD2-25466-projects-update-patch branch April 28, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants