Conversation
Summary of ChangesHello @bkendall, 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 enhances the robustness of App Hosting deployments by integrating comprehensive error detection for backend rollouts. The primary goal is to prevent silent failures, ensuring that the deployment command accurately reflects the success or failure of the underlying rollout processes. This improves the reliability of the deployment workflow and provides clearer feedback to users. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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.
Code Review
This pull request correctly adds error handling for failed App Hosting rollouts, ensuring the deploy command fails as expected. I've added a couple of suggestions to improve the error logging by using an existing utility function, which makes the error messages more robust and aligns better with the repository's best practices.
| logLabeledWarning, | ||
| } from "../../utils"; | ||
| import { Context } from "./args"; | ||
| import { FirebaseError } from "../../error"; |
| failed = true; | ||
| logLabeledWarning("apphosting", `Rollout for backend ${backendIds[i]} failed.`); | ||
| logLabeledError("apphosting", res.reason); | ||
| logLabeledError("apphosting", `${res.reason}`); |
There was a problem hiding this comment.
Using getErrMsg provides more robust error message extraction from the unknown type res.reason. It correctly handles Error objects, strings, and other types, preventing potential output like [object Object]. This also aligns with our best practice of not using escape hatches for unknown types.
| logLabeledError("apphosting", `${res.reason}`); | |
| logLabeledError("apphosting", getErrMsg(res.reason)); |
References
- The style guide recommends against using escape hatches for
anyorunknowntypes and instead using proper interfaces, types, or type guards. UsinggetErrMsgis a better way to handle theunknownerror reason. (link)
Description
Fixes #8866
Capturing the error during a deploy allows us to fail the deploy command.
Scenarios Tested