Skip to content
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

chore: Fix resource group header #185

Merged
merged 10 commits into from
Oct 2, 2024
Merged

chore: Fix resource group header #185

merged 10 commits into from
Oct 2, 2024

Conversation

tomfrenken
Copy link
Member

@tomfrenken tomfrenken commented Sep 30, 2024

Context

AI/gen-ai-hub-sdk-js-backlog#146.

A user discovered a bug where we do not properly set the resource group after they have set it in the client's initialization.

With this fix, this should be fixed.

Definition of Done

  • Code is tested (Unit, E2E)
  • Error handling created / updated & covered by the tests above
  • Documentation updated
  • (Optional) Aligned changes with the Java SDK
  • (Optional) Release notes updated

@tomfrenken
Copy link
Member Author

@reviewers I intentionally didn't add tests for all the other clients yet, I would copy the test over to all affected clients, so please let me know if the current way I test it is sufficient before I copy it over.

Copy link
Member

@MatKuhr MatKuhr left a comment

Choose a reason for hiding this comment

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

duplicating these tests a few times is of course a bit annoying. Is there any way to shorten them perhaps?

Pseudo code:

const expectedEndpoint = { url: 'localhost', resourceGroup: 'default' }
const mock = mock(httpClient)
client.run(prompt)
expect(mock.executeRequest).toBeCalled().with(expectedEndpoint)

Since we don't care about the full flow, we only care about the correct RG being passed on..

Copy link
Contributor

@ZhongpinWang ZhongpinWang left a comment

Choose a reason for hiding this comment

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

LGTM. Only one question came to my mind while reviewing the PR.

Also, I suppose we need a changeset for the fix? I think we can add this to the PR template later because this can be missed so easily.

packages/core/src/http-client.ts Show resolved Hide resolved
Copy link
Contributor

@ZhongpinWang ZhongpinWang left a comment

Choose a reason for hiding this comment

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

Just in case, don't forget the changeset.

@tomfrenken tomfrenken merged commit 771f986 into main Oct 2, 2024
9 checks passed
@tomfrenken tomfrenken deleted the fix-resource-group branch October 2, 2024 15:02
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.

4 participants