Skip to content

remoteconfig --dry-run does not validate condition expression syntax #11125

Description

@Ryu0118

[REQUIRED] Environment info

firebase-tools: 15.30.2

Platform: macOS

[REQUIRED] Test case

Set a Remote Config condition's expression to an invalid string:

{ "conditions": [{ "name": "test", "expression": "this is not valid syntax at all !!!" }] }

Run: firebase deploy --only remoteconfig --dry-run

[REQUIRED] Steps to reproduce

  1. Add the above condition to a remoteconfig template JSON referenced by firebase.json's remoteconfig.template
  2. Run firebase deploy --only remoteconfig --dry-run

[REQUIRED] Expected behavior

Dry-run should report the invalid expression syntax as an error (or the CLI should document that remoteconfig dry-run does not perform this check).

[REQUIRED] Actual behavior

Dry-run prints "Dry run complete!" and exits 0. A subsequent real firebase deploy --only remoteconfig (no --dry-run) with the same broken expression is the first point where the error surfaces, server-side, on publish.

Root cause:

  • src/deploy/remoteconfig/functions.ts's validateInputRemoteConfigTemplate() only checks that etag is a non-empty string and conditions is an array. It never inspects expression content.
  • src/deploy/index.ts (around line 220): when options.dryRun is true, the deploys and releases phases are skipped entirely for every target. For remoteconfig, the release phase (the actual template PUT) is the only place server-side validation happens — so dry-run performs no expression validation at all.
  • This does not appear to be intentional: PR Add --dry-run to deploy #7574 ("Add --dry-run to deploy") added dedicated dry-run validation logic to database, dataconnect, and extensions (e.g. database/prepare.ts always calls rtdb.updateRules(..., { dryRun: true }) to check rules syntax server-side; dataconnect/prepare.ts calls diffSchema → upsertSchema(schema, validateOnly: true) when options.dryRun is set). remoteconfig was not touched by that PR and has no equivalent validation path.
  • The Remote Config REST API supports ?validate_only=true on the template PUT endpoint, which would let remoteconfig follow the same pattern, but the CLI never calls it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions