You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "suyanhanx (via GitHub)" <gi...@apache.org> on 2023/04/25 14:30:12 UTC

[GitHub] [incubator-opendal] suyanhanx opened a new pull request, #2122: feat(core): add test for stat_with_if_not_match

suyanhanx opened a new pull request, #2122:
URL: https://github.com/apache/incubator-opendal/pull/2122

   close #2091 


-- 
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: commits-unsubscribe@opendal.apache.org

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


[GitHub] [incubator-opendal] suyanhanx commented on a diff in pull request #2122: feat(core): add test for `stat_with_if_none_match`

Posted by "suyanhanx (via GitHub)" <gi...@apache.org>.
suyanhanx commented on code in PR #2122:
URL: https://github.com/apache/incubator-opendal/pull/2122#discussion_r1176754988


##########
core/src/services/gcs/core.rs:
##########
@@ -208,7 +208,12 @@ impl GcsCore {
         }
     }
 
-    pub async fn gcs_get_object_metadata(&self, path: &str) -> Result<Response<IncomingAsyncBody>> {
+    pub async fn gcs_get_object_metadata(
+        &self,
+        path: &str,
+        if_match: Option<&str>,

Review Comment:
   We could have a PR for migrating this situation all at once.



-- 
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: commits-unsubscribe@opendal.apache.org

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


[GitHub] [incubator-opendal] Xuanwo merged pull request #2122: feat(core): add test for `stat_with_if_none_match`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #2122:
URL: https://github.com/apache/incubator-opendal/pull/2122


-- 
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: commits-unsubscribe@opendal.apache.org

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


[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2122: feat(core): add test for `stat_with_if_none_match`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2122:
URL: https://github.com/apache/incubator-opendal/pull/2122#discussion_r1176747290


##########
core/src/services/gcs/core.rs:
##########
@@ -208,7 +208,12 @@ impl GcsCore {
         }
     }
 
-    pub async fn gcs_get_object_metadata(&self, path: &str) -> Result<Response<IncomingAsyncBody>> {
+    pub async fn gcs_get_object_metadata(
+        &self,
+        path: &str,
+        if_match: Option<&str>,

Review Comment:
   I think passing `OpStat` is normal enough, no extra params will needed any more(



-- 
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: commits-unsubscribe@opendal.apache.org

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


[GitHub] [incubator-opendal] suyanhanx commented on a diff in pull request #2122: feat(core): add test for `stat_with_if_none_match`

Posted by "suyanhanx (via GitHub)" <gi...@apache.org>.
suyanhanx commented on code in PR #2122:
URL: https://github.com/apache/incubator-opendal/pull/2122#discussion_r1176742844


##########
core/tests/behavior/read_only.rs:
##########
@@ -122,6 +125,55 @@ pub async fn test_stat_not_exist(op: Operator) -> Result<()> {
     Ok(())
 }
 
+/// Stat with if_match should succeed, else get a ConditionNotMatch error.
+pub async fn test_stat_with_if_match(op: Operator) -> Result<()> {
+    let path = "normal_file";

Review Comment:
   Nice catch.



-- 
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: commits-unsubscribe@opendal.apache.org

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


[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2122: feat(core): add test for `stat_with_if_none_match`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2122:
URL: https://github.com/apache/incubator-opendal/pull/2122#discussion_r1176738007


##########
core/src/services/gcs/core.rs:
##########
@@ -208,7 +208,12 @@ impl GcsCore {
         }
     }
 
-    pub async fn gcs_get_object_metadata(&self, path: &str) -> Result<Response<IncomingAsyncBody>> {
+    pub async fn gcs_get_object_metadata(
+        &self,
+        path: &str,
+        if_match: Option<&str>,

Review Comment:
   Maybe we can pass `args: Option` directly for shore code (could be done in seperate PR)



##########
core/tests/behavior/read_only.rs:
##########
@@ -122,6 +125,55 @@ pub async fn test_stat_not_exist(op: Operator) -> Result<()> {
     Ok(())
 }
 
+/// Stat with if_match should succeed, else get a ConditionNotMatch error.
+pub async fn test_stat_with_if_match(op: Operator) -> Result<()> {
+    let path = "normal_file";

Review Comment:
   Maybe we should check `capability.stat_if_match` first?



-- 
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: commits-unsubscribe@opendal.apache.org

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


[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2122: feat(core): add test for `stat_with_if_none_match`

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #2122:
URL: https://github.com/apache/incubator-opendal/pull/2122#discussion_r1176738007


##########
core/src/services/gcs/core.rs:
##########
@@ -208,7 +208,12 @@ impl GcsCore {
         }
     }
 
-    pub async fn gcs_get_object_metadata(&self, path: &str) -> Result<Response<IncomingAsyncBody>> {
+    pub async fn gcs_get_object_metadata(
+        &self,
+        path: &str,
+        if_match: Option<&str>,

Review Comment:
   Maybe we can pass `args: Option` directly for short code (could be done in seperate PR)



##########
core/src/services/gcs/core.rs:
##########
@@ -208,7 +208,12 @@ impl GcsCore {
         }
     }
 
-    pub async fn gcs_get_object_metadata(&self, path: &str) -> Result<Response<IncomingAsyncBody>> {
+    pub async fn gcs_get_object_metadata(
+        &self,
+        path: &str,
+        if_match: Option<&str>,

Review Comment:
   Maybe we can pass `args: OpStat` directly for short code (could be done in seperate PR)



-- 
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: commits-unsubscribe@opendal.apache.org

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


[GitHub] [incubator-opendal] suyanhanx commented on a diff in pull request #2122: feat(core): add test for `stat_with_if_none_match`

Posted by "suyanhanx (via GitHub)" <gi...@apache.org>.
suyanhanx commented on code in PR #2122:
URL: https://github.com/apache/incubator-opendal/pull/2122#discussion_r1176744344


##########
core/src/services/gcs/core.rs:
##########
@@ -208,7 +208,12 @@ impl GcsCore {
         }
     }
 
-    pub async fn gcs_get_object_metadata(&self, path: &str) -> Result<Response<IncomingAsyncBody>> {
+    pub async fn gcs_get_object_metadata(
+        &self,
+        path: &str,
+        if_match: Option<&str>,

Review Comment:
   We may consider a normal solution for increasing parameters.



-- 
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: commits-unsubscribe@opendal.apache.org

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