Skip to content

Forward AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY to production builds#2721

Merged
CassioMG merged 1 commit intomasterfrom
bugfix/enable-feature-flags-in-production
Apr 24, 2026
Merged

Forward AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY to production builds#2721
CassioMG merged 1 commit intomasterfrom
bugfix/enable-feature-flags-in-production

Conversation

@CassioMG
Copy link
Copy Markdown
Contributor

@CassioMG CassioMG commented Apr 24, 2026

Summary

  • The production release workflow (submitProduction.yml) was invoking yarn build:extension:production without AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY. With no key forwarded, webpack's DefinePlugin baked in an empty string, so at runtime initExperimentClient short-circuited and every feature flag evaluated to its default in the shipped extension — even though analytics events continued to flow because AMPLITUDE_KEY was still being passed.
  • The beta workflow (submitBeta.yml) already referenced this key; production now matches it. All environments use the same AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY value.
  • Also adding it to submitSafari.yml for consistency. We aren't currently running that workflow, but wiring it up now means flags will work out of the box if we ever revive Safari builds.
  • Separately, the AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY GitHub Actions secret was not actually set in the repository until now — it has just been added. Without this secret, even the beta workflow (which already referenced it) would have been interpolating an empty string into its build command, so feature flags were effectively disabled across all shipped builds. Setting the secret + this PR together is what restores flag evaluation end-to-end.

Test plan

  • Verify beta release also starts seeing flag evaluations now that the secret exists (previously silent).
  • Verify Amplitude analytics events continue to flow normally (no regression).
  • On next production release verify a known-active feature flag (e.g. maintenance_banner) evaluates correctly in the popup.

🤖 Generated with Claude Code

The production and Safari submit workflows were omitting this secret from
the webpack build env, so DefinePlugin baked in an empty deployment key.
That made `initExperimentClient` short-circuit at runtime, leaving feature
flags always evaluating to their defaults in the shipped extension even
though analytics events continued to flow. The beta workflow already
passes this key; production and Safari now match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 24, 2026 01:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures production and Safari release workflows forward AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY into yarn build:extension:production so Amplitude Experiment feature flags are evaluated correctly in shipped builds.

Changes:

  • Forward AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY in the production release workflow build step.
  • Forward AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY in the Safari release workflow build step.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/submitProduction.yml Adds AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY to the production extension build command so webpack can bake the correct value.
.github/workflows/submitSafari.yml Adds AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY to the Safari extension build command to match beta/production behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CassioMG CassioMG self-assigned this Apr 24, 2026
@CassioMG CassioMG changed the title Forward AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY to production builds Forward AMPLITUDE_EXPERIMENT_DEPLOYMENT_KEY to production builds Apr 24, 2026
@CassioMG CassioMG merged commit 1d5a145 into master Apr 24, 2026
13 checks passed
@CassioMG CassioMG deleted the bugfix/enable-feature-flags-in-production branch April 24, 2026 16:46
@github-actions github-actions Bot mentioned this pull request Apr 24, 2026
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.

3 participants