-
Notifications
You must be signed in to change notification settings - Fork 29
build: remove retrofit and retrofit_generator #632
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
Conversation
Summary of ChangesHello @riscait, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly reduces the project's dependency footprint and reliance on code generation by removing the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with π and π on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes the retrofit and retrofit_generator dependencies from the project, replacing the generated REST client implementation with a manual Dio-based implementation. The change reduces dependency complexity and eliminates code generation requirements.
Key changes:
- Replaced
retrofit-generated API client with manual Dio implementation - Removed
retrofitandretrofit_generatordependencies and their version pinning workarounds - Updated test configuration to remove Flutter-specific filters
- Added documentation explaining the rationale for minimizing dependencies and code generation
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pubspec.yaml | Removed dependency overrides for analyzer and retrofit_generator, updated test script descriptions to remove Flutter-specific filters |
| packages/pub_dev_api_client/pubspec.yaml | Removed retrofit and retrofit_generator dependencies |
| packages/pub_dev_api_client/lib/src/pub_dev_api_client.dart | Replaced abstract retrofit-based API client with concrete Dio-based implementation |
| packages/pub_dev_api_client/lib/src/pub_dev_api_client.g.dart | Deleted generated retrofit implementation file |
| packages/pub_dev_api_client/test/src/pub_dev_api_client_test.dart | Updated constructor calls from fromParameters to direct constructor |
| packages/flutter_app/lib/package_adaptor/pub_dev_api_client_provider.dart | Updated constructor call from fromParameters to direct constructor |
| packages/pub_dev_api_client/build.yaml | Removed retrofit_generator configuration |
| docs/dependency-adoption-principles.md | Added new documentation explaining dependency and code generation philosophy |
| .cspell/framework-words.txt | Added "endtemplate" to spell checker dictionary |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| contentType: Headers.jsonContentType, | ||
| ), | ||
| )..interceptors.add(LogInterceptor(responseBody: true)); | ||
|
|
Copilot
AI
Dec 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _dio field lacks documentation. Add a brief comment explaining it holds the HTTP client instance used for API requests.
| /// HTTP client instance used for Pub.dev API requests. |
packages/pub_dev_api_client/test/src/pub_dev_api_client_test.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request successfully removes the retrofit and retrofit_generator dependencies, which simplifies the overall dependency graph and build process. The manual implementation of the API client using dio is well done. The addition of the dependency-adoption-principles.md file is a great step towards documenting development guidelines. I've provided a few suggestions to further refine the new API client code by removing a redundant operation and improving error messages for easier debugging.
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #632 +/- ##
==========================================
+ Coverage 47.18% 49.19% +2.00%
==========================================
Files 27 33 +6
Lines 551 620 +69
==========================================
+ Hits 260 305 +45
- Misses 291 315 +24
... and 5 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
π New features to boost your workflow:
|
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'q': searchWord, | ||
| 'sort': sort, | ||
| 'page': page, | ||
| }; |
Copilot
AI
Dec 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The query parameters map includes null values, but Dio does not automatically filter them. This differs from the previous retrofit implementation which used queryParameters.removeWhere((k, v) => v == null). Null parameters will be sent as 'null' strings in the query string.
| }; | |
| }..removeWhere((key, value) => value == null); |
| exec: | ||
| failFast: true | ||
| description: Run flutter test. | ||
| description: Run test packages. |
Copilot
AI
Dec 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description change from 'Run flutter test.' to 'Run test packages.' doesn't accurately reflect the removal of the flutter: true filter. The script still runs flutter test, so the description should remain aligned with the actual command or be updated to 'Run tests for all packages' if that's the intent.
| description: Run test packages. | |
| description: Run flutter tests for all packages. |
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 2. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
π What's Done
βοΈ What's Not Done
π Additional Notes
πΌοΈ Image Differences
Pre-launch Checklist