-
Notifications
You must be signed in to change notification settings - Fork 7
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
I want a Plugin
root key and schema
#500
I want a Plugin
root key and schema
#500
Conversation
I've come across another place where I think this The specific example comes from the My suggestion would be that we change how we define the |
The plugin scheme needs a field to allow for new schemas and extensions to be defined as well. At least for my use cases, one of the most common needs is to establish a schema to extend existing AaC or create new domain specific model definitions. |
Plugin
key root and schemaPlugin
root key and schema
Clean up, refactor, and fix tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Instead of the helper IO and IO2 modules, can we rename IO -> IO_DEP and IO2-> IO?
python/src/aac/plugins/contributions/contribution_types/definition_validation_contribution.py
Outdated
Show resolved
Hide resolved
python/src/aac/plugins/contributions/contribution_types/primitive_validation_contribution.py
Show resolved
Hide resolved
python/src/aac/plugins/contributions/contribution_types/primitive_validation_contribution.py
Outdated
Show resolved
Hide resolved
Also, since we're already touching these files go ahead and change references from temporary_test_file to TemporaryTestFile.
python/src/aac/plugins/contributions/contribution_types/definition_validation_contribution.py
Outdated
Show resolved
Hide resolved
python/src/aac/plugins/contributions/contribution_types/primitive_validation_contribution.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Only change would be to use enums to select the Temp file mode instead of strings.
…jondavid-black/AaC into 500-i-want-a-plugin-root-key-and-schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
* I want a `Plugin` root key and schema (#500) * Add Plugin and PluginCommand to spec.yaml * Update describe-definition to take a reference * Make ValidationReference and DefinitionReference actual references * Spelling * Improve naming * Add command group schema and update plugin command schema * Add a display name to command groups * Add a display name to commands * Update the gen-plugin architecture definition * Update references.py Clean up, refactor, and fix tests. * Replace hard-coded string values with constants * Update material model plugin definition * Update commandGroup description * Convert version plugin definition * Convert validate plugin definition * Fix goto definition test * Convert gen_design_doc plugin definition * Convert active_context plugin definition * Put common command group definitions in spec.yaml * Convert gen_gherkin_behaviors plugin definition * Convert gen_json plugin definition * Convert gen_protobuf plugin definition * Convert help_dump plugin definition * Convert gen_plant_uml plugin definition * Convert lsp_server plugin definition * Convert plugin_management plugin definition * Convert print_spec plugin definition * Convert rest_api plugin definition * Convert specifications plugin definition * Put descriptions on the same line * Dedup constants that refer to the import root key * Fix gen-protobuf test and minor cleanup * More fixes for gen-gherkin-behaviors * Keep up with spec.yaml changes * Fix reference tests * Update validator plugin definitions * Make plugin definition files consistent * Update definitions for primitive type checking plugin * Update validators Also, make the `when' step of validators read the same. * Update docs * Update plugin names in implementation files * Fix imports * Fix test file names * Fix plugin management plugin tests * Fix gen-design-doc generated output after template engine changes A while ago we made changes to the template engine that made it so that we didn't have to do as much spacing management in templates and this plugin never got updated. * Fix tests failing as a result of plugin name update Now that plugin name doesn't necessarily equal the validation name for validations, we need a way to distinguish between them. * Rename usage of generate-openapi-spec to gen-openapi-spec Update the OpenAPI spec generation command name for consistency with other generation commands. * Update plugin.yaml Update the test plugin file to fully exercise plugin generation features. * Add a few more definition field constants * Update gen-plugin and tests * Fix name * Use updated field * Put test helpers in another package * Specify VALIDATION_NAME for each plugin * Add description for `name' argument * Add the right command dictionary * Update clear_directory * Initial updates to templates to acommodate new plugin format * Updates gen plugin and tests Update test with correct number of plugin files. Move all plugin definition source files to the plugin directory for third-party plugins. * Fix things * Try fixing docstring, again * Updates to the pipeline * Test plugin definition file updates Add the test validation definitions. Use relative file path on definition source value. Switch command from description to helpText. * Ignore D417 warnings in tests/ directory * Update gen-openapi-spec command name * Update validator implementation validation We only need to care about validation implementations that are contributed by active plugins. * Update pipeline * Fix flake8 warnings * Fix command name * Just use constructor for validation contributions * Update validate validator implementation test * Address the comment for TemporaryTestFile * Fix parameters * Fixes to TemporaryTestFile * Update tests.helpers.io package Also, since we're already touching these files go ahead and change references from temporary_test_file to TemporaryTestFile. * Use validator.optional * Apply suggestions from code review * Use an Enum instead of strings for the clean_up option * Remove workaround for missing validator implementations in tests * Promote specifications to core aac language (#559) * initial mods, no testing yet * removed commented out code * Add Plugin and PluginCommand to spec.yaml * Update describe-definition to take a reference * Make ValidationReference and DefinitionReference actual references * Spelling * Improve naming * Add command group schema and update plugin command schema * Add a display name to command groups * Add a display name to commands * Update the gen-plugin architecture definition * Update references.py Clean up, refactor, and fix tests. * Replace hard-coded string values with constants * Update material model plugin definition * Update commandGroup description * Convert version plugin definition * Convert validate plugin definition * Fix goto definition test * Convert gen_design_doc plugin definition * Convert active_context plugin definition * Put common command group definitions in spec.yaml * Convert gen_gherkin_behaviors plugin definition * Convert gen_json plugin definition * Convert gen_protobuf plugin definition * Convert help_dump plugin definition * Convert gen_plant_uml plugin definition * Convert lsp_server plugin definition * Convert plugin_management plugin definition * Convert print_spec plugin definition * Convert rest_api plugin definition * Convert specifications plugin definition * Put descriptions on the same line * Dedup constants that refer to the import root key * Fix gen-protobuf test and minor cleanup * More fixes for gen-gherkin-behaviors * Keep up with spec.yaml changes * Fix reference tests * Update validator plugin definitions * Make plugin definition files consistent * Update definitions for primitive type checking plugin * Update validators Also, make the `when' step of validators read the same. * Update docs * Update plugin names in implementation files * Fix imports * Fix test file names * Fix plugin management plugin tests * Fix gen-design-doc generated output after template engine changes A while ago we made changes to the template engine that made it so that we didn't have to do as much spacing management in templates and this plugin never got updated. * Fix tests failing as a result of plugin name update Now that plugin name doesn't necessarily equal the validation name for validations, we need a way to distinguish between them. * Rename usage of generate-openapi-spec to gen-openapi-spec Update the OpenAPI spec generation command name for consistency with other generation commands. * Update plugin.yaml Update the test plugin file to fully exercise plugin generation features. * Add a few more definition field constants * Update gen-plugin and tests * Fix name * Use updated field * Put test helpers in another package * Specify VALIDATION_NAME for each plugin * Add description for `name' argument * Add the right command dictionary * Update clear_directory * Initial updates to templates to acommodate new plugin format * Updates gen plugin and tests Update test with correct number of plugin files. Move all plugin definition source files to the plugin directory for third-party plugins. * Fix things * Try fixing docstring, again * Updates to the pipeline * Test plugin definition file updates Add the test validation definitions. Use relative file path on definition source value. Switch command from description to helpText. * Ignore D417 warnings in tests/ directory * Update gen-openapi-spec command name * Update validator implementation validation We only need to care about validation implementations that are contributed by active plugins. * Update pipeline * Fix flake8 warnings * Fix command name * Just use constructor for validation contributions * Update validate validator implementation test * Address the comment for TemporaryTestFile * Fix parameters * Fixes to TemporaryTestFile * Update tests.helpers.io package Also, since we're already touching these files go ahead and change references from temporary_test_file to TemporaryTestFile. * Use validator.optional * Apply suggestions from code review * Fix tests after merging * Rename usages of DEFINITION_NAME_SCHEMA to ROOT_KEY_SCHEMA * Remove original test_gen_plugin in favor of test_gen_plugin_impl * Update requirement-related validations * Fix validators * Use an Enum instead of strings for the clean_up option * Remove workaround for missing validator implementations in tests * Fix test failures * Simplify * Clean up --------- Co-authored-by: Cameron Chaparro <cameron.chaparro@zadentech.com> Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com> * Make the import keyword a file wide declaration (#612) * Update import root key in spec * Update parser tests Fix constant names and use the file name constants to define imports. * Update gen_plugin tests * Fix goto definition test * Update parser handling of imports * Update document link provider * Fix the document link provider test * Formatting * Make sure we handle multiple import definitions per file My intuition tells me this would be an antipattern but I think we should handle that using a linting validator, rather than throwing an error. * Update imports in models * Make sure we provide imports list as a field * Minor doc updates * Add comments to documentation about imports * Update docs * Update spec.yaml with a definition structure for imports * Update import references in definition files * Update imports to use the new files field * Update docstring * Update README.md * 615 remove the material plugin (#616) * removed material plugin * remove unit test and sample model * disabled test that relied on material plugin model * Removed skip test annotation and got the test working. --------- Co-authored-by: Alex Monnet <alexcmonnet@gmail.com> * AaC Style Guide (#613) * Added user documentation on the AaC DSL Style Guide Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com> * Update Core Spec to adhere to the Style Guide (#619) * Updated the Core Spec to adhere to the AaC Style Guide * Updated example models to adhere to the AaC Style Guide * Updated first-party plugins to adhere to the AaC Style Guide Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com> * Version bump * Update Extension test * Removed duplication spec consant * Update dupe spec reference * Removed unused constant * Update gen puml yaml to use commands * Readded nixed file docstring * Moved genjson to commands * Added parser error handling in line with the YAML error handling. * Fixed parser import --------- Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com> Co-authored-by: Cameron Chaparro <cameron.chaparro@zadentech.com> Co-authored-by: Jondavid Black <36022341+jondavid-black@users.noreply.github.com>
As a plugin developer, I want a dedicated root key and schema for defining plugins, so that I have a clearer and more explicit definition of what my plugin does.
AC:
Plugin
plugin
with the newPlugin
typeThere is a newPluginContributions
enum which provides a list of enums for each of the plugin contribution types.PluginCommand
that has the following fields:Plugin
has the following fieldsBehavior
entries