Skip to content

Commit

Permalink
Merge branch 'master' into googlestorage
Browse files Browse the repository at this point in the history
  • Loading branch information
jkobejs committed Jun 20, 2019
2 parents 3fb5da0 + f6ab5ba commit 1412c24
Show file tree
Hide file tree
Showing 18 changed files with 265 additions and 523 deletions.
44 changes: 44 additions & 0 deletions .github/autolabeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# configuration for https://github.com/probot/autolabeler

documentation: ["/docs", "/doc-examples"]
dependency-change: "/project/Dependencies.scala"

'p:amqp': ["/amqp"]
'p:avroparquet': ["/avroparquet"]
'p:aws-lambda': ["/awslambda"]
'p:aws-s3': ["/s3"]
'p:aws-sns': ["/sns"]
'p:aws-sqs': ["/sqs"]
'p:azure-storage-queue': ["/azure-storage-queue"]
'p:cassandra': ["/cassandra"]
'p:csv': ["/csv", "/csv-bench"]
'p:couchbase': ["/couchbase"]
'p:dynamodb': ["/dyamodb"]
'p:elasticsearch': ["/elasticsearch"]
'p:file': ["/file"]
'p:ftp': ["/ftp"]
'p:geode': ["/geode"]
'p:google-cloud-pub-sub': ["/google-cloud-pub-sub"]
'p:google-cloud-pub-sub-grpc': ["/google-cloud-pub-sub-grpc"]
'p:google-fcm': ["/google-fcm"]
'p:hbase': ["/hdfs"]
'p:hdfs': ["/hdfs"]
'p:ironmq': ["/ironmq"]
'p:jms': ["/jms"]
'p:json-streaming': ["/json-streaming"]
'p:kinesis': ["/kinesis"]
'p:kudu': ["/kudu"]
'p:mongodb': ["/mongodb"]
'p:mqtt': ["/mqtt"]
'p:mqtt-streaming': ["/mqtt-streaming", "/mqtt-streaming-bench"]
'p:orientdb': ["/orientdb"]
'p:recordio': ["/simple-codecs"]
'p:reference': ["/reference"]
'p:slick': ["/slick"]
'p:solr': ["/solr"]
'p:spring-web': ["/spring-web"]
'p:sse': ["/sse"]
'p:text': ["/text"]
'p:udp': ["/udp"]
'p:unix-domain-socket': ["/unix-domain-socket"]
'p:xml': ["/xml"]
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
name: "Build code style check (fixed with `sbt scalafmtSbt`)"
- env: CMD="++2.11.12 Test/compile"
name: "Compile all tests (with Scala 2.11)"
- env: CMD="++2.13.0-M5 Test/compile"
- env: CMD="++2.13.0 Test/compile"
name: "Compile all tests (with Scala 2.13)"
- env: CMD="unidoc"
name: "Create all API docs"
- env: CMD="docs/paradox"
name: "Create site with Paradox"
- env: CMD="mimaReportBinaryIssues"
name: "Check binary compatibility"
name: "Check binary compatibility (MiMa)"

- stage: test
env:
Expand Down Expand Up @@ -138,8 +138,8 @@ jobs:
name: "Publish artifacts for Scala 2.11.12"
- env: CMD="++2.12.7 publish"
name: "Publish artifacts for Scala 2.12.7"
- env: CMD="++2.13.0-M5 publish"
name: "Publish artifacts for Scala 2.13.0-M5"
- env: CMD="++2.13.0 publish"
name: "Publish artifacts for Scala 2.13.0"
- script: openssl aes-256-cbc -K $encrypted_bbf1dc4f2a07_key -iv $encrypted_bbf1dc4f2a07_iv -in .travis/travis_alpakka_rsa.enc -out .travis/id_rsa -d && eval "$(ssh-agent -s)" && chmod 600 .travis/id_rsa && ssh-add .travis/id_rsa && sbt -jvm-opts .jvmopts-travis docs/publishRsync
name: "Publish API and reference documentation"

Expand Down
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,32 @@ In case of questions about the contribution process or for discussion of specifi
We've collected a few notes on how we would like Alpakka modules to be designed based on what has evolved so far.
Please have a look at our [contributor advice](contributor-advice.md).


## Binary compatibility (MiMa)

