Return fresh project after update

Merged
RO
5mo ago
+162-2

Summary

  • Refetch projects after projects update before returning the response envelope
  • Add a red/green regression test for stale update responses

Validation

Reproduced on current main against Rob Zolkos test account/project: the update response returned the old description while a follow-up projects show returned the new description.

After this change, the same live validation returns the updated description in the projects update response.

Local tests:

GOWORK=off go test ./internal/commands -run TestProjectsUpdateReturnsFreshProjectAfterDescriptionChange
GOWORK=off go test ./internal/commands

Closes #468.


Summary by cubic

Return the fresh project after projects update by refetching, fixing stale fields in the response. If the refetch fails, fall back to the update response and include a diagnostic. Closes #468.

  • Bug Fixes
    • After a successful update, refetch with Projects().Get and return that result so description and updated_at are current.
    • When refetch fails, return the update response and add a notice via output.WithDiagnostic; tests also assert the PUT body includes the current name when only description changes.