Skip to content

Conversation

@ajworkos
Copy link
Contributor

@ajworkos ajworkos commented Dec 13, 2025

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

#634

Describe the solution you've provided

Context is in #634, but to restate, we've found that if this environment (we pull from development) is unintentionally modified, it caused our tests to fail as our tests relied on certain flag values. This action at a distance has bitten us a few times to the point where we've committed our binary dev server DB to our repo. This solution is also unsatisfactory because

  1. We can't see diffs
  2. We still can end up with unintended test failures in PRs that have a newly synced DB because flags unrelated to the ones the developer needed may have changed since the last sync (and they can't see the diff)

Provide an import-project command that accepts a file argument, the contents of which is the JSON file exported from the dev server endpoint that shows all overrides and availableVariations - e.g. http://localhost:8765/dev/projects/default?expand=overrides&expand=availableVariations.

ldcli dev-server import --project newProject --file path-to-file.json

This PR also adds --expand arguments to the get-project command so that we can easily dump the file needed for seeding.

Usage:

ldcli dev-server get-project --project originalProject --expand overrides --expand availableVariations > file.json
# and then in CI
ldcli dev-server import-project --project newProject --file file.json

Describe alternatives you've considered

  • Standalone environments dedicated to CI testing (seems rather superfluous)
  • Specifically declaring all flag values (event defaults) in tests. Unmaintainable as new flags are added to code paths covered in existing E2E tests all the time.

Additional context

Add any other context about the pull request here.

@ajworkos ajworkos requested a review from a team as a code owner December 13, 2025 13:54
@ajworkos ajworkos changed the title Seed from file feature: seed from exported file Dec 13, 2025
@ajworkos ajworkos changed the title feature: seed from exported file feat: import project Dec 13, 2025
@nieblara
Copy link

@ajworkos thanks so much for the contribution, it's in our queue to review in the next couple of weeks.

Cheers!

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