Binary compatibility rules and guarantees are described in depth in the [Binary Compatibility Rules
](https://doc.akka.io/docs/akka/snapshot/common/binary-compatibility-rules.html) section of the Akka documentation.

Akka projects use [MiMa](https://github.com/lightbend/mima) (which originally was called Lightbend Migration Manager) to
validate binary compatibility of incoming pull requests. In the Travis build step "Check binary compatibility", you may see
an error like this:

```
[info] akka-stream: found 1 potential binary incompatibilities while checking against com.typesafe.akka:akka-stream_2.12:2.4.2 (filtered 222)
[error] * method foldAsync(java.lang.Object,scala.Function2)akka.stream.scaladsl.FlowOps in trait akka.stream.scaladsl.FlowOps is present only in current version
[error] filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.stream.scaladsl.FlowOps.foldAsync")
```

In such situations it's good to consult with a core team member if the violation can be safely ignored (by adding the above snippet to `<module>/src/main/mima-filters/<latest-version>.backwards.excludes`), or if it would indeed break binary compatibility.

Situations when it may be fine to ignore a MiMa issued warning include:

- if it is concerning internal classes in package `impl` or `internal`
- add eg. `1.0.x.backwards.excludes` with `ProblemFilters.exclude[Problem]("akka.stream.alpakka.<module>.impl.*")` to ignore all internal changes
- if it is touching anything marked as `@InternalApi`

The binary compatibility of the current changes can be checked by running `mimaReportBinaryIssues` in sbt.

## Pull Request Requirements

For a Pull Request to be considered at all it has to meet these requirements:
Expand Down
10 changes: 7 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Releasing

Create a new issue from the [Alpakka Release Train Issue Template](docs/release-train-issue-template.md) and follow the steps.
Use this command to create a release issue of [Alpakka Release Train Issue Template](docs/release-train-issue-template.md) and follow the steps.

```bash
~/alpakka> scripts/create-release-issue.sh `version-to-be-released`
```

### Releasing only updated docs

Expand All @@ -9,8 +13,8 @@ It is possible to release a revised documentation to the already existing releas
1. Create a new branch from a release tag. If a revised documentation is for the `v0.3` release, then the name of the new branch should be `docs/v0.3`.
1. Add and commit `version.sbt` file that pins the version to the one, that is being revised. Also set `isSnapshot` to `false` for the stable documentation links. For example:
```scala
version in ThisBuild := "0.3"
isSnapshot in ThisBuild := false
ThisBuild / version := "1.0.4"
ThisBuild / isSnapshot := false
```
1. Make all of the required changes to the documentation.
1. Build documentation locally with `CI` settings:
Expand Down
49 changes: 28 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ lazy val ftp = alpakkaProject(
fork in Test := true,
// To avoid potential blocking in machines with low entropy (default is `/dev/random`)
javaOptions in Test += "-Djava.security.egd=file:/dev/./urandom",
crossScalaVersions -= Dependencies.Scala213
crossScalaVersions -= Dependencies.Scala213 // https://github.com/akka/alpakka/issues/1532
)

lazy val geode =
Expand All @@ -156,7 +156,8 @@ lazy val googleCloudPubSub = alpakkaProject(
fork in Test := true,
envVars in Test := Map("PUBSUB_EMULATOR_HOST" -> "localhost:8538"),
// For mockito https://github.com/akka/alpakka/issues/390
parallelExecution in Test := false
parallelExecution in Test := false,
crossScalaVersions -= Dependencies.Scala213 // requires upgrade of jwt-core to 3.0.1
)

lazy val googleCloudPubSubGrpc = alpakkaProject(
Expand All @@ -170,28 +171,36 @@ lazy val googleCloudPubSubGrpc = alpakkaProject(
// for the ExampleApp in the tests
connectInput in run := true,
Compile / compile / scalacOptions += "-P:silencer:pathFilters=src_managed",
crossScalaVersions --= Seq(Dependencies.Scala211, Dependencies.Scala213)
crossScalaVersions --= Seq(Dependencies.Scala211, Dependencies.Scala213) // https://github.com/akka/akka-grpc/pull/599
).enablePlugins(AkkaGrpcPlugin, JavaAgent)

lazy val googleFcm = alpakkaProject(
"google-fcm",
"google.firebase.fcm",
Dependencies.GoogleFcm,
fork in Test := true
fork in Test := true,
crossScalaVersions -= Dependencies.Scala213 // requires upgrade of jwt-core to 3.0.1
)

lazy val googleCloudStorage =
alpakkaProject("google-cloud-storage", "google.cloud.storage", Dependencies.GoogleStorage).disablePlugins(MimaPlugin)

lazy val hbase = alpakkaProject("hbase", "hbase", Dependencies.HBase, fork in Test := true)

lazy val hdfs = alpakkaProject("hdfs", "hdfs", Dependencies.Hdfs, parallelExecution in Test := false)
lazy val hdfs = alpakkaProject("hdfs",
"hdfs",
Dependencies.Hdfs,
parallelExecution in Test := false,
crossScalaVersions -= Dependencies.Scala213 // Requires upgrade of cats-core
)

lazy val ironmq = alpakkaProject("ironmq",
"ironmq",
Dependencies.IronMq,
fork in Test := true,
crossScalaVersions -= Dependencies.Scala213)
lazy val ironmq = alpakkaProject(
"ironmq",
"ironmq",
Dependencies.IronMq,
fork in Test := true,
crossScalaVersions -= Dependencies.Scala213 // https://github.com/hseeberger/akka-http-json/issues/253
)

lazy val jms = alpakkaProject("jms", "jms", Dependencies.Jms, parallelExecution in Test := false)

Expand All @@ -206,7 +215,11 @@ lazy val kinesis = alpakkaProject("kinesis",
lazy val kudu = alpakkaProject("kudu", "kudu", Dependencies.Kudu, fork in Test := false)

lazy val mongodb =
alpakkaProject("mongodb", "mongodb", Dependencies.MongoDb, crossScalaVersions -= Dependencies.Scala213)
alpakkaProject("mongodb",
"mongodb",
Dependencies.MongoDb,
crossScalaVersions -= Dependencies.Scala213 // https://jira.mongodb.org/browse/SCALA-506
)

lazy val mqtt = alpakkaProject("mqtt", "mqtt", Dependencies.Mqtt)

Expand Down Expand Up @@ -237,7 +250,7 @@ lazy val springWeb = alpakkaProject("spring-web", "spring.web", Dependencies.Spr

lazy val simpleCodecs = alpakkaProject("simple-codecs", "simplecodecs")

lazy val slick = alpakkaProject("slick", "slick", Dependencies.Slick, crossScalaVersions -= Dependencies.Scala213)
lazy val slick = alpakkaProject("slick", "slick", Dependencies.Slick)

lazy val sns = alpakkaProject(
"sns",
Expand Down Expand Up @@ -280,12 +293,12 @@ lazy val docs = project
whitesourceIgnore := true,
makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value,
previewPath := (Paradox / siteSubdirName).value,
Preprocess / siteSubdirName := s"api/alpakka/${if (isSnapshot.value) "snapshot" else version.value}",
Preprocess / siteSubdirName := s"api/alpakka/${projectInfoVersion.value}",
Preprocess / sourceDirectory := (LocalRootProject / ScalaUnidoc / unidoc / target).value,
Preprocess / preprocessRules := Seq(
("\\.java\\.scala".r, _ => ".java")
),
Paradox / siteSubdirName := s"docs/alpakka/${if (isSnapshot.value) "snapshot" else version.value}",
Paradox / siteSubdirName := s"docs/alpakka/${projectInfoVersion.value}",
paradoxProperties ++= Map(
"akka.version" -> Dependencies.AkkaVersion,
"akka-http.version" -> Dependencies.AkkaHttpVersion,
Expand Down Expand Up @@ -318,13 +331,7 @@ lazy val docs = project
"javadoc.org.eclipse.paho.client.mqttv3.base_url" -> "https://www.eclipse.org/paho/files/javadoc/",
"javadoc.org.bson.codecs.configuration.base_url" -> "https://mongodb.github.io/mongo-java-driver/3.7/javadoc/",
"scaladoc.scala.base_url" -> s"https://www.scala-lang.org/api/${scalaBinaryVersion.value}.x/",
"scaladoc.akka.stream.alpakka.base_url" -> {
val docsHost = sys.env
.get("CI")
.map(_ => "https://doc.akka.io")
.getOrElse(s"http://localhost:${(previewSite / previewFixedPort).value.getOrElse(4000)}")
s"$docsHost/api/alpakka/${if (isSnapshot.value) "snapshot" else version.value}/"
}
"scaladoc.akka.stream.alpakka.base_url" -> s"/${(Preprocess / siteSubdirName).value}/"
),
paradoxGroups := Map("Language" -> Seq("Java", "Scala")),
resolvers += Resolver.jcenterRepo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ final private[couchbase] class CouchbaseSessionImpl(asyncBucket: AsyncBucket, cl
insertDoc(document, writeSettings)

def insertDoc[T <: Document[_]](document: T, writeSettings: CouchbaseWriteSettings): Future[T] =
singleObservableToFuture(
asyncBucket.insert(document, writeSettings.persistTo, writeSettings.timeout.toMillis, TimeUnit.MILLISECONDS),
document
)
singleObservableToFuture(asyncBucket.insert(document,
writeSettings.persistTo,
writeSettings.replicateTo,
writeSettings.timeout.toMillis,
TimeUnit.MILLISECONDS),
document)

def get(id: String): Future[Option[JsonDocument]] =
zeroOrOneObservableToFuture(asyncBucket.get(id))
Expand Down
Loading

0 comments on commit 1412c24

Please sign in to comment.