Skip to content

Support deploying Remote Config server template#9863

Draft
nohe427 wants to merge 2 commits intomainfrom
remoteconfig-server-deploy-11116758096781058099
Draft

Support deploying Remote Config server template#9863
nohe427 wants to merge 2 commits intomainfrom
remoteconfig-server-deploy-11116758096781058099

Conversation

@nohe427
Copy link
Contributor

@nohe427 nohe427 commented Feb 2, 2026

Implemented support for deploying a server-specific Remote Config template.

  • Modified src/firebaseConfig.ts to include server property in RemoteConfigConfig.
  • Updated src/deploy/remoteconfig/functions.ts to accept templateType and pass it as a query parameter.
  • Updated src/deploy/remoteconfig/prepare.ts to handle remoteconfig:server target and load the corresponding template.
  • Updated src/deploy/remoteconfig/release.ts to use the correct templateType during release.
  • Added unit tests in src/deploy/remoteconfig/remoteconfig.spec.ts covering getEtag and publishTemplate with templateType.
  • Regenerated schema/firebase-config.json.

PR created automatically by Jules for task 11116758096781058099 started by @nohe427

Adds support for deploying a server-specific Remote Config template via `firebase deploy --only remoteconfig:server`.
- Updates `firebase.json` schema to allow `remoteconfig.server.template`.
- Updates `deploy` command to detect `remoteconfig:server` target.
- Updates API calls to include `templateType=firebase-server` when deploying server template.
- Enforces mutual exclusivity between client and server deployments.

Co-authored-by: nohe427 <3211589+nohe427@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @nohe427, 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 extends the Remote Config deployment capabilities to support server-specific templates. It introduces a new configuration option in firebase.json for defining server templates and modifies the underlying deployment logic to correctly identify, prepare, and release these templates to the Remote Config service. The changes ensure that server and client templates can be managed independently, with appropriate API calls and validation to prevent conflicts.

Highlights

  • Server-Specific Remote Config Deployment: Introduced support for deploying Remote Config templates specifically for server-side configurations, distinct from client-side templates.
  • Configuration Schema Update: The firebase.json schema (RemoteConfigConfig) now includes an optional server property to define a server-specific template path, making the top-level template property optional.
  • API Function Enhancements: The getEtag, deployTemplate, and publishTemplate functions in src/deploy/remoteconfig/functions.ts have been updated to accept an optional templateType parameter, allowing differentiation between client and server templates during API calls.
  • Deployment Logic Refinement: The prepare.ts and release.ts scripts now handle remoteconfig:server as a distinct deployment target, load the appropriate template, and pass the templateType to the API. A validation step prevents simultaneous deployment of both client and server templates.
  • Unit Test Coverage: New unit tests have been added in src/deploy/remoteconfig/remoteconfig.spec.ts to cover the functionality of getEtag and publishTemplate when a templateType is provided.

🧠 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
  • schema/firebase-config.json
    • Added a new server property to the RemoteConfigConfig schema, allowing specification of a template for server-side Remote Config.
    • Made the top-level template property optional within RemoteConfigConfig.
  • src/deploy/remoteconfig/functions.ts
    • Modified getEtag to accept an optional templateType parameter, which is passed as a query parameter to the Remote Config API.
    • Modified deployTemplate to accept an optional templateType in its options, passing it as a query parameter.
    • Modified publishTemplate to accept an optional templateType in its options.
  • src/deploy/remoteconfig/prepare.ts
    • Introduced logic to differentiate between remoteconfig (client) and remoteconfig:server deployment targets.
    • Added validation to prevent deploying both client and server templates in a single command.
    • Loads the appropriate template (remoteconfig.template or remoteconfig.server.template) based on the deployment target.
    • Passes the templateType ("firebase-server" for server templates) to getEtag and stores it in the context.
    • Throws a FirebaseError if remoteconfig.server.template is not configured when deploying a server template.
  • src/deploy/remoteconfig/release.ts
    • Updated ReleaseContext interface to include remoteconfigTemplateType.
    • Retrieves templateType from the context and passes it to getEtag and publishTemplate.
  • src/deploy/remoteconfig/remoteconfig.spec.ts
    • Added a new test case for getEtag to verify correct usage of templateType in API requests.
    • Added a new test case for publishTemplate to verify correct usage of templateType in API requests.
    • Refactored sandbox setup for stubs to be within describe blocks where they are used, improving test isolation.
  • src/firebaseConfig.ts
    • Modified RemoteConfigConfig type to make template optional and added an optional server property, which contains a template string.
Activity
  • PR created automatically by Jules for task 11116758096781058099 started by @nohe427.
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 introduces support for deploying server-specific Remote Config templates. The changes are well-structured, modifying the configuration schema, type definitions, and deployment logic accordingly. It correctly distinguishes between client and server template deployments and prevents deploying both simultaneously. The API functions and their tests have been updated to handle the new templateType. I have one suggestion to improve the consistency of etag handling during the release process. Overall, the implementation is solid.

const etag = await getEtag(projectNumber);
return publishTemplate(projectNumber, template, etag, options);
const etag = await getEtag(projectNumber, undefined, templateType);
return publishTemplate(projectNumber, template, etag, { ...options, templateType });
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 etag is fetched again here to avoid race conditions, which is good. However, the template object passed to publishTemplate still contains the potentially stale etag from the prepare step. Inside publishTemplate, validation is performed on this template with its stale etag, which is inconsistent. To ensure validation uses the most up-to-date etag, you should create a new template object that includes the newly fetched etag before publishing.

  const templateWithNewEtag = { ...template, etag };
  return publishTemplate(projectNumber, templateWithNewEtag, etag, { ...options, templateType });

@nohe427 nohe427 marked this pull request as draft February 2, 2026 22:56
Adds support for deploying a server-specific Remote Config template via `firebase deploy --only remoteconfig:server`.
- Updates `firebase.json` schema to allow `remoteconfig.server.template`.
- Updates `deploy` command to detect `remoteconfig:server` target.
- Updates API calls to include `templateType=firebase-server` when deploying server template.
- Enforces mutual exclusivity between client and server deployments.
- Fixes build issues related to optional `template` field in `remoteconfig-get` and `init`.

Co-authored-by: nohe427 <3211589+nohe427@users.noreply.github.com>
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