lightblue-platform / lightblue-metadata-manager Goto Github PK
View Code? Open in Web Editor NEWA command line tool to manage Lightblue metadata.
A command line tool to manage Lightblue metadata.
Logging metadata changes will help us manage metadata changes across environments without relying on version control. Alternatively, this could be done in Lightblue (might be a better option).
Push metadata update events to metadataChangesLog entity. An event should include date of the change, environment (hostname extracted from metadata url?), previous metadata and new metadata. Once lightblue-platform/lightblue-core#460 is implemented, we can capture who made the change.
It looks like the test is supposed to used embedded lightblue on localhost, but I think it is actually using whatever lightblue the user has configured in LB_CLIENT_DEV configuration.
I started working on a PR to inject a FileSystem to the cli so you could perform this test against an in memory filesystem like jimfs (https://github.com/google/jimfs)
Make the tool understand the order of environments: dev->qa->stage->prod. This will allow a single command promotion to next environment.
lbmd prmote --env stage -e user -v newest
will promote newest user version from stage to prod. Before any changes land, it should print a diff and ask: "Are you sure you want to push those changes in prod? [Y/n]".
Outputting to stdout is more flexible and more standard I think. Easier to work with other tools (like json formatters) and stay agnostic of your current directory.
An option makes sense, though I would default to stdout personally.
# Push both entityInfo and schema
lbmd push --env dev -e user
# Push only schema (new feature)
lbmd push-schema --env dev -e user
# Push only entityInfo (new feature)
lbmd push-entityInfo --env dev -e user
Right now you can push entity one at a time:
lbmd push --env dev -e user
Push in bulk (new feature):
lbmd push --env dev -e "/^user.*/"
will push or locally downloaded entities matching the pattern.
Resulting in lots of false positives. Let's sort them to make the diff more readable.
After promotion, could use diff to check that what was promoted actually landed. This is a manually available step right now, but promotion should fail automatically if diff shows something wasn't promoted.
Currently, the diff functionality allows comparing local metadata against remote metadata. This RFE is to be able to compare metadata in different Lightblue environments.
lbmd diff --env stage -e user -v newest --env2 prod -v2 newest
If -v2 is not given, assume the same as -v.
When you bump entity version, it's easy to miss references in other entities. The tool could do that for you.
Example:
# download all entities
lbmd pull --env dev -e "/.*/"
# set user entity version to 0.0.9 and update all references to user in all downloaded entities
lbmd set-version -e user -v 0.0.9 --includeReferences
For pull, -e should default to $all.
Version -v should always default to newest.
If this tool is to be used for actual releases, it needs some tests. Add lightblue-client-integration-test to the project and create some integration tests, preferably at the MetadataManagerApp level (including argument parsing).
$ lbmd push --env dev2 -e '/redacted(redacted|redacted|redacted|redacted)/' --entityInfoOnly
Exception in thread "main" java.io.FileNotFoundException: /redacted(redacted|redacted|redacted|redacted)/.json (No such file or directory)
But first: lightblue-platform/lightblue-client#333
Describe metadata changes for entire release. Apply multi-entity patch with a single command.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.