You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2023/05/21 20:47:41 UTC

[incubator-pekko-connectors-kafka] branch main updated: some remaining Akka naming issues (#72)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 43ef1c28 some remaining Akka naming issues (#72)
43ef1c28 is described below

commit 43ef1c2809fd916b7ed23239f30b6b651db2c58f
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Sun May 21 21:47:35 2023 +0100

    some remaining Akka naming issues (#72)
    
    * some remaning Akka naming issues
    
    * publish docs nightly
---
 .github/actions/sync-nightlies/action.yml          | 86 ++++++++++++++++++++++
 .github/workflows/publish-nightly.yml              | 25 +++++++
 CONTRIBUTING.md                                    |  2 -
 .../kafka/javadsl/PartitionAssignmentHandler.scala |  2 +-
 .../scaladsl/PartitionAssignmentHandler.scala      |  2 +-
 .../pekko/kafka/testkit/scaladsl/KafkaSpec.scala   |  4 +-
 .../kafka/internal/CommitCollectorStageSpec.scala  |  6 +-
 .../internal/CommittingProducerSinkSpec.scala      |  4 +-
 .../internal/ConsumerResetProtectionSpec.scala     |  4 +-
 9 files changed, 122 insertions(+), 13 deletions(-)

diff --git a/.github/actions/sync-nightlies/action.yml b/.github/actions/sync-nightlies/action.yml
new file mode 100644
index 00000000..6a8deff5
--- /dev/null
+++ b/.github/actions/sync-nightlies/action.yml
@@ -0,0 +1,86 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Based on Apache Arrow's sync-nightlies action
+# https://github.com/apache/arrow/blob/master/.github/actions/sync-nightlies/action.yml
+name: 'Sync Nightlies'
+description: 'Sync files to and from nightlies.apache.org'
+inputs:
+  upload:
+    description: 'Sync from local to remote'
+    default: false
+    required: false
+  switches:
+    description: 'see rsync --help'
+    required: true
+  local_path:
+    description: 'The relative local path within $GITHUB_WORKSPACE'
+    required: true
+  remote_path:
+    description: 'The remote path incl. sub dirs e.g. {{secrets.path}}/arrow/r'
+    required: true
+  remote_host:
+    description: 'The remote host'
+    required: true
+  remote_port:
+    description: 'The remote port'
+    required: false
+    default: 22
+  remote_user:
+    description: 'The remote user'
+    required: true
+  remote_key:
+    description: 'The remote key'
+    required: true
+
+runs:
+  using: "composite"
+  steps:
+    - name: Sync files
+      shell: bash
+      env:
+        SWITCHES: "${{ inputs.switches }}"
+        LOCAL_PATH: "${{ github.workspace }}/${{ inputs.local_path }}"
+
+        SSH_KEY: "${{ inputs.remote_key }}"
+        PORT: "${{ inputs.remote_port }}"
+        USER: "${{ inputs.remote_user }}"
+        HOST: "${{ inputs.remote_host }}"
+        REMOTE_PATH: "${{ inputs.remote_path }}"
+      run: |
+        # Make SSH key available and add remote to known hosts
+        eval "$(ssh-agent)" > /dev/null
+        echo "$SSH_KEY" | tr -d '\r' | ssh-add - >/dev/null
+        mkdir -p .ssh
+        chmod go-rwx .ssh
+        echo "$HOST_KEY" >> .ssh/known_hosts
+        # strict errors
+        set -eu
+        # We have to use a custom RSH to supply the port
+        RSH="ssh -o StrictHostKeyChecking=no -p $PORT"
+        DSN="$USER@$HOST"
+        # It is important to append '/' to the source path otherwise
+        # the entire source dir will be created as a sub dir in the destination
+        if [ "${{ inputs.upload }}" = true ]
+        then
+          SOURCE=$LOCAL_PATH/
+          DEST=$DSN:$REMOTE_PATH
+        else
+          SOURCE=$DSN:$REMOTE_PATH/
+          DEST=$LOCAL_PATH
+        fi
+        rsync $SWITCHES --rsh="$RSH" $SOURCE $DEST
diff --git a/.github/workflows/publish-nightly.yml b/.github/workflows/publish-nightly.yml
index e42a75fe..cccb19e7 100644
--- a/.github/workflows/publish-nightly.yml
+++ b/.github/workflows/publish-nightly.yml
@@ -50,3 +50,28 @@ jobs:
 
       - name: Cache Coursier cache
         uses: coursier/cache-action@v6.4.0
+
+      - name: Build Documentation
+        run: |-
+          sbt docs/paradox unidoc
+        env:
+          JAVA_OPTS: "-verbose:gc -Xmx4g"
+
+      # Create directory structure upfront since rsync does not create intermediate directories otherwise
+      - name: Create nightly directory structure
+        run: |-
+          mkdir -p target/nightly-docs/docs/pekko-connectors-kafka/${{ github.ref_name }}-snapshot/
+          mv docs/target/paradox/site/main/ target/nightly-docs/docs/pekko-connectors-kafka/${{ github.ref_name }}-snapshot/docs
+          mv target/scala-2.13/unidoc target/nightly-docs/docs/pekko-connectors-kafka/${{ github.ref_name }}-snapshot/api
+
+      - name: Upload nightly docs
+        uses: ./.github/actions/sync-nightlies
+        with:
+          upload: true
+          switches: --archive --compress --update --delete --progress --relative
+          local_path: target/nightly-docs/./docs/pekko-connectors-kafka/ # The intermediate dot is to show `--relative` which paths to operate on
+          remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/pekko/
+          remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+          remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+          remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+          remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c1822713..7cd85482 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -111,5 +111,3 @@ git config blame.ignoreRevsFile .git-blame-ignore-revs
 1. [GitHub Actions](https://github.com/apache/incubator-pekko-connectors-kafka/actions) automatically merges the code, builds it, runs the tests and sets Pull Request status accordingly of results in GitHub.
 1. [Scalafmt](http://scalameta.org/scalafmt/) enforces some of the code style rules.
 1. [sbt-header plugin](https://github.com/sbt/sbt-header) manages consistent copyright headers in every source file.
-1. A GitHub bot checks whether you've signed the Lightbend CLA. 
-
diff --git a/core/src/main/scala/org/apache/pekko/kafka/javadsl/PartitionAssignmentHandler.scala b/core/src/main/scala/org/apache/pekko/kafka/javadsl/PartitionAssignmentHandler.scala
index 2ca12d4c..1b18fdd9 100644
--- a/core/src/main/scala/org/apache/pekko/kafka/javadsl/PartitionAssignmentHandler.scala
+++ b/core/src/main/scala/org/apache/pekko/kafka/javadsl/PartitionAssignmentHandler.scala
@@ -21,7 +21,7 @@ import org.apache.kafka.common.TopicPartition
 /**
  * The API is new and may change in further releases.
  *
- * Allows the user to execute user code when Kafka rebalances partitions between consumers, or an Alpakka Kafka consumer is stopped.
+ * Allows the user to execute user code when Kafka rebalances partitions between consumers, or a Pekko Connectors Kafka consumer is stopped.
  * Use with care: These callbacks are called synchronously on the same thread Kafka's `poll()` is called.
  * A warning will be logged if a callback takes longer than the configured `partition-handler-warning`.
  *
diff --git a/core/src/main/scala/org/apache/pekko/kafka/scaladsl/PartitionAssignmentHandler.scala b/core/src/main/scala/org/apache/pekko/kafka/scaladsl/PartitionAssignmentHandler.scala
index 478b0f9b..71188e57 100644
--- a/core/src/main/scala/org/apache/pekko/kafka/scaladsl/PartitionAssignmentHandler.scala
+++ b/core/src/main/scala/org/apache/pekko/kafka/scaladsl/PartitionAssignmentHandler.scala
@@ -21,7 +21,7 @@ import org.apache.kafka.common.TopicPartition
 /**
  * The API is new and may change in further releases.
  *
- * Allows the user to execute user code when Kafka rebalances partitions between consumers, or an Alpakka Kafka consumer is stopped.
+ * Allows the user to execute user code when Kafka rebalances partitions between consumers, or a Pekko Connectors Kafka consumer is stopped.
  * Use with care: These callbacks are called synchronously on the same thread Kafka's `poll()` is called.
  * A warning will be logged if a callback takes longer than the configured `partition-handler-warning`.
  *
diff --git a/testkit/src/main/scala/org/apache/pekko/kafka/testkit/scaladsl/KafkaSpec.scala b/testkit/src/main/scala/org/apache/pekko/kafka/testkit/scaladsl/KafkaSpec.scala
index 255a218c..1159cabb 100644
--- a/testkit/src/main/scala/org/apache/pekko/kafka/testkit/scaladsl/KafkaSpec.scala
+++ b/testkit/src/main/scala/org/apache/pekko/kafka/testkit/scaladsl/KafkaSpec.scala
@@ -53,7 +53,7 @@ abstract class KafkaSpec(_kafkaPort: Int, val zooKeeperPort: Int, actorSystem: A
   val log: Logger = LoggerFactory.getLogger(getClass)
 
   // used by the .log(...) stream operator
-  implicit val adapter: LoggingAdapter = new Slf4jToAkkaLoggingAdapter(log)
+  implicit val adapter: LoggingAdapter = new Slf4jToPekkoLoggingAdapter(log)
 
   implicit val ec: ExecutionContext = system.dispatcher
   implicit val mat: Materializer = SystemMaterializer(system).materializer
@@ -209,7 +209,7 @@ abstract class KafkaSpec(_kafkaPort: Int, val zooKeeperPort: Int, actorSystem: A
 
 }
 
-private[kafka] class Slf4jToAkkaLoggingAdapter(logger: Logger) extends LoggingAdapter {
+private[kafka] class Slf4jToPekkoLoggingAdapter(logger: Logger) extends LoggingAdapter {
   override def isErrorEnabled: Boolean = logger.isErrorEnabled
   override def isWarningEnabled: Boolean = logger.isWarnEnabled
   override def isInfoEnabled: Boolean = logger.isInfoEnabled
diff --git a/tests/src/test/scala/org/apache/pekko/kafka/internal/CommitCollectorStageSpec.scala b/tests/src/test/scala/org/apache/pekko/kafka/internal/CommitCollectorStageSpec.scala
index 0c8a3d66..a6a2d205 100644
--- a/tests/src/test/scala/org/apache/pekko/kafka/internal/CommitCollectorStageSpec.scala
+++ b/tests/src/test/scala/org/apache/pekko/kafka/internal/CommitCollectorStageSpec.scala
@@ -22,7 +22,7 @@ import pekko.event.LoggingAdapter
 import pekko.kafka.ConsumerMessage.{ Committable, CommittableOffset, CommittableOffsetBatch }
 import pekko.kafka.scaladsl.{ Committer, Consumer }
 import pekko.kafka.testkit.ConsumerResultFactory
-import pekko.kafka.testkit.scaladsl.{ ConsumerControlFactory, Slf4jToAkkaLoggingAdapter }
+import pekko.kafka.testkit.scaladsl.{ ConsumerControlFactory, Slf4jToPekkoLoggingAdapter }
 import pekko.kafka.tests.scaladsl.LogCapturing
 import pekko.kafka.{ CommitWhen, CommitterSettings, Repeated }
 import pekko.stream.scaladsl.Keep
@@ -38,7 +38,7 @@ import org.scalatest.wordspec.AnyWordSpecLike
 import org.scalatest.{ AppendedClues, BeforeAndAfterAll }
 import org.slf4j.{ Logger, LoggerFactory }
 
-import scala.concurrent.duration.{ FiniteDuration, _ }
+import scala.concurrent.duration._
 import scala.concurrent.{ ExecutionContext, Future, Promise }
 
 class CommitCollectorStageSpec(_system: ActorSystem)
@@ -60,7 +60,7 @@ class CommitCollectorStageSpec(_system: ActorSystem)
 
   val log: Logger = LoggerFactory.getLogger(getClass)
   // used by the .log(...) stream operator
-  implicit val adapter: LoggingAdapter = new Slf4jToAkkaLoggingAdapter(log)
+  implicit val adapter: LoggingAdapter = new Slf4jToPekkoLoggingAdapter(log)
 
   def this() = this(ActorSystem())
 
diff --git a/tests/src/test/scala/org/apache/pekko/kafka/internal/CommittingProducerSinkSpec.scala b/tests/src/test/scala/org/apache/pekko/kafka/internal/CommittingProducerSinkSpec.scala
index b00801f5..e6f6e6f1 100644
--- a/tests/src/test/scala/org/apache/pekko/kafka/internal/CommittingProducerSinkSpec.scala
+++ b/tests/src/test/scala/org/apache/pekko/kafka/internal/CommittingProducerSinkSpec.scala
@@ -23,7 +23,7 @@ import pekko.kafka.internal.KafkaConsumerActor.Internal
 import pekko.kafka.scaladsl.Consumer.DrainingControl
 import pekko.kafka.scaladsl.Producer
 import pekko.kafka.testkit.ConsumerResultFactory
-import pekko.kafka.testkit.scaladsl.{ ConsumerControlFactory, Slf4jToAkkaLoggingAdapter }
+import pekko.kafka.testkit.scaladsl.{ ConsumerControlFactory, Slf4jToPekkoLoggingAdapter }
 import pekko.kafka.tests.scaladsl.LogCapturing
 import pekko.kafka._
 import pekko.stream.scaladsl.{ Keep, Source }
@@ -65,7 +65,7 @@ class CommittingProducerSinkSpec(_system: ActorSystem)
   val log: Logger = LoggerFactory.getLogger(getClass)
 
   // used by the .log(...) stream operator
-  implicit val adapter: LoggingAdapter = new Slf4jToAkkaLoggingAdapter(log)
+  implicit val adapter: LoggingAdapter = new Slf4jToPekkoLoggingAdapter(log)
 
   implicit val ec: ExecutionContext = _system.dispatcher
 
diff --git a/tests/src/test/scala/org/apache/pekko/kafka/internal/ConsumerResetProtectionSpec.scala b/tests/src/test/scala/org/apache/pekko/kafka/internal/ConsumerResetProtectionSpec.scala
index 37ceaa16..5899bd74 100644
--- a/tests/src/test/scala/org/apache/pekko/kafka/internal/ConsumerResetProtectionSpec.scala
+++ b/tests/src/test/scala/org/apache/pekko/kafka/internal/ConsumerResetProtectionSpec.scala
@@ -19,7 +19,7 @@ import pekko.actor.ActorSystem
 import pekko.event.LoggingAdapter
 import pekko.kafka.OffsetResetProtectionSettings
 import pekko.kafka.internal.KafkaConsumerActor.Internal.Seek
-import pekko.kafka.testkit.scaladsl.Slf4jToAkkaLoggingAdapter
+import pekko.kafka.testkit.scaladsl.Slf4jToPekkoLoggingAdapter
 import pekko.kafka.tests.scaladsl.LogCapturing
 import pekko.testkit.{ ImplicitSender, TestKit }
 import pekko.util.ccompat.JavaConverters._
@@ -42,7 +42,7 @@ class ConsumerResetProtectionSpec
     with LogCapturing {
 
   val log: Logger = LoggerFactory.getLogger(getClass)
-  val adapter: LoggingAdapter = new Slf4jToAkkaLoggingAdapter(log)
+  val adapter: LoggingAdapter = new Slf4jToPekkoLoggingAdapter(log)
 
   override def afterAll(): Unit = shutdown(system)
 


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