fix: API inconsistencies and silent failure fixes#2
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes several CLI/API mismatches and silent-failure behaviors by aligning requests with the EE 2.39.1 OpenAPI spec and ensuring raw/binary responses and HTTP error statuses are handled correctly.
Changes:
- Add
RawPostand makeRawGetreturn errors on HTTP 4xx/5xx instead of treating error bodies as valid output. - Fix stack lifecycle/redeploy endpoints to include
endpointIdvia--envwhere required/needed. - Correct backup creation to use
POSTand persist the returned archive; add CSV time filtering and file output options; include requiredTypefield for registry ping.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
internal/client/client.go |
Adds RawPost and upgrades raw-body helpers to fail on non-2xx/3xx HTTP status codes. |
cmd/stack.go |
Adds/uses --env to supply endpointId for stack start/stop, and optionally for git redeploy. |
cmd/registries_webhooks.go |
Adds registry ping request Type and a --type flag to match spec requirements. |
cmd/admin.go |
Switches backup creation to POST and saves returned data; adds --range + --output-file for activity CSV downloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yajith
approved these changes
Apr 20, 2026
ac216c3 to
44a4882
Compare
- stack stop/start: add required --env flag (endpointId query param) - stack redeploy: add optional --env flag for pre-v1.18.0 stacks - backup create: fix HTTP method from GET to POST, capture binary response - registry ping: add required Type field and --type flag - client: add RawPost for binary POST responses - activity logs-csv/auth-logs-csv: add --range (1d-7d) and --output-file flags
Previously RawGet returned the error response body as data and exited 0, so callers (container logs, image pull, CSV export) appeared to succeed even when the API returned 4xx/5xx.
- Add github (type 8) to registryTypeLabel so registry list shows name not raw int - Wrap transport errors in RawPost/RawGet with "request failed:" for consistency with do()
44a4882 to
a46997c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--envflag — API requiresendpointIdquery param but it was missing, causing400errors--envflag for stacks created before v1.18.0GETtoPOSTand captures binary response — previous code discarded the backup dataTypefield and--typeflag (spec marks it required)--range(1d–7d) for time filtering and--output-fileto save instead of printingAll changes verified against the EE 2.39.1 OpenAPI spec.