Skip to content

fix(api-client): addresses bugs in API client #2191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

JGAntunes
Copy link
Member

What this PR does / why we need it:

This PR branches out of:

Adds tests to the API client and fixes the underlying bugs found as part of it.

Which issue(s) this PR fixes:

Does this PR require a test?

Does this PR require a release note?


Does this PR require documentation?

@JGAntunes JGAntunes requested a review from sgalsaleh May 27, 2025 09:50
Comment on lines -12 to -19
type APIError struct {
StatusCode int `json:"status_code"`
Message string `json:"message"`
}

func (e *APIError) Error() string {
return fmt.Sprintf("status=%d, message=%q", e.StatusCode, e.Message)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

We can leverage types.APIError instead.

Comment on lines +39 to +46
Token string `json:"token"`
}
err = json.NewDecoder(resp.Body).Decode(&loginResp)
if err != nil {
return err
}

c.token = loginResp.SessionToken
c.token = loginResp.Token
Copy link
Member Author

Choose a reason for hiding this comment

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

Matching the API response body.

Copy link

This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID.

Online Installer:

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/appver-dev-a85c19b" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Airgap Installer (may take a few minutes before the airgap bundle is built):

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci-airgap/appver-dev-a85c19b?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

@sgalsaleh
Copy link
Member

Merging into a branch

@sgalsaleh sgalsaleh merged commit c64fd9b into salah/sc-123874/steelthread-configure-data-dir-in-the-new May 27, 2025
58 of 63 checks passed
@sgalsaleh sgalsaleh deleted the fix/api-client branch May 27, 2025 12:58
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