Skip to content

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 ykim-akamai and zliang-akamai and removed request for a team September 30, 2024 15:04
@lgarber-akamai lgarber-akamai self-requested a review September 30, 2024 16:03
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] <support@github.com>

* Ran make tidy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ezilber-akamai <ezilber@akamai.com>
* 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
@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!

@ezilber-akamai ezilber-akamai force-pushed the TPT-2965-drop-resty branch 2 times, most recently from 1b2d5e0 to c47ec39 Compare October 23, 2024 14:50
Copy link
Contributor

@ykim-akamai ykim-akamai left a comment

Choose a reason for hiding this comment

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

LGTM overall, tested locally and also ran tests for terraform. We probably need a follow up ticket to ensure everything runs smooth in terraform and update retry functions. Excellent work!!

runs-on: ubuntu-latest
needs: [test]
if: always() && github.repository == 'linode/linodego' # Run even if integration tests fail and only on main repository
if: always() && github.ref == 'refs/heads/main' && github.event_name == 'push' # Run even if integration tests fail and only on main repository
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to add the condition github.ref == 'refs/heads/main' && github.event_name == 'push' along with github.repository == 'linode/linodego' to limit slack notifications?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's already in main? Maybe we can do some main -> proj -> this-branch merges?

Copy link
Member

@zliang-akamai zliang-akamai left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for addressing these

@ezilber-akamai ezilber-akamai merged commit 4a2a1e6 into linode:proj/resty-migration Oct 25, 2024
5 checks passed
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.

4 participants