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

Drop Resty as a dependency #576

Open
wants to merge 16 commits into
base: proj/resty-migration
Choose a base branch
from

Conversation

ezilber-akamai
Copy link
Contributor

@ezilber-akamai ezilber-akamai commented Sep 5, 2024

📝 Description

Linodego currently uses the go-resty package to manage all HTTP requests made to the API. This includes logic for authentication, JSON marshaling/unmarshaling, request retries, and debug outputs.

Unfortunately this package has caused various issues for linodego users, including:

  • Various upstream race conditions prevent linodego from being thread-safe
  • Uncommitted maintainers lead to difficulty quickly releasing patches for critical issues
  • Bloated dependency tree can cause downstream dependency conflicts
  • Less flexibility due to limited access to the underlying HTTP client

Because of these issues, Resty is being dropped as a dependency in favor of the mature and widely adopted net/http package.

✔️ How to Test

Run the unit test suite with make testunit

Run the integration test suite with make testint

@ezilber-akamai ezilber-akamai added the improvement for improvements in existing functionality in the changelog. label Sep 6, 2024
@ezilber-akamai ezilber-akamai force-pushed the TPT-2965-drop-resty branch 4 times, most recently from bc4dc02 to 519fdcd Compare September 11, 2024 17:33
@ezilber-akamai ezilber-akamai force-pushed the TPT-2965-drop-resty branch 3 times, most recently from 27bad2e to 117b42b Compare September 18, 2024 20:18
@ezilber-akamai ezilber-akamai force-pushed the TPT-2965-drop-resty branch 5 times, most recently from 2fa956d to b584283 Compare September 24, 2024 18:36
@ezilber-akamai ezilber-akamai marked this pull request as ready for review September 30, 2024 15:04
@ezilber-akamai ezilber-akamai requested a review from a team as a code owner September 30, 2024 15:04
@ezilber-akamai ezilber-akamai requested review from zliang-akamai and ykim-1 and removed request for a team September 30, 2024 15:04
@lgarber-akamai
Copy link
Contributor

lgarber-akamai commented Sep 30, 2024

Running the TF cross-test workflow against these changes here: https://github.com/lgarber-akamai/linodego/actions/runs/11111815305/job/30872572090

edit: Oops, I forgot to address the retry condition breaking changes. I'll fix that up on my TF fork and report back 🙂

images.go Outdated Show resolved Hide resolved
@lgarber-akamai lgarber-akamai self-requested a review October 7, 2024 15:43
dependabot bot and others added 4 commits October 7, 2024 11:20
* build(deps): bump golang.org/x/text from 0.18.0 to 0.19.0

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.18.0 to 0.19.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](golang/text@v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Ran make tidy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ezilber-akamai <[email protected]>
* allow some vars to be shared

* add target branch

* remove target branch

* revert to push_request and only run slack notify when push to main
client.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
@lgarber-akamai
Copy link
Contributor

I think it was implemented in a previous PR, but would it make sense for RequestParams to be made private given it's only used by internal helpers?

Copy link
Contributor

@lgarber-akamai lgarber-akamai left a comment

Choose a reason for hiding this comment

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

I tested this pretty thoroughly and everything seems to be working well, great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement for improvements in existing functionality in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants