Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Accept numbered replica database URLs #5222

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rolodato
Copy link
Member

@rolodato rolodato commented Mar 12, 2025

In #5199, I tried to improve the UX for configuring replica database URLs by accepting a JSON-encoded list of database URLs. This approach is not suitable for use with Helm.

In our Helm values, there are several ways of accepting database URLs:

  • Plaintext URL
  • Plaintext key/value config
  • Secret reference

The problem is dealing with secret references. At deploy time, we cannot access the contents of Kubernetes secrets, so we cannot directly create a JSON-encoded list of URLs. We could imagine some workaround such as having an init container that dynamically creates this list, but this is more trouble than it's worth.

Instead, from Helm we can define each environment variable so that it gets its value from a secret. We can do this for any replica URLs that are passed in via secrets. See Flagsmith/flagsmith-charts#337 for details.

We now accept multiple environment variables such as REPLICA_DATABASE_URL_0, REPLICA_DATABASE_URL_1, etc by starting from 0 and incrementing until we can't find any more variables.

No docs changes for now, as this is only meant to be used by the Helm chart for now.

How did you test this code?

Unit tests.

@rolodato rolodato requested a review from a team as a code owner March 12, 2025 18:46
@rolodato rolodato requested review from gagantrivedi and removed request for a team March 12, 2025 18:46
Copy link

vercel bot commented Mar 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Mar 12, 2025 6:47pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Mar 12, 2025 6:47pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Mar 12, 2025 6:47pm

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Mar 12, 2025
Copy link
Contributor

github-actions bot commented Mar 12, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-5222 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-5222 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-5222 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-5222 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5222 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5222 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Mar 12, 2025

Uffizzi Ephemeral Environment deployment-61826

☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/5222

📄 View Application Logs etc.

What is Uffizzi? Learn more!

Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.51%. Comparing base (33af709) to head (5506860).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5222   +/-   ##
=======================================
  Coverage   97.51%   97.51%           
=======================================
  Files        1228     1228           
  Lines       42626    42644   +18     
=======================================
+ Hits        41566    41584   +18     
  Misses       1060     1060           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant