metaschema-framework / oscal-server

Other
3 stars 2 forks source link

use cli directly instead of making new executor #31

Closed wandmagic closed 2 weeks ago

wandmagic commented 2 weeks ago

Simplify by not using a custom executor. Commands were change to private scoping so they can't be imported directly anymore

wandmagic commented 2 weeks ago

Yeah not sure why but it fails to write to the sarif file

wandmagic commented 2 weeks ago

converting to a draft until i can resolve the test failures

wandmagic commented 2 weeks ago

i found the issue, because i had ERROR level only logging, the execution crashed because it depends on LOG4J for reporting errors

david-waltermire commented 2 weeks ago

This is an incremental step towards providing REST-based capabilities around metaschema-java based operations.

When should we consider a more formal REST API that directly supports these operations without using the CLI? For example, a REST API that directly uses the underlying metaschema-java core, databind, and schemagen APIs?

wandmagic commented 2 weeks ago

This is an incremental step towards providing REST-based capabilities around metaschema-java based operations.

When should we consider a more formal REST API that directly supports these operations without using the CLI? For example, a REST API that directly uses the underlying metaschema-java core, databind, and schemagen APIs?

I believe if we were to expand the scope of the server for generic storage and registration of metaschema models, we would certainly get strong benefit using the api directly, currently there are some drawbacks to taking this approach ie log4j logging must be at info level for cli to work and we must write output to a file and then read it back. However for our current use case of making our constraint test suite run faster, having parity with the cli I think is a benefit. To answer your question directly, when we should use the api directly instead of doing commands? I think when we intend to leverage the service in a way that goes beyond the cli or when we want to tighten performance and code quality so that the server can be embedded in a native application or private cloud.

wandmagic commented 2 weeks ago

https://github.com/metaschema-framework/oscal-server/issues/32 we can track this improvement here and discuss how and when we will approach this improvement