-
Notifications
You must be signed in to change notification settings - Fork 1.1k
(feat) Reorganize and improve crashlytics tools #9127
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
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.
Summary of Changes
Hello @maxl0rd, 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 introduces a major reorganization and enhancement of the Crashlytics tools. The changes aim to improve maintainability and consistency by consolidating existing API interactions into a more structured, resource-oriented approach. It also significantly expands the filtering capabilities for various Crashlytics reports and event listings, providing more granular control and detailed insights for users.
Highlights
- API Consolidation and Refactoring: The Crashlytics API calls have been significantly refactored and consolidated. Previously separate functions like
addNote
,deleteNote
,getIssueDetails
,getSampleCrash
,listNotes
,listTopDevices
,listTopIssues
,listTopOperatingSystems
,listTopVersions
, andupdateIssue
have been replaced by new, more generalized functions grouped by resource (e.g.,issues.ts
,notes.ts
,events.ts
,reports.ts
). - Standardized Terminology and Filtering: The MCP tools now use terminology more consistent with Crashlytics API resources and verbs. A new
filters.ts
file introduces standardized schemas (ApplicationIdSchema
,IssueIdSchema
,EventFilterSchema
) and a utility function (filterToUrlSearchParams
) to convert tool parameters into AIP-160 style URL parameters, allowing for a full range of filtering options across reports and events. - Expanded Functionality for Reports and Events: The new
reports.ts
andevents.ts
modules provide enhanced capabilities. All report tools can now utilize a comprehensive set of filtering options, including issue ID filters for issue-level breakdowns. ThelistEvents
function now supports various filters for reading events, and apruneThreads
helper reduces token usage by filtering irrelevant threads from crash samples. - New Type Definitions: A comprehensive
types.ts
file has been added, defining detailed interfaces and enums for Crashlytics API data structures, includingReportGroup
,Issue
,Event
,Device
,OperatingSystem
,Note
, and various filter types, improving type safety and clarity.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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
-
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. ↩
- Importing interfaces for the Crashlytics public API - Setting appropriate return types in client responses - When retrieving native crash sessions, pruning all superfluous threads to dramatically reduce token usage.
- Providing schemas for comprehensive filtering options - Consoldidating report client calls into a single method - Consolidating tool definitions and sharing schema defs
f1504f1
to
3e833e6
Compare
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 is a significant and well-executed refactoring of the Crashlytics tools, improving maintainability, consistency, and functionality. The code is now organized by resource, which is a great improvement. I've identified a critical issue that could lead to a runtime error, along with several medium and high severity issues related to code consistency, correctness, and maintainability. Applying these suggestions will make the new tools more robust and easier to work with.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
queryParams: { updateMask: "state" }, | ||
body: { issue: { state } }, |
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 body is not correct, there shouldn't be an issue object.
It should be:
queryParams: { updateMask: "state" },
body: { state },
// of each report to be more clearly described. In the future, it may be possible | ||
// to consolidate all of these into a single `get_report` tool. | ||
|
||
export const get_top_issues = tool( |
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.
nit: Should we call these all list_top_*? Not sure if it matters to the LLM.
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.
I elected to use the appropriate API verb for the underlying rpc. It's GET Report and LIST events, etc.
Description
Refactoring for maintainability and consistency
the API resources and verbs.
Expanding the functionality of MCP tools
and combine them as needed.