-
Notifications
You must be signed in to change notification settings - Fork 38
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
Make ApiDefinition concept generic #342
Merged
Merged
Conversation
This file contains 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
vigoo
reviewed
Apr 2, 2024
pub template: TemplateId, | ||
pub detail: String, | ||
} | ||
// #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Object)] |
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.
Delete if not needed anymore
vigoo
approved these changes
Apr 2, 2024
Merged
afsalthaj
added a commit
that referenced
this pull request
Apr 2, 2024
* Update examples * Update more info * Update examples * Update wasm-rpc * Initial version of expr transformation * Remove resolved variables * Constructor * Remove ResolvedVariables * Rename resolved variables from path * Fix spec path variables * Form type annotated value from request * Fix test compilation errors * Cache template met * Add typed value function in worker service * Remove compile time error * Start fixing errors * Fix more errors * Fix all main errors * Fix more errors * Temporarily depend on wasm-rpc * Add tests for type infernce * Add comments * Upgrade to latest wasm rpc * Remove json dependency from type annotated value module * Fix more errors * Fix more test cases with 30 remaining * Handle optional field * Fix more errors * Fix evaluator tests with three remaining errors * Fix all tests in evaluator * Fix type inference and add more tests * Fix all tests in http_request * Fix all parser tests * Fix all tests * Fix clippy * Fix clippy * Remove comments * Add more test for type inference * Fix formatting * Make ApiDefinition concept generic (#342) * Make the concept of ApiDefinition generic * Move validator to generic * make golem worker binding a generic idea * Start moving everything to an expression module * Start introducing more modules * Start compiling * Initial draft of code organisation * Fix errors * Fix errors * Fix errors * Add constraints * Use Has patterns to support generic * Response binding * First compiled version of draft * Optimise imports * Make modules private and use pub for crate * Tighten privacy in every module * Avoid leaking Response mapping outside base module * Move internal logic to internal module * make sure to use mod internal pattern * Refactor oas_worker_bridge * Further maximise private modules * Try to compile golem worker service * Fix errors * Fix all compile time errors * Compile everything * Make sure everything compile * Fix clippy * Remove unused trait * Fix more errors * Fix more errors * Rename * Rearrange further * Reorganise code * Reformat and rename service * Fix clippy * Reformat and clippy for worker-service * Fix formatting * Fix worker service test * Delete commented code * Update yaml file
afsalthaj
added a commit
that referenced
this pull request
Apr 3, 2024
* Update examples * Update more info * Update examples * Update wasm-rpc * Initial version of expr transformation * Remove resolved variables * Constructor * Remove ResolvedVariables * Rename resolved variables from path * Fix spec path variables * Form type annotated value from request * Fix test compilation errors * Cache template met * Add typed value function in worker service * Remove compile time error * Start fixing errors * Fix more errors * Fix all main errors * Fix more errors * Temporarily depend on wasm-rpc * Add tests for type infernce * Add comments * Upgrade to latest wasm rpc * Remove json dependency from type annotated value module * Fix more errors * Fix more test cases with 30 remaining * Handle optional field * Fix more errors * Fix evaluator tests with three remaining errors * Fix all tests in evaluator * Fix type inference and add more tests * Fix all tests in http_request * Fix all parser tests * Fix all tests * Fix clippy * Fix clippy * Remove comments * Add more test for type inference * Make the concept of ApiDefinition generic * Move validator to generic * make golem worker binding a generic idea * Start moving everything to an expression module * Start introducing more modules * Start compiling * Initial draft of code organisation * Fix errors * Fix errors * Fix errors * Add constraints * Use Has patterns to support generic * Response binding * First compiled version of draft * Optimise imports * Make modules private and use pub for crate * Tighten privacy in every module * Avoid leaking Response mapping outside base module * Move internal logic to internal module * make sure to use mod internal pattern * Refactor oas_worker_bridge * Further maximise private modules * Try to compile golem worker service * Fix errors * Fix all compile time errors * Compile everything * Make sure everything compile * Fix clippy * Remove unused trait * Fix more errors * Fix more errors * Rename * Rearrange further * Reorganise code * Reformat and rename service * Fix clippy * Reformat and clippy for worker-service * Fix format * Fix formatting * Make ApiDefinition concept generic (#342) * Make the concept of ApiDefinition generic * Move validator to generic * make golem worker binding a generic idea * Start moving everything to an expression module * Start introducing more modules * Start compiling * Initial draft of code organisation * Fix errors * Fix errors * Fix errors * Add constraints * Use Has patterns to support generic * Response binding * First compiled version of draft * Optimise imports * Make modules private and use pub for crate * Tighten privacy in every module * Avoid leaking Response mapping outside base module * Move internal logic to internal module * make sure to use mod internal pattern * Refactor oas_worker_bridge * Further maximise private modules * Try to compile golem worker service * Fix errors * Fix all compile time errors * Compile everything * Make sure everything compile * Fix clippy * Remove unused trait * Fix more errors * Fix more errors * Rename * Rearrange further * Reorganise code * Reformat and rename service * Fix clippy * Reformat and clippy for worker-service * Fix formatting * Fix worker service test * Delete commented code * Update yaml file * Fix construction * Fix construction * Fix none * Add test for nest construction * Add test for Result * Add test * Reformat code * Use proper pattern match * Use err * Avoid using unsafe index * Rename function name * Rename function name
afsalthaj
added a commit
that referenced
this pull request
Apr 3, 2024
* Update examples * Update more info * Update examples * Update wasm-rpc * Initial version of expr transformation * Remove resolved variables * Constructor * Remove ResolvedVariables * Rename resolved variables from path * Fix spec path variables * Form type annotated value from request * Fix test compilation errors * Cache template met * Add typed value function in worker service * Remove compile time error * Start fixing errors * Fix more errors * Fix all main errors * Fix more errors * Temporarily depend on wasm-rpc * Add tests for type infernce * Add comments * Upgrade to latest wasm rpc * Remove json dependency from type annotated value module * Fix more errors * Fix more test cases with 30 remaining * Handle optional field * Fix more errors * Fix evaluator tests with three remaining errors * Fix all tests in evaluator * Fix type inference and add more tests * Fix all tests in http_request * Fix all parser tests * Fix all tests * Fix clippy * Fix clippy * Remove comments * Add more test for type inference * Make the concept of ApiDefinition generic * Move validator to generic * make golem worker binding a generic idea * Start moving everything to an expression module * Start introducing more modules * Start compiling * Initial draft of code organisation * Fix errors * Fix errors * Fix errors * Add constraints * Use Has patterns to support generic * Response binding * First compiled version of draft * Optimise imports * Make modules private and use pub for crate * Tighten privacy in every module * Avoid leaking Response mapping outside base module * Move internal logic to internal module * make sure to use mod internal pattern * Refactor oas_worker_bridge * Further maximise private modules * Try to compile golem worker service * Fix errors * Fix all compile time errors * Compile everything * Make sure everything compile * Fix clippy * Remove unused trait * Fix more errors * Fix more errors * Rename * Rearrange further * Reorganise code * Reformat and rename service * Fix clippy * Reformat and clippy for worker-service * Fix format * Fix formatting * Make ApiDefinition concept generic (#342) * Make the concept of ApiDefinition generic * Move validator to generic * make golem worker binding a generic idea * Start moving everything to an expression module * Start introducing more modules * Start compiling * Initial draft of code organisation * Fix errors * Fix errors * Fix errors * Add constraints * Use Has patterns to support generic * Response binding * First compiled version of draft * Optimise imports * Make modules private and use pub for crate * Tighten privacy in every module * Avoid leaking Response mapping outside base module * Move internal logic to internal module * make sure to use mod internal pattern * Refactor oas_worker_bridge * Further maximise private modules * Try to compile golem worker service * Fix errors * Fix all compile time errors * Compile everything * Make sure everything compile * Fix clippy * Remove unused trait * Fix more errors * Fix more errors * Rename * Rearrange further * Reorganise code * Reformat and rename service * Fix clippy * Reformat and clippy for worker-service * Fix formatting * Fix worker service test * Delete commented code * Update yaml file * Fix construction * Fix construction * Fix none * Add test for nest construction * Add test for Result * Add test * Reformat code * Use proper pattern match * Use err * Generic response mapping * Fix warnings * Remove todo comment * Fix tests * Fix tests * Reformat code * Upgrade golem-examples * Update open api yaml
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.
Fixes #318
Fixes #280
Make GolemWorkerBinding common to all protocols
Pull out common data types for an ApiDefinition into api_definition module, applicable to all protocols
Make the current resolver generic, where given a requesst (of any protocl) , it can resolve to a GolemWorkerBinding.
Make a new module http, which has specific data model for HttpApiDefinition, input http-request, resolver (for golem worker binding) specific to http request
Make Validation generic
Introduce HasGolemWorkerBinding
Better module organisations and privacy
Avoid leak of details.
ResponseMapping
and how to convert etc was called from worker-service. While this is code-reuse this was never required. Given aWorkerResponse (type-annotated-value)
rest of the details should be contained within golem-worker-service-baseNew Modules in golem-worker-service-base (I am revisiting some of this one last time, after trying to use it from the cloud)
. ├── Cargo.toml └── src ├── api │ ├── common.rs │ ├── custom_http_request_api.rs │ ├── error.rs │ ├── healthcheck.rs │ ├── mod.rs │ └── register_api_definition_api.rs ├── api_definition │ ├── api_common.rs │ ├── http │ │ ├── http_api_definition.rs │ │ ├── http_oas_api_definition.rs │ │ └── mod.rs │ └── mod.rs ├── app_config.rs ├── auth.rs ├── evaluator │ ├── getter.rs │ ├── mod.rs │ └── path.rs ├── expression │ ├── expr.rs │ └── mod.rs ├── http │ ├── http_request.rs │ └── mod.rs ├── lib.rs ├── merge.rs ├── metrics.rs ├── openapi_yaml.rs ├── parser │ ├── expr_parser.rs │ ├── literal_parser.rs │ ├── mod.rs │ ├── path_pattern_parser.rs │ └── place_holder_parser.rs ├── primitive.rs ├── repo │ ├── api_definition_repo.rs │ └── mod.rs ├── service │ ├── api_definition.rs │ ├── api_definition_lookup.rs │ ├── api_definition_validator.rs │ ├── http │ │ ├── http_api_definition_validator.rs │ │ └── mod.rs │ ├── mod.rs │ ├── template │ │ ├── default.rs │ │ ├── error.rs │ │ └── mod.rs │ └── worker │ ├── connect_proxy.rs │ ├── connect_stream.rs │ ├── default.rs │ ├── error.rs │ └── mod.rs ├── tokeniser │ ├── cursor.rs │ ├── mod.rs │ └── tokenizer.rs ├── worker_binding │ ├── golem_worker_binding.rs │ ├── mod.rs │ └── worker_binding_resolver.rs └── worker_bridge_execution ├── mod.rs ├── worker_request_executor.rs └── worker_response.rs