You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Ji-Xinyou (via GitHub)" <gi...@apache.org> on 2023/05/03 09:04:42 UTC

[GitHub] [incubator-opendal] Ji-Xinyou opened a new pull request, #2200: fix(services/supabase): Supabase ci fix

Ji-Xinyou opened a new pull request, #2200:
URL: https://github.com/apache/incubator-opendal/pull/2200

   * Fix supabase ci
   * Add read_with_range capabilities to all kv adapters and all services that support this.
   * Skip tests that require range read for those do not support


-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > which means the body is empty, and the content-length is zero
   
   I believe it's bug, supabase storage should:
   
   - Either, Return an json with metadata in body for `GET /object/info`
   - Or, use `HEAD /object/info` to return metadata which can have correct content length.
     - Maybe conflict with `HEAD /object`
   



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > AFAIK, supabase always return error 400 on all failures, and the actual status_code is in the body...
   
   Ohhhh😅



-- 
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] Ji-Xinyou commented on a diff in pull request #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > I didn't get it. If status code is OK, the response is not object metadata?
   
   I think the object info is actually returned in the body, but I cannot find the schema in its documentation. And I think the metadata we need in stat is what we get using head.



-- 
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] Ji-Xinyou commented on a diff in pull request #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > I didn't get it. If status code is OK, the response is not object metadata?
   
   If we use `supabase_get_object_info()`, the content_length in the header of the response will not be the file size. But this behavior is required when we use `stat`.



-- 
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 pull request #2200: fix(services/supabase): Supabase ci fix

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

   I created a discord thread at supabase too: https://discord.com/channels/839993398554656828/1006358244786196510/threads/1103495051658674246


-- 
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] Ji-Xinyou commented on a diff in pull request #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > I didn't get it. If status code is OK, the response is not object metadata?
   
   If we use `supabase_get_object_info()`, the content_length in the header of the response will not be the file size (actually the response has nothing to do with the file size). But this behavior is required when we use `stat`.



-- 
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 pull request #2200: fix(services/supabase): Supabase ci fix

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

   Others LGTM!


-- 
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] Ji-Xinyou commented on a diff in pull request #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > I believe it's bug, supabase storage should:
   
   I agree, the current storage RESTful API seems not being carefully designed.



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   Ok, we don't need to call `supabase_get_object_info` for error response, just transform error from http status code is enough. We will contact with supabase team for better solutions.
   
   ---
   
   storage-api has a special `head` render for this: https://github.com/supabase/storage-api/blob/1794d04ab0e7259d9058293e257f442015252ec3/src/storage/renderer/head.ts#L6-L23
   
   More like a bug...



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   Hi, here is a misunderstanding. `stat`'s implementation is nothing related to HEAD request nor Content Length header. Please take gcs's stat as a reference.



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > but I cannot find the schema in its documentation.
   
   I believe it's another new issue😂. For now, we can parse it from the real output.



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > which means the body is empty, and the content-length is zero
   
   I believe it's bug, supabase storage should:
   
   - Either, Return an json with metadata in body for `GET /object/info`
   - Or, use `HEAD /object/info` to return metadata which can have correct content length.
     - Maybe conflict with `HEAD /object`
   
   Current API design makes `GET /object/info` useless.



-- 
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] Ji-Xinyou commented on a diff in pull request #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   The reason here is that the supabase stores their actual response in the body.
   For example, if status_core is 404, it is in the body, not in the header (which is really weird....).
   
   Hence here if we want to get the metadata like filesize, we have to use `HEAD`. And if any error returns, we send another HTTP request to `/object/info` to actually get the error.



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   I didn't get it. If status code is OK, the response is not object metadata?



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   supabase, It's not easy to say I love you...



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore
+        // we first try the get the metadata through head, if we fail,
+        // we then use get_object_info to get the actual error info
+        let mut resp = self.core.supabase_head_object(path).await?;
 
