Add export to sqlite feature#154
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #154 +/- ##
==========================================
+ Coverage 93.16% 93.32% +0.16%
==========================================
Files 24 25 +1
Lines 1244 1274 +30
==========================================
+ Hits 1159 1189 +30
+ Misses 58 57 -1
- Partials 27 28 +1
Continue to review full report at Codecov.
|
marceloboeira
approved these changes
Aug 31, 2018
Member
marceloboeira
left a comment
There was a problem hiding this comment.
Looks good code-wise. (Even though a lot changed 👍 )
Just curious, whats the motivation around this?
28c1c77 to
f20b66d
Compare
zhouzhuojie
commented
Aug 31, 2018
|
|
||
| // GracefulCleanupTimeout - the timeout after graceful shutdown. It's useful to mitigate Kubernetes | ||
| // rolling update race condition. | ||
| GracefulCleanupTimeout time.Duration `env:"FLAGR_GRACEFUL_CLEANUP_TIMEOUT" envDefault:"2s"` |
Collaborator
Author
There was a problem hiding this comment.
not needed as the latest go-swagger supports graceful shutdown
| func setupLogrus() { | ||
| l, err := logrus.ParseLevel(Config.LogrusLevel) | ||
| if err != nil { | ||
| logrus.WithField("err", err).Fatalf("failed to set logrus level:%s", Config.LogrusLevel) |
Collaborator
Author
There was a problem hiding this comment.
respect the env setting for log level
| ) | ||
|
|
||
| var getDB = repo.GetDB | ||
| var getDB = entity.GetDB |
rstratton
reviewed
Aug 31, 2018
| 200: | ||
| description: > | ||
| Export sqlite3 format of the db dump, which is converted from the | ||
| from the main database. |
rstratton
reviewed
Aug 31, 2018
| '200': | ||
| description: > | ||
| Export sqlite3 format of the db dump, which is converted from the | ||
| from the main database. |
rstratton
approved these changes
Aug 31, 2018
ziru
approved these changes
Aug 31, 2018
f20b66d to
382769a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
repotohandlerpackageexport/sqliteendpoint for exporting the whole databaseMotivation and Context
I want to setup Flagr for environment other than production. For example, the integration testing env, staging env, or just local unit test env. There's no easy way to copy flags from one flagr deploy to another, and we probably don't want to share the Flagr instances, their databases, or reuse the same Flagr polluting data recording.
This PR builds an interface for exporting data to a simple sqlite file, which can be used for other Flagr instances.
I'm also thinking of serialization into some configuration files, like YAML or TOML. For example,
export/yaml, and the files can be checked into code for testing or other environment. It may require some work for (de)serialization.How Has This Been Tested?
Locally. Unit tests coming soon.
Types of changes
Checklist: