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

refactor(retrofit2): replace retrofit client with retrofit2 client #1466

Merged
merged 24 commits into from
Jan 9, 2025

Conversation

kirangodishala
Copy link
Contributor

  • This PR makes use of retrofit 2.x client in place of retrofit 1.9 and make required changes accordingly.
  • Replaced all RetrofitError references with SpinnakerServerException and/or its sub classes.
  • All the retrofit1 dependencies and references are removed.
  • Retrofit2 boilerplate code was already implemented in kork's kork-retrofit module and this PR makes use of it.

@kirangodishala kirangodishala marked this pull request as draft December 29, 2024 21:28
@spinnakerbot
Copy link
Contributor

We prefer that non-test backend code be written in Java or Kotlin, rather than Groovy. The following files have been added and written in Groovy:

  • echo-test/src/main/groovy/com/netflix/spinnaker/echo/config/Retrofit2TestConfig.groovy

See our server-side conventions here.

@kirangodishala kirangodishala marked this pull request as ready for review December 31, 2024 14:29
.create(GithubService.class);

return githubClient;
return new Retrofit.Builder()
Copy link
Contributor

@dbyron-sf dbyron-sf Dec 31, 2024

Choose a reason for hiding this comment

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

The above code doesn't have:

.setErrorHandler(SpinnakerRetrofitErrorHandler.getInstance())

so...is there still some RetrofitError-based exception handling? Or maybe there isn't, and we're getting an improvement by moving to ErrorHandlingExecutorCallAdapterFactory....and that improvement is...SpinnakerServerException and children in theory provide better error messages than RetrofitError.

def slackClient = new RestAdapter.Builder()
.setEndpoint(slackEndpoint)
.setConverter(new JacksonConverter())
.setClient(retrofitClient)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll stop commenting, but...another place with no SpinnakerRetrofitErrorHandler.

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Jan 9, 2025
@mergify mergify bot added the auto merged label Jan 9, 2025
@mergify mergify bot merged commit 6a0e784 into spinnaker:master Jan 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants