Skip to content

Conversation

harshyyy21
Copy link
Contributor

Description

This PR checks the Java version before starting emulators that require Java and warns users if the Java version < 21.

Scenarios Tested

Tested this with Java 11 and Java 25.

Java 11 output:

node lib/bin/firebase.js emulators:start --only firestore                                       
⚠  Could not find config (firebase.json) so using defaults.
⬢  emulators: firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. Please install a JDK at version 21 or above to get a compatible runtime.
i  emulators: Starting emulators: firestore
⚠  firestore: Did not find a Cloud Firestore rules file specified in a firebase.json config file.
⚠  firestore: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.
i  firestore: Firestore Emulator logging to firestore-debug.log
✔  firestore: Firestore Emulator UI websocket is running on 9150.

Java 25 output:

node lib/bin/firebase.js emulators:start --only firestore
⚠  Could not find config (firebase.json) so using defaults.
i  emulators: Starting emulators: firestore
⚠  firestore: Did not find a Cloud Firestore rules file specified in a firebase.json config file.
⚠  firestore: The emulator will default to allowing all reads and writes. Learn more about this option: https://firebase.google.com/docs/emulator-suite/install_and_configure#security_rules_configuration.
i  firestore: Firestore Emulator logging to firestore-debug.log
✔  firestore: Firestore Emulator UI websocket is running on 9150.

Copy link
Contributor

Summary of Changes

Hello @harshyyy21, 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 updates the Firebase CLI's handling of Java versions for emulators. It raises the minimum recommended Java version to 21 and changes the behavior for unsupported versions from a hard failure to a deprecation warning, ensuring users are informed about future requirements while maintaining current functionality.

Highlights

  • Java Version Requirement Update: The minimum supported Java major version for Firebase emulators has been updated from 11 to 21. Users running Java versions below 21 will now receive a deprecation warning.
  • Deprecation Warning Mechanism: Instead of throwing an error and preventing emulator startup, the system will now issue a warning if the Java version is below 21, allowing the emulators to proceed with a clear notification about the upcoming support drop in Firebase CLI v15.
  • Changelog Entry: A new entry has been added to the changelog, explicitly stating the deprecation of Java 11 and below, and advising users to upgrade to Java 21 or above.
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

@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 updates the Java version check for emulators, raising the minimum recommended version to 21 and changing the enforcement from an error to a warning. The changes are generally in the right direction, but I've found a critical issue where the deprecation warning is not correctly propagated, rendering part of the change ineffective. I've also suggested improvements to the changelog entry for accuracy and to the code for better style and readability. Please review the comments for details.

@@ -1,3 +1,4 @@
- Marks Java 11 and below as deprecated. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The changelog entry is inaccurate. The code changes deprecate Java versions < 21, not just 11 and below. To avoid confusion, please update the changelog to reflect this. A more active phrasing would also improve readability.

For example: Deprecated Java versions below 21. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.

Suggested change
- Marks Java 11 and below as deprecated. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.
- Deprecated Java versions below 21. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.

Comment on lines 591 to +593
export const JAVA_DEPRECATION_WARNING =
"firebase-tools no longer supports Java versions before 11. " +
"Please install a JDK at version 11 or above to get a compatible runtime.";
"firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. " +
"Please install a JDK at version 21 or above to get a compatible runtime.";
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For improved readability, you can combine this into a single string on one line, removing the need for concatenation.

Suggested change
export const JAVA_DEPRECATION_WARNING =
"firebase-tools no longer supports Java versions before 11. " +
"Please install a JDK at version 11 or above to get a compatible runtime.";
"firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. " +
"Please install a JDK at version 21 or above to get a compatible runtime.";
export const JAVA_DEPRECATION_WARNING =
"firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. Please install a JDK at version 21 or above to get a compatible runtime.";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant