Skip to content

feat: add FF_BUSINESS feature flag for PostGuard for Business#81

Merged
rubenhensen merged 2 commits into
mainfrom
feat/ff-business
Apr 17, 2026
Merged

feat: add FF_BUSINESS feature flag for PostGuard for Business#81
rubenhensen merged 2 commits into
mainfrom
feat/ff-business

Conversation

@rubenhensen

Copy link
Copy Markdown
Contributor

Summary

  • Add runtime feature flag FF_BUSINESS to control visibility of all PostGuard for Business content
  • Wire up window.APP_CONFIG from Terraform ConfigMap (fixes mount path from /var/www/html/ to /usr/share/nginx/html/postguard/)
  • Add static/config.js with development defaults (FF_BUSINESS: true)
  • Load config.js in app.html before the app boots
  • Read the flag in $lib/env.ts and use it to conditionally render:
    • Header nav link
    • Landing page business section
    • Footer business link

Requires companion changes in postguard-ops (same branch name):

  • variables.tf: new postguard_ff_business variable (default false)
  • main.tf: add FF_BUSINESS to ConfigMap, fix volume mount path
  • environments/dev.tfvars: postguard_ff_business = true
  • environments/prod.tfvars: postguard_ff_business = false

Test plan

  • npx svelte-check --threshold warning passes (0 errors, 0 warnings)
  • Local dev: business section visible (config.js defaults to true)
  • Staging deploy: business section visible (FF_BUSINESS: true)
  • Production deploy: business section hidden (FF_BUSINESS: false)

Wire up window.APP_CONFIG (from Terraform ConfigMap) to control
visibility of the Business nav link, landing page section, and
footer link. The flag is read at runtime from config.js, which
is overridden per environment in deployed clusters.
The ConfigMap-mounted config.js is read-only, so sed -i fails when
it tries to create a temp file. Exclude it from the find since it
never contains VITE placeholders anyway.
@rubenhensen rubenhensen merged commit d3f2ce8 into main Apr 17, 2026
6 checks passed
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