Skip to content

Conversation

@riscait
Copy link
Member

@riscait riscait commented Dec 24, 2025

πŸ™Œ What's Done

  • remove retrofit and retrofit_generator

✍️ What's Not Done

πŸ“ Additional Notes

πŸ–ΌοΈ Image Differences

Before After
image image

Pre-launch Checklist

  • I have reviewed my own code (e.g., updated tests and documentation)

Copilot AI review requested due to automatic review settings December 24, 2025 06:56
@github-actions github-actions bot added documentation Improvements or additions to documentation flutter_app test labels Dec 24, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 retrofit and retrofit_generator packages. The PubDevApiClient has been rewritten to handle API requests directly with Dio, streamlining the codebase and build process. This change aligns with newly documented principles advocating for a leaner dependency graph and reduced maintenance overhead from generated code.

Highlights

  • Dependency Removal: The retrofit and retrofit_generator packages have been completely removed from the project's dependencies.
  • API Client Refactoring: The PubDevApiClient has been refactored to directly use the Dio package for making API calls, eliminating the need for retrofit's code generation.
  • New Documentation: A new documentation file, docs/dependency-adoption-principles.md, has been added to outline the project's philosophy on dependency management, emphasizing fewer dependencies and less code generation.
  • Build Configuration Updates: The build.yaml and pubspec.yaml files have been updated to reflect the removal of retrofit_generator and its associated configurations and overrides.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

Copy link
Contributor

Copilot AI left a 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 retrofit and retrofit_generator dependencies 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));

Copy link

Copilot AI Dec 24, 2025

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.

Suggested change
/// HTTP client instance used for Pub.dev API requests.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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
Copy link

codecov bot commented Dec 24, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
βœ… Project coverage is 49.19%. Comparing base (c38aeaf) to head (e4991b8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...pub_dev_api_client/lib/src/pub_dev_api_client.dart 85.71% 2 Missing ⚠️
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     
Files with missing lines Coverage Ξ”
...pub_dev_api_client/lib/src/pub_dev_api_client.dart 87.50% <85.71%> (ΓΈ)

... and 5 files with indirect coverage changes

Components Coverage Ξ”
flutter_app 31.60% <ΓΈ> (ΓΈ)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update c38aeaf...e4991b8. Read the comment docs.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings December 24, 2025 06:59
Copy link
Contributor

Copilot AI left a 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,
};
Copy link

Copilot AI Dec 24, 2025

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.

Suggested change
};
}..removeWhere((key, value) => value == null);

Copilot uses AI. Check for mistakes.
exec:
failFast: true
description: Run flutter test.
description: Run test packages.
Copy link

Copilot AI Dec 24, 2025

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.

Suggested change
description: Run test packages.
description: Run flutter tests for all packages.

Copilot uses AI. Check for mistakes.
@riscait riscait marked this pull request as ready for review December 24, 2025 07:02
@riscait riscait requested a review from a team as a code owner December 24, 2025 07:02
@riscait riscait requested review from k-nkmr and removed request for a team December 24, 2025 07:02
@cursor
Copy link

cursor bot commented Dec 24, 2025

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.

@riscait riscait merged commit 54d4cb5 into main Dec 24, 2025
7 checks passed
@riscait riscait deleted the remove-retrofit branch December 24, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation flutter_app test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants