Skip to content

fix: API inconsistencies and silent failure fixes#2

Merged
samdulam merged 3 commits into
developfrom
fix/api-inconsistencies
Apr 20, 2026
Merged

fix: API inconsistencies and silent failure fixes#2
samdulam merged 3 commits into
developfrom
fix/api-inconsistencies

Conversation

@samdulam
Copy link
Copy Markdown
Contributor

@samdulam samdulam commented Apr 20, 2026

Summary

  • stack stop/start: added required --env flag — API requires endpointId query param but it was missing, causing 400 errors
  • stack redeploy: added optional --env flag for stacks created before v1.18.0
  • backup create: fixed HTTP method from GET to POST and captures binary response — previous code discarded the backup data
  • registry ping: added required Type field and --type flag (spec marks it required)
  • activity logs-csv / auth-logs-csv: added --range (1d–7d) for time filtering and --output-file to save instead of printing
  • RawGet: now checks HTTP status and returns a proper error on 4xx/5xx — previously error responses were printed as valid data and the command exited 0

All changes verified against the EE 2.39.1 OpenAPI spec.

Copy link
Copy Markdown

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

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 RawPost and make RawGet return errors on HTTP 4xx/5xx instead of treating error bodies as valid output.
  • Fix stack lifecycle/redeploy endpoints to include endpointId via --env where required/needed.
  • Correct backup creation to use POST and persist the returned archive; add CSV time filtering and file output options; include required Type field 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.

Comment thread cmd/registries_webhooks.go
Comment thread cmd/registries_webhooks.go
Comment thread internal/client/client.go Outdated
Comment thread internal/client/client.go Outdated
@samdulam samdulam requested a review from yajith April 20, 2026 04:43
@samdulam samdulam force-pushed the fix/api-inconsistencies branch from ac216c3 to 44a4882 Compare April 20, 2026 05:12
- 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()
@samdulam samdulam force-pushed the fix/api-inconsistencies branch from 44a4882 to a46997c Compare April 20, 2026 06:01
@samdulam samdulam merged commit 9b06bac into develop Apr 20, 2026
3 checks passed
@samdulam samdulam deleted the fix/api-inconsistencies branch April 20, 2026 06:03
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