You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2022/02/09 19:40:02 UTC

[GitHub] [incubator-teaclave] qinkunbao opened a new pull request #620: [Services] add disable function

qinkunbao opened a new pull request #620:
URL: https://github.com/apache/incubator-teaclave/pull/620


   ## Description
   This PR adds a new feature called `disable function`. It allows function owners to disable a function by specifying a function id. After that, data owners cannot create a new task with this function id.
   
   
   
   ## Type of change (select or add applied and delete the others)
   
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] API change with a documentation update
   - [ ] Additional test coverage
   - [ ] Code cleanup or just sync with upstream third-party crates
   
   ## How has this been tested?
   
   ## Checklist
   
   - [x] Fork the repo and create your branch from `master`.
   - [ ] If you've added code that should be tested, add tests.
   - [] If you've changed APIs, update the documentation.
   - [] Ensure the tests pass (see CI results).
   - [x] Make sure your code lints/format.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun merged pull request #620: [Services] add disable function

Posted by GitBox <gi...@apache.org>.
mssun merged pull request #620:
URL: https://github.com/apache/incubator-teaclave/pull/620


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] qinkunbao commented on a change in pull request #620: [Services] add disable function

Posted by GitBox <gi...@apache.org>.
qinkunbao commented on a change in pull request #620:
URL: https://github.com/apache/incubator-teaclave/pull/620#discussion_r803190537



##########
File path: tests/functional/enclave/src/management_service.rs
##########
@@ -188,6 +188,29 @@ fn test_delete_function() {
     assert!(response.is_ok());
 }
 
+#[test_case]
+fn test_disable_function() {
+    let function_input = FunctionInput::new("input", "input_desc", false);
+    let function_output = FunctionOutput::new("output", "output_desc", false);
+    let request = RegisterFunctionRequestBuilder::new()
+        .name("mock_function")
+        .executor_type(ExecutorType::Python)
+        .payload(b"def entrypoint:\n\treturn".to_vec())
+        .public(true)
+        .arguments(vec!["arg"])
+        .inputs(vec![function_input])
+        .outputs(vec![function_output])
+        .build();
+
+    let mut client = authorized_client("mock_user");
+    let response = client.register_function(request);
+    let function_id = response.unwrap().function_id;
+
+    let request = DisableFunctionRequest::new(function_id);
+    let response = client.disable_function(request);
+    assert!(response.is_ok());

Review comment:
       https://github.com/apache/incubator-teaclave/issues/621
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun commented on a change in pull request #620: [Services] add disable function

Posted by GitBox <gi...@apache.org>.
mssun commented on a change in pull request #620:
URL: https://github.com/apache/incubator-teaclave/pull/620#discussion_r803159680



##########
File path: tests/functional/enclave/src/management_service.rs
##########
@@ -188,6 +188,29 @@ fn test_delete_function() {
     assert!(response.is_ok());
 }
 
+#[test_case]
+fn test_disable_function() {
+    let function_input = FunctionInput::new("input", "input_desc", false);
+    let function_output = FunctionOutput::new("output", "output_desc", false);
+    let request = RegisterFunctionRequestBuilder::new()
+        .name("mock_function")
+        .executor_type(ExecutorType::Python)
+        .payload(b"def entrypoint:\n\treturn".to_vec())
+        .public(true)
+        .arguments(vec!["arg"])
+        .inputs(vec![function_input])
+        .outputs(vec![function_output])
+        .build();
+
+    let mut client = authorized_client("mock_user");
+    let response = client.register_function(request);
+    let function_id = response.unwrap().function_id;
+
+    let request = DisableFunctionRequest::new(function_id);
+    let response = client.disable_function(request);
+    assert!(response.is_ok());

Review comment:
       Can you test and assert the response of `get_function` and `create_task` etc.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org