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: Support passing in replica URLs in JSON format #5199

Closed
wants to merge 6 commits into from

Conversation

rolodato
Copy link
Member

@rolodato rolodato commented Mar 7, 2025

When setting REPLICA_DATABASE_URLS or CROSS_REGION_REPLICA_DATABASE_URLS, users need to know if their passwords/URLs contain a comma, and set REPLICA_DATABASE_URLS_DELIMITER accordingly. This is annoying and not always possible, especially in environments where users might not ever have access to the raw database password such as Kubernetes secrets.

Instead of having users that don't know their passwords go through trial and error, we now accept the URLs as a JSON-formatted array and avoid needing to specify a delimiter. The plan is to use this new variable to make it easier to pass arbitrary replica URLs from Helm values.

@rolodato rolodato requested a review from a team as a code owner March 7, 2025 16:33
@rolodato rolodato requested review from gagantrivedi and removed request for a team March 7, 2025 16:33
Copy link

vercel bot commented Mar 7, 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 11, 2025 9:26pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Mar 11, 2025 9:26pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Mar 11, 2025 9:26pm

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

github-actions bot commented Mar 7, 2025

Docker builds report

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

Copy link
Contributor

github-actions bot commented Mar 7, 2025

Uffizzi Preview deployment-61656 was deleted.

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.51%. Comparing base (ba0610e) to head (87f21c7).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5199      +/-   ##
==========================================
+ Coverage   97.50%   97.51%   +0.01%     
==========================================
  Files        1224     1227       +3     
  Lines       42623    42621       -2     
==========================================
+ Hits        41558    41561       +3     
+ Misses       1065     1060       -5     

☔ 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.

)

if REPLICA_DATABASE_URLS_JSON:
Copy link
Member

Choose a reason for hiding this comment

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

nit: REPLICA_DATABASE_URLS_JSON is not JSON but python here.. Maybe we can change it something like:

REPLICA_DATABASE_URLS_JSON = env.str("REPLICA_DATABASE_URLS_JSON")
if REPLICA_DATABASE_URLS_JSON:
  REPLICA_DATABASE_URLS= json.loads(REPLICA_DATABASE_URLS)

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Mar 11, 2025
@rolodato rolodato requested a review from gagantrivedi March 11, 2025 23:04
@rolodato
Copy link
Member Author

Thanks for the review! I'll merge this once I can generate these variables directly from Helm.

@rolodato
Copy link
Member Author

I spent way too much time trying to use this from a Helm chart and decided it's not a feasible approach. I'll open a separate PR with a different method.

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.

2 participants