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

Use separate API for wingman #6

Merged
merged 4 commits into from
Aug 8, 2024
Merged

Conversation

harveysmurf
Copy link
Contributor

@harveysmurf harveysmurf commented Aug 7, 2024

Use the new REST API Gateway for the wingman llm proxy


export const getFlyCIUrl = (path: string = "") => {
const url = core.getInput("flyci-url") || FLYCI_URL;

return `${url}${path}`;
};

export const getWingmanUrl = () => core.getInput("wingman-url") || WINGMAN_URL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a unit test for the scenario when the URL is passed as input?

@harveysmurf harveysmurf requested a review from ligaz August 7, 2024 14:09
Comment on lines 90 to 91
process.env[wingmanUrlEnv] = "mock-url";
mockExec.mockResolvedValueOnce(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I will go with mocking core.getInput() instead of relying on its internal implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What I don't like about mocking is that this would also mock getInput for the "flyci-url" which can potentially make the test not that reliable unless we use mockImplementation and check if the input is "wingman-url". Otherwise the test will pass even if we use getFlyciUrl instead of getWingmanUrl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

opted for verifying of getInput was called with wingman-url the second time

@harveysmurf harveysmurf merged commit 1fabf5e into main Aug 8, 2024
1 check passed
@harveysmurf harveysmurf deleted the use-rest-api-for-wingman-url branch August 8, 2024 07:01
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.

2 participants