feat(remote-config): implement server template management methods#3189
feat(remote-config): implement server template management methods#3189congminh1254 wants to merge 4 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds server-side Remote Config template management capabilities to the Firebase Admin SDK, introducing methods to retrieve, validate, publish, rollback, and list server-side templates, along with comprehensive unit tests. The feedback recommends refactoring sendServerPutRequest to share common logic with sendPutRequest to reduce code duplication, and adding explanatory comments in validateServerConfigTemplate and publishServerConfigTemplate to clarify ETag handling and force-publishing behavior.
…rollbackInternal, and listVersionsInternal
Description
This PR implements the missing server-side template management functions in the Remote Config service to establish parity with the Firebase Remote Config REST API v1.
Previously, the Admin Node.js SDK treated the
firebase-servernamespace template as a read-only resource (accessible only viagetServerTemplate()/initServerTemplate()). This PR adds public APIs for programmatic fetching, validation, publishing, rollback, and version history listing for thefirebase-servertemplate.API Changes
Adds the following public methods to the
RemoteConfigclass:getServerConfigTemplate(): Promise<RemoteConfigTemplate>: Retrieves the current active version of the server-side Remote Config template.getServerConfigTemplateAtVersion(versionNumber: number | string): Promise<RemoteConfigTemplate>: Retrieves a specific version of the server-side Remote Config template.validateServerConfigTemplate(template: RemoteConfigTemplate): Promise<RemoteConfigTemplate>: Validates a server-side Remote Config template against the Remote Config backend.publishServerConfigTemplate(template: RemoteConfigTemplate, options?: { force: boolean }): Promise<RemoteConfigTemplate>: Publishes a server-side Remote Config template.rollbackServerConfigTemplate(versionNumber: number | string): Promise<RemoteConfigTemplate>: Rolls back the published server-side Remote Config template to a specific version.listServerConfigVersions(options?: ListVersionsOptions): Promise<ListVersionsResult>: Retrieves a list of published server-side Remote Config template versions.These additions are mirrored in the generated API signature file
etc/firebase-admin.remote-config.api.md.Testing
test/unit/remote-config/remote-config-api-client.spec.tstest/unit/remote-config/remote-config.spec.tsnpm run test:unit) ensuring all 6,235 tests pass.npm run lint) is completely clean.