You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by md...@apache.org on 2023/01/27 08:16:28 UTC

[incubator-pekko-connectors] branch main updated (47449feb -> 90e23ede)

This is an automated email from the ASF dual-hosted git repository.

mdedetrich pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-connectors.git


    from 47449feb disable fossa check (#21)
     new 07cca5dd Update scalafmt
     new 90e23ede Revert GCS Unmarshaller PartialFunction

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/format.yml                       |  2 +-
 .scalafmt.conf                                     |  2 +-
 .../googlecloud/storage/impl/GCStorageStream.scala | 26 +++++++++-------------
 3 files changed, 13 insertions(+), 17 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org


[incubator-pekko-connectors] 01/02: Update scalafmt

Posted by md...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mdedetrich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-connectors.git

commit 07cca5ddecb5f6f0d113046f9d656993906e2ccc
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Fri Jan 27 07:20:22 2023 +0100

    Update scalafmt
---
 .github/workflows/format.yml | 2 +-
 .scalafmt.conf               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
index 502401a8..9d330b61 100644
--- a/.github/workflows/format.yml
+++ b/.github/workflows/format.yml
@@ -20,5 +20,5 @@ jobs:
       - name: Check project is formatted
         uses: jrouly/scalafmt-native-action@v2
         with:
-          version: '3.6.1'
+          version: '3.7.1'
           arguments: '--list --mode diff-ref=origin/main'
diff --git a/.scalafmt.conf b/.scalafmt.conf
index efa297ee..1aae8a44 100644
--- a/.scalafmt.conf
+++ b/.scalafmt.conf
@@ -1,4 +1,4 @@
-version                                  = 3.6.1
+version                                  = 3.7.1
 runner.dialect                           = scala213
 project.git                              = true
 style                                    = defaultWithAlign


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org


[incubator-pekko-connectors] 02/02: Revert GCS Unmarshaller PartialFunction

Posted by md...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mdedetrich pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-pekko-connectors.git

commit 90e23ede54243eb0b8e5009d6e87446c6b367d9b
Author: Matthew de Detrich <ma...@aiven.io>
AuthorDate: Fri Jan 27 07:21:30 2023 +0100

    Revert GCS Unmarshaller PartialFunction
---
 .../googlecloud/storage/impl/GCStorageStream.scala | 26 +++++++++-------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/google-cloud-storage/src/main/scala/akka/stream/alpakka/googlecloud/storage/impl/GCStorageStream.scala b/google-cloud-storage/src/main/scala/akka/stream/alpakka/googlecloud/storage/impl/GCStorageStream.scala
index 4c412a59..60c18bda 100644
--- a/google-cloud-storage/src/main/scala/akka/stream/alpakka/googlecloud/storage/impl/GCStorageStream.scala
+++ b/google-cloud-storage/src/main/scala/akka/stream/alpakka/googlecloud/storage/impl/GCStorageStream.scala
@@ -146,21 +146,17 @@ import scala.concurrent.Future
           metadata.fold(HttpEntity.Empty)(m => HttpEntity(ContentTypes.`application/json`, m.toJson.toString))
         val request = HttpRequest(POST, uri, headers, entity)
 
-        implicit val um: Unmarshaller[HttpResponse, StorageObject] =
-          Unmarshaller
-            .withMaterializer[HttpResponse, StorageObject] { implicit ec => implicit mat => response =>
-              {
-                val status = response.status
-                val entity = response.entity
-                if (status.isSuccess())
-                  Unmarshal(entity).to[StorageObject]
-                else
-                  Unmarshal(entity).to[String].flatMap[StorageObject] { errorString =>
-                    Future.failed(new RuntimeException(s"Uploading part failed with status $status: $errorString"))
-                  }
-              }
-            }
-            .withDefaultRetry
+        implicit val um: Unmarshaller[HttpResponse, StorageObject] = Unmarshaller.withMaterializer {
+          implicit ec => implicit mat =>
+            {
+              case HttpResponse(status, _, entity, _) if status.isSuccess() =>
+                Unmarshal(entity).to[StorageObject]
+              case HttpResponse(status, _, entity, _) =>
+                Unmarshal(entity).to[String].flatMap { errorString =>
+                  Future.failed(new RuntimeException(s"Uploading part failed with status $status: $errorString"))
+                }
+            }: PartialFunction[HttpResponse, Future[StorageObject]]
+        }.withDefaultRetry
 
         ResumableUpload[StorageObject](request).addAttributes(GoogleAttributes.settings(settings))
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org