Skip to content

feat: Pick from list of real variations#420

Merged
mike-zorn merged 29 commits into
mainfrom
mikezorn/sc-254693/validate-overrides-against-what-s-in-the
Sep 6, 2024
Merged

feat: Pick from list of real variations#420
mike-zorn merged 29 commits into
mainfrom
mikezorn/sc-254693/validate-overrides-against-what-s-in-the

Conversation

@mike-zorn
Copy link
Copy Markdown

@mike-zorn mike-zorn commented Sep 6, 2024

This adds better UX for multivariate flags. Previously, you just had the ability to edit the raw json values. Now you can pick from the available variations already defined in the LD service or you can create your own "local override". This is implemented by fetching all flags from the flag list API and writing the variations to the sqlite db. The data written to SQLite is then used to serve subsequent requests. I took this approach because it means that the pulled flag state should be in-sync with the available variations and it enables offline work. It does mean that add project & sync project operations take significantly longer in projects with large amounts of flags.

Some other changes are along for the ride because this branch was longer lived than ideal.

  • search bar for flags
  • display source environment
  • dark mode
  • fix patch endpoint so that the side-effect resync causes the observers to fire

Mike Zorn and others added 28 commits August 29, 2024 15:29
It will proxy the request to real launchdarkly, applying the access
token.
It was a bad idea. No auth + prod credz = security nightmares
* Do a whole lot of stuff

* PR feedback
The fetchFlagState is only called from within the Project, so the tests
were extraneous: tests of other public methods already covered the function.
Equivalent to UpdateProject wo/items. This fixed an issue where we
didn't do the same thing when updating vs. syncing
Wanted better cohesion between state declarations and the data fetching.
@mike-zorn mike-zorn requested a review from cdelst September 6, 2024 16:12
}

result, err := s.database.ExecContext(ctx, `
tx, err := s.database.BeginTx(ctx, nil)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sqllite has transactions???

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yeah. SQLite is kinda incredible. It's one of the best tested and widely used pieces of software you'll find.

@mike-zorn mike-zorn merged commit 91e8cbf into main Sep 6, 2024
@mike-zorn mike-zorn deleted the mikezorn/sc-254693/validate-overrides-against-what-s-in-the branch September 6, 2024 16:55
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.

2 participants