-
Notifications
You must be signed in to change notification settings - Fork 17
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
CLI for Bootstrapping Patterns #53
Comments
For the final bullet point - it would be great if the linter could pick up fields that weren't filled in and give the user a list of things to do on the CLI. Also, since Spectral has IDE plugins we could even get this information directly into their editor. We could do this by just filling the blanks with some placeholder like MISSING_VALUE and then just having a spectral rule that looks for any property set to MISSING_VALUE. |
One consideration here is which language we should use for the bootstrap CLI. In my mind we have two main options, Python and Node (i.e. JS or TypeScript.) I've had a think about some pros/cons - would be good to hear people's thoughts PythonPros
Cons
Node / JavaScriptPros
Cons
Other languagesJava:
Go:
|
We've been discussing this in person and I'm in favour of Node. I've already been working on embedding the new Mermaid visualizer tool in a simple Commander CLI just for the purposes of making it usable and found to be very easy to work with (PR for that incoming soon). So if we go that way, the groundwork will already have been done as well. |
I think the only question against Node would be is schema validation tools are week, especially as most of our other tools are currently Node. What do we need to do to close out on the schema validation questions? |
We need to confirm that we can validate JSON schemas against a metaschema with libraries available in Node. |
Golang, negatives I would disagree with? |
Another question is how the CLI is going to fetch pattern files. This relates to #69 - the CLI needs to be able to pull patterns not only from this industry-standard repository but also internal repositories for an organisation. Our suggestion is that we keep this as simple as possible from the pattern CLI's perspective by letting you provide either a HTTP URL (with no auth) or a file reference, and the CLI will load it. In other words, no CLI or similar abstraction for 'looking up' patterns by name yet; we can always add this later if need be. Something like the following:
In future we could add a dictionary of pattern names to file/URL references to the project to allow resolution by a pattern name. This is a separate topic - we can proceed without implement this if people are happy with the above suggestion. |
Would you not want to start by looking up a file and then a future improvement will be sourcing from a URL if it's a feature that is required? |
We've been testing out the AJV JSON Schema library and so far it seems promising. For the basic case of validating a pattern instantiation, it works as expected. The case we're interested in is validating the pattern against the meta schema. We've been able to get this to work by fixing what we believe to be some mistakes in the core.json and api-gateway.json, e.g.
I can raise an issue for the above problems unless anyone thinks we're wrong. Once fixing those issues, we're still running into one problem where all properties on a node are required to have the field |
Raised a discussion here about approach for instantiation to avoid polluting this thread with multiple concurrent discussions: #71 |
Happy for you to go ahead and raise a PR for the changes . . . for the pattern that just shows we didn't update it along with the schema changes and shows we have a gap to close around keeping patterns up to date with manifest changes; this isn't a simple validation because they currently reference specific schema versions and even if we were to move to a 'current' version we would need to merge and publish it before it would be spotted that it broke something. |
Fine with this for a first version, although we should probably raise an issue to track adding a central supported patterns repo as a fairly high priority. |
This issue is complete, specific additions will br tracked in their own issues. |
* #55 initial prototype of the CALM translator service * #55 Additional changes to the prototype translator to tidy up the c4 endpoints * #55 move project to be top level and add a README * #55 Fix to reference to calm schema from chaninging top level project * #55 Add dockerfile to containerize the application * Improvement to code to handle multiple software systems * #86 Update README * #86 Remove supress warnings annotation * Fix translator action * Fix translator action and checkin breaking test to confirm - test wil be removed before merge. * Update TestC4ModelTranslatorShould.java Removing the breaking test now we have proof it failed. * #35 Add manual spectral action (#68) * #35 Add manual spectral validation action * Fix indentation * Modify triggers for job * Validate samples instead of bad document * Change sample again to trigger build * PR feedback * Bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /docs (#78) Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4. - [Release notes](https://github.com/webpack/webpack-dev-middleware/releases) - [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md) - [Commits](webpack/webpack-dev-middleware@v5.3.3...v5.3.4) --- updated-dependencies: - dependency-name: webpack-dev-middleware dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * created core cli (#53) (#80) * #74 - Updating the api-gateway.json pattern to use prefixItems (#79) * #74 - Updating the api-gateway.json pattern to use the prefixItems keyword instead of items as per JSON Schema 2020-12 * Only run spectral validation on json and yaml files. * #74 - Adding placeholder values to api-gateway-implementation.json * Update api-gateway-implementation.json Remove the parties element which was removed form the schema. --------- Co-authored-by: Luigi Bulanti <lui.bulanti99@gmail.com> Co-authored-by: Matthew Bain <66839492+rocketstack-matt@users.noreply.github.com> Co-authored-by: rocketstack-matt <matt@rocketstack.co> * #42 removed old visualizer to make room for the new one (#83) * Fix spectral rules (#81) * #42 included initial visualization command in CLI (#85) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: rocketstack-matt <matt@rocketstack.co> Co-authored-by: Matthew Bain <66839492+rocketstack-matt@users.noreply.github.com> Co-authored-by: Will Osborne <will.osborne@morganstanley.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Aidan McPhelim <aidanmcp@hotmail.co.uk> Co-authored-by: Luigi Bulanti <luigi.bulanti@morganstanley.com> Co-authored-by: Luigi Bulanti <lui.bulanti99@gmail.com> Co-authored-by: jpgough-ms <152306432+jpgough-ms@users.noreply.github.com>
Feature Request
Description of Problem:
Patterns implemented as JSON Schema help to constrain and define reusable architectures. Developers can use tooling to "autocomplete" patterns, as demonstrated at #52 and at our monthly call.
We would like to propose the creation of a simple command line interface CLI that:
The text was updated successfully, but these errors were encountered: