Skip to content

Conversation

@bkendall
Copy link
Collaborator

@bkendall bkendall commented Aug 13, 2025

(This is just a shadow PR to see if the actions actually work)

ThadCastl3 and others added 6 commits July 21, 2025 11:46
…e your bill, such as minimum instances required.
Co-authored-by: Bryan Kendall <[email protected]>
…port for channel site deployment with force flag. Updated tests to and types to account for force flags. Force flag is now optional on ProductionDeployConfig and ChannelDeployConfig. Simplified deploy calls using force flag to automatically append force based on the boolean value nad removed the force-specific branch in index.ts
Copy link

@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.

Summary of Changes

Hello @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 introduces a new force input to the GitHub Action, enabling users to bypass interactive prompts and warnings during Firebase deployments by passing the --force flag to firebase-tools commands. This enhancement streamlines continuous deployment workflows by allowing fully automated deployments without manual intervention. The changes involve updating the action's configuration, core deployment logic, and type definitions, along with adding comprehensive test coverage for the new functionality.

Highlights

  • New force input for Firebase deployments: A new force input has been added to the action.yml file. This input, when set to true, will instruct the action to use the --force flag during Firebase deployments, bypassing interactive prompts and warnings.
  • Integration of --force flag into deployment commands: The core logic within bin/action.min.js, src/deploy.ts, and src/index.ts has been updated to correctly interpret and pass the --force flag to firebase-tools commands. This ensures that deployments proceed without requiring manual confirmation, which is crucial for automated CI/CD pipelines.
  • Enhanced type definitions for force deployments: New TypeScript types (ForceProductionSuccessResult, ForceChannelSuccessResult) and modifications to existing deployment configuration types (DeployConfig, ChannelDeployConfig, ProductionDeployConfig) have been introduced in src/deploy.ts. This enhances type safety and clarity when handling the force option throughout the codebase.
  • Expanded test coverage for --force functionality: Comprehensive unit tests have been added and updated in test/deploy.test.ts to cover scenarios where the --force flag is used. These tests verify that the flag is correctly applied for both preview channel and production site deployments, ensuring the reliability of this new feature.
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

  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

@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 introduces a force flag to allow bypassing prompts during Firebase deployment. The overall approach in the TypeScript source files is sound, but there are several issues that need attention. Most critically, the compiled JavaScript file (bin/action.min.js) is out of sync with the source code and contains an incorrect implementation. Additionally, there are redundant type definitions in src/deploy.ts and a bug in one of the new test cases in test/deploy.test.ts. Addressing these points will improve the quality and correctness of the changes.

Comment on lines 93011 to 93023
async function deployWithForce(gacFilename, deployConfig) {
const {
projectId,
target,
firebaseToolsVersion,
force
} = deployConfig;
const deploymentText = await execWithCredentials(["deploy", "--only", `hosting${target ? ":" + target : ""}`, "--force"], projectId, gacFilename, {
firebaseToolsVersion,
force
});
const deploymentResult = JSON.parse(deploymentText);
return deploymentResult;

Choose a reason for hiding this comment

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

critical

This compiled file appears to be out of sync with the TypeScript source files (src/index.ts and src/deploy.ts). It contains a deployWithForce function and a special if (force) block in the main run function, which are not present in the source and represent an incorrect implementation approach. The logic in src/index.ts correctly passes the force flag to the existing deploy functions, which is the right way to do it.

Please run the build process to update this file from the TypeScript source. The current state of this file will cause incorrect behavior.

src/deploy.ts Outdated
Comment on lines 43 to 53
export type ForceProductionSuccessResult = {
status: "success";
result: {
hosting: string | string[];
};
};

export type ForceChannelSuccessResult = {
status: "success";
result: { [key: string]: SiteDeploy };
};

Choose a reason for hiding this comment

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

high

The new types ForceProductionSuccessResult and ForceChannelSuccessResult are identical to the existing ProductionSuccessResult and ChannelSuccessResult types, respectively. This introduces redundancy. Please remove these new types and use the existing ones.

Comment on lines 168 to 171
const config: ChannelDeployConfig = {
...baseChannelDeployConfig,
target: "my-second-site",
};

Choose a reason for hiding this comment

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

high

This test case is intended to check that --force is used when a target is provided. However, the config object is created from baseChannelDeployConfig, which does not set force: true. As a result, the expectation on line 181 that deployFlags contains "--force" will fail. You should add force: true to the configuration for this test.

Suggested change
const config: ChannelDeployConfig = {
...baseChannelDeployConfig,
target: "my-second-site",
};
const config: ChannelDeployConfig = {
...baseChannelDeployConfig,
target: "my-second-site",
force: true,
};

Comment on lines 63 to 72
export type ChannelDeployConfig = DeployConfig & {
expires: string;
channelId: string;
force?: boolean;
};

export type ProductionDeployConfig = DeployConfig & {};

export type ProductionDeployConfig = DeployConfig & {
force?: boolean;
};

Choose a reason for hiding this comment

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

medium

The force?: boolean property is already defined in the base DeployConfig type on line 60. It's redundant to declare it again in ChannelDeployConfig and ProductionDeployConfig since they extend DeployConfig.

Suggested change
export type ChannelDeployConfig = DeployConfig & {
expires: string;
channelId: string;
force?: boolean;
};
export type ProductionDeployConfig = DeployConfig & {};
export type ProductionDeployConfig = DeployConfig & {
force?: boolean;
};
export type ChannelDeployConfig = DeployConfig & {
expires: string;
channelId: string;
};
export type ProductionDeployConfig = DeployConfig & {};

@bkendall bkendall closed this Aug 18, 2025
@FirebaseExtended FirebaseExtended locked and limited conversation to collaborators Sep 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants