BigSamu / OpenSearch_Changelog_Workflow

A reusable workflow for automating changelog and release notes generation processes for OpenSearch repos
Apache License 2.0
0 stars 4 forks source link

Abstract API calls into HTTP and API services #55

Closed JohnathonBowers closed 3 months ago

JohnathonBowers commented 6 months ago

Right now, we are duplicating code with our HTTP requests. It would be good to create an HTTP service and an API service to enable better maintainability and separation of concerns.

BigSamu commented 6 months ago

Could you give me an example? Both API requests done to the GitHub API (using the octokit library ) or our OpenSearch_Changelog_PR_Bridge service use HTTPS in production mode.

If we want to reduce duplication for the requests done to the OpenSearch_Changelog_PR_Bridge service we can implement an axios instance instead. But for the case of the API requests to the GitHub API, the octokit instance wraps all the required logic for sending these requests.

JohnathonBowers commented 6 months ago

Sorry, @BigSamu . I should have clarified what I meant. I created this issue mainly as a placeholder for something to come back to when we have time. The API calls I had in mind are the ones we make to the OpenSearch_Changelog_PR_Bridge service. And, yes, creating an axios instance would be along the lines of what I had in mind.

BigSamu commented 6 months ago

Yeah, creating an axios instance is a good way to go for reducing repetition. Good call!

BigSamu commented 3 months ago

This is already addressed in release v1.0.0-alpha