-        let status = resp.status();
-
-        match status {
+        match resp.status() {
             StatusCode::OK => parse_into_metadata(path, resp.headers()).map(RpStat::new),
-            StatusCode::NOT_FOUND if path.ends_with('/') => {
-                Ok(RpStat::new(Metadata::new(EntryMode::DIR)))
+            _ => {
+                resp = self.core.supabase_get_object_info(path).await?;

Review Comment:
   Ok, I got it. You need to parse the json returned by this API instead just parse headers.



-- 
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] Ji-Xinyou commented on a diff in pull request #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > I didn't get it. If status code is OK, the response is not object metadata?
   
   I think the object info is actually returned in the body, but I cannot find the schema in its documentation.



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   Ok, we don't need to call `supabase_get_object_info` for error response, just transform error from http status code is enough. We will contact with supabase team for better solutions.



-- 
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] Ji-Xinyou commented on a diff in pull request #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > Ok, we don't need to call `supabase_get_object_info` for error response, just transform error from http status code is enough. We will contact with supabase team for better solutions.
   > 
   > storage-api has a special `head` render for this: https://github.com/supabase/storage-api/blob/1794d04ab0e7259d9058293e257f442015252ec3/src/storage/renderer/head.ts#L6-L23
   > 
   > More like a bug...
   
   AFAIK, supabase always return error 400 on all failures, and the actual status_code is in the body...
   Like this
   ```text
   Parts { status: 400, version: HTTP/1.1, headers: {"content-type": "application/json; charset=utf-8", "content-length": "69", "connection": "keep-alive", "date": "Wed, 03 May 2023 16:45:27 GMT", "access-control-allow-origin": "*", "x-kong-upstream-latency": "41", "x-kong-proxy-latency": "5", "via": "kong/2.8.1"} }
   
   b"{\"statusCode\":\"404\",\"error\":\"not_found\",\"message\":\"Object not found\"}"
   ```



-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   Why? object should contain the metadata of size.



-- 
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] Ji-Xinyou commented on a diff in pull request #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   > I believe it's another new issue😂. For now, we can parse it from the real output.
   
   Another weird thing. I tried to print the body and get a handmade schema. Here is the code I used.
   ```Rust
           let resp = self.core.supabase_get_object_info(path).await?;
   
           let (header, body) = resp.into_parts();
           println!("{:?}", &header);
           println!("{:?}", &body.bytes().await?);
   ```
   
   This is what is printed
   ```text
   Parts { status: 200, version: HTTP/1.1, headers: {"content-type": "application/octet-stream", 
   "content-length": "0", "connection": "keep-alive", "accept-ranges": "bytes", 
   "etag": "\"d7f191a1a4e3395eb8cd372561486268\"", "last-modified": "Wed, 03 May 2023 13:44:46 GMT", 
   "cache-control": "no-cache", "date": "Wed, 03 May 2023 13:44:46 GMT", 
   "access-control-allow-origin": "*", "x-kong-upstream-latency": "30", 
   "x-kong-proxy-latency": "0", "via": "kong/2.8.1"} }
   b""
   ```
   
   which means the body is empty, and the content-length is zero 🤣 . Seems there are no workarounds other than doing what is done in the 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] Xuanwo commented on pull request #2200: fix(services/supabase): Supabase ci fix

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

   Hi, @Ji-Xinyou, I found `GET /object/info/authenticated/<bucket>/*` always returned resousne not found even the file do exist:
   
   ```shell
   ) curl  -H "authorization: Bearer <TOKEN>" https://<project>.supabase.co/storage/v1/object/info/authenticated/<bucket>/abc 
   {"statusCode":"404","error":"Not found","message":"The resource was not found"}
   ```
   
   


-- 
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 #2200: fix(services/supabase): Supabase ci fix

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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore

Review Comment:
   Can you help report this use case to supabase too? Thanks.



-- 
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