Skip to content

Commit 75f4a93

Browse files
authored
Merge pull request #828 from danicheg/merge-series/0.23-into-main
Merge series/0.23 into main
2 parents 1ca0d2d + 7dacae4 commit 75f4a93

File tree

16 files changed

+114
-91
lines changed

16 files changed

+114
-91
lines changed

.github/workflows/ci.yml

Lines changed: 81 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,42 @@ on:
1515
tags: [v*]
1616

1717
env:
18-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
19-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
20-
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
21-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
22-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
2318
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2419

20+
21+
concurrency:
22+
group: ${{ github.workflow }} @ ${{ github.ref }}
23+
cancel-in-progress: true
24+
2525
jobs:
2626
build:
2727
name: Build and Test
2828
strategy:
2929
fail-fast: false
3030
matrix:
3131
os: [ubuntu-latest]
32-
scala: [3.3.0, 2.13.11]
32+
scala: [3, 2.13]
3333
java: [temurin@8]
3434
runs-on: ${{ matrix.os }}
35+
timeout-minutes: 60
3536
steps:
3637
- name: Checkout current branch (full)
3738
uses: actions/checkout@v3
3839
with:
3940
fetch-depth: 0
4041

41-
- name: Download Java (temurin@8)
42-
id: download-java-temurin-8
43-
if: matrix.java == 'temurin@8'
44-
uses: typelevel/download-java@v2
45-
with:
46-
distribution: temurin
47-
java-version: 8
48-
4942
- name: Setup Java (temurin@8)
43+
id: setup-java-temurin-8
5044
if: matrix.java == 'temurin@8'
5145
uses: actions/setup-java@v3
5246
with:
53-
distribution: jdkfile
47+
distribution: temurin
5448
java-version: 8
55-
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
49+
cache: sbt
5650

57-
- name: Cache sbt
58-
uses: actions/cache@v3
59-
with:
60-
path: |
61-
~/.sbt
62-
~/.ivy2/cache
63-
~/.coursier/cache/v1
64-
~/.cache/coursier/v1
65-
~/AppData/Local/Coursier/Cache/v1
66-
~/Library/Caches/Coursier/v1
67-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
51+
- name: sbt update
52+
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
53+
run: sbt +update
6854

6955
- name: Check that workflows are up to date
7056
run: sbt githubWorkflowCheck
@@ -88,7 +74,7 @@ jobs:
8874
run: sbt '++ ${{ matrix.scala }}' '${{ matrix.ci }}' javafmtCheckAll
8975

9076
- name: Check scalafix lints
91-
if: matrix.java == 'temurin@8' && !startsWith(matrix.scala, '3.')
77+
if: matrix.java == 'temurin@8' && !startsWith(matrix.scala, '3')
9278
run: sbt '++ ${{ matrix.scala }}' 'scalafixAll --check'
9379

9480
- name: Check unused compile dependencies
@@ -97,11 +83,11 @@ jobs:
9783

9884
- name: Make target directories
9985
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
100-
run: mkdir -p blaze-client/target target blaze-server/target examples/target http/target core/target blaze-core/target testkit/target project/target
86+
run: mkdir -p blaze-client/target blaze-server/target http/target core/target blaze-core/target project/target
10187

10288
- name: Compress target directories
10389
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
104-
run: tar cf targets.tar blaze-client/target target blaze-server/target examples/target http/target core/target blaze-core/target testkit/target project/target
90+
run: tar cf targets.tar blaze-client/target blaze-server/target http/target core/target blaze-core/target project/target
10591

10692
- name: Upload target directories
10793
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
@@ -125,78 +111,115 @@ jobs:
125111
with:
126112
fetch-depth: 0
127113

128-
- name: Download Java (temurin@8)
129-
id: download-java-temurin-8
130-
if: matrix.java == 'temurin@8'
131-
uses: typelevel/download-java@v2
132-
with:
133-
distribution: temurin
134-
java-version: 8
135-
136114
- name: Setup Java (temurin@8)
115+
id: setup-java-temurin-8
137116
if: matrix.java == 'temurin@8'
138117
uses: actions/setup-java@v3
139118
with:
140-
distribution: jdkfile
119+
distribution: temurin
141120
java-version: 8
142-
jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }}
121+
cache: sbt
143122

144-
- name: Cache sbt
145-
uses: actions/cache@v3
146-
with:
147-
path: |
148-
~/.sbt
149-
~/.ivy2/cache
150-
~/.coursier/cache/v1
151-
~/.cache/coursier/v1
152-
~/AppData/Local/Coursier/Cache/v1
153-
~/Library/Caches/Coursier/v1
154-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
155-
156-
- name: Download target directories (3.3.0)
123+
- name: sbt update
124+
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
125+
run: sbt +update
126+
127+
- name: Download target directories (3)
157128
uses: actions/download-artifact@v3
158129
with:
159-
name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.0
130+
name: target-${{ matrix.os }}-${{ matrix.java }}-3
160131

161-
- name: Inflate target directories (3.3.0)
132+
- name: Inflate target directories (3)
162133
run: |
163134
tar xf targets.tar
164135
rm targets.tar
165136
166-
- name: Download target directories (2.13.11)
137+
- name: Download target directories (2.13)
167138
uses: actions/download-artifact@v3
168139
with:
169-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11
140+
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13
170141

171-
- name: Inflate target directories (2.13.11)
142+
- name: Inflate target directories (2.13)
172143
run: |
173144
tar xf targets.tar
174145
rm targets.tar
175146
176147
- name: Import signing key
177148
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == ''
149+
env:
150+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
151+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
178152
run: echo $PGP_SECRET | base64 -di | gpg --import
179153

180154
- name: Import signing key and strip passphrase
181155
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
156+
env:
157+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
158+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
182159
run: |
183160
echo "$PGP_SECRET" | base64 -di > /tmp/signing-key.gpg
184161
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
185162
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
186163
187164
- name: Publish
165+
env:
166+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
167+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
168+
SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }}
188169
run: sbt tlCiRelease
189170

171+
dependency-submission:
172+
name: Submit Dependencies
173+
if: github.event_name != 'pull_request'
174+
strategy:
175+
matrix:
176+
os: [ubuntu-latest]
177+
java: [temurin@8]
178+
runs-on: ${{ matrix.os }}
179+
steps:
180+
- name: Checkout current branch (full)
181+
uses: actions/checkout@v3
182+
with:
183+
fetch-depth: 0
184+
185+
- name: Setup Java (temurin@8)
186+
id: setup-java-temurin-8
187+
if: matrix.java == 'temurin@8'
188+
uses: actions/setup-java@v3
189+
with:
190+
distribution: temurin
191+
java-version: 8
192+
cache: sbt
193+
194+
- name: sbt update
195+
if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false'
196+
run: sbt +update
197+
198+
- name: Submit Dependencies
199+
uses: scalacenter/sbt-dependency-submission@v2
200+
with:
201+
modules-ignore: blaze_3 blaze_2.13 blaze-examples_3 blaze-examples_2.13 sbt-http4s-org-scalafix-internal_3 sbt-http4s-org-scalafix-internal_2.13 blaze-testkit_3 blaze-testkit_2.13
202+
configs-ignore: test scala-tool scala-doc-tool test-internal
203+
190204
validate-steward:
191205
name: Validate Steward Config
192206
strategy:
193207
matrix:
194208
os: [ubuntu-latest]
209+
java: [temurin@11]
195210
runs-on: ${{ matrix.os }}
196211
steps:
197212
- name: Checkout current branch (fast)
198213
uses: actions/checkout@v3
199214

215+
- name: Setup Java (temurin@11)
216+
id: setup-java-temurin-11
217+
if: matrix.java == 'temurin@11'
218+
uses: actions/setup-java@v3
219+
with:
220+
distribution: temurin
221+
java-version: 11
222+
200223
- uses: coursier/setup-action@v1
201224
with:
202225
apps: scala-steward

blaze-client/src/main/scala/org/http4s/blaze/client/BlazeClient.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ object BlazeClient {
6262
dispatcher,
6363
)
6464
if (retries > 0)
65-
Retry(retryPolicy(retries))(base)
65+
Retry(retryPolicy[F](retries))(base)
6666
else
6767
base
6868
}

blaze-client/src/test/scala-2.13/org/http4s/client/blaze/BlazeClient213Suite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class BlazeClient213Suite extends BlazeClientBase {
9797
}
9898

9999
val allRequests = for {
100-
_ <- failedRequests.handleErrorWith(_ => IO.unit).replicateA(5)
100+
_ <- failedRequests.recoverWith(_ => IO.pure(List.empty[String])).replicateA(5)
101101
r <- successfulRequests
102102
} yield r
103103

@@ -134,7 +134,7 @@ class BlazeClient213Suite extends BlazeClientBase {
134134
}.parSequence
135135

136136
val allRequests = for {
137-
_ <- failedRequests.handleErrorWith(_ => IO.unit).replicateA(5)
137+
_ <- failedRequests.recoverWith(_ => IO.pure(List.empty[String])).replicateA(5)
138138
r <- successRequests
139139
} yield r
140140

blaze-client/src/test/scala/org/http4s/blaze/client/Http1ClientStageSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class Http1ClientStageSuite extends CatsEffectSuite with DispatcherIOFixture {
160160

161161
dispatcher.test("Submit a request line with a query".flaky) { dispatcher =>
162162
val uri = "/huh?foo=bar"
163-
val Right(parsed) = Uri.fromString("http://www.foo.test" + uri)
163+
val Right(parsed) = Uri.fromString("http://www.foo.test" + uri): @unchecked
164164
val req = Request[IO](uri = parsed)
165165

166166
getSubmission(req, resp, dispatcher).map { case (request, response) =>

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Dependencies._
22

33
val Scala213 = "2.13.11"
4-
val Scala3 = "3.3.0"
4+
val Scala3 = "3.3.1"
55
val http4sVersion = "1.0.0-M40"
66
val munitCatsEffectVersion = "2.0.0-M3"
77

@@ -11,7 +11,7 @@ ThisBuild / resolvers +=
1111
ThisBuild / crossScalaVersions := Seq(Scala3, Scala213)
1212
ThisBuild / scalaVersion := crossScalaVersions.value.filter(_.startsWith("2.")).last
1313
ThisBuild / tlBaseVersion := "1.0"
14-
ThisBuild / tlFatalWarningsInCi := !tlIsScala3.value // See SSLStage
14+
ThisBuild / tlFatalWarnings := !tlIsScala3.value // See SSLStage
1515

1616
// 11 and 17 blocked by https://github.com/http4s/blaze/issues/376
1717
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"))
@@ -145,7 +145,7 @@ lazy val examples = Project("blaze-examples", file("examples"))
145145
libraryDependencies ++= Seq(
146146
"org.http4s" %% "http4s-dsl" % http4sVersion,
147147
"org.http4s" %% "http4s-circe" % http4sVersion,
148-
"io.circe" %% "circe-generic" % "0.14.5",
148+
"io.circe" %% "circe-generic" % "0.14.6",
149149
),
150150
Test / scalafixConfig := Some(file(".scalafix.test.conf")),
151151
)

core/src/main/scala/org/http4s/blaze/util/BufferTools.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ object BufferTools {
4848
def joinBuffers(buffers: collection.Seq[ByteBuffer]): ByteBuffer =
4949
buffers match {
5050
case Seq() => emptyBuffer
51-
case Seq(b) => b
51+
case Seq(b: ByteBuffer) => b
5252
case _ =>
5353
val sz = buffers.foldLeft(0)((sz, o) => sz + o.remaining())
5454
val b = allocate(sz)

examples/src/main/scala/com/example/http4s/ExampleService.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class ExampleService[F[_]](implicit F: Async[F]) extends Http4sDsl[F] {
112112
case None => BadRequest("Invalid data: " + data)
113113
}
114114
}
115-
.handleErrorWith { // We can handle errors using effect methods
115+
.recoverWith { // We can handle errors using effect methods
116116
case e: NumberFormatException => BadRequest("Not an int: " + e.getMessage)
117117
}
118118

examples/src/main/scala/com/example/http4s/blaze/demo/server/Module.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class Module[F[_]: Async: Compression: Files: LoggerFactory](client: Client[F])
4343
private val gitHubService = new GitHubService[F](client)
4444

4545
def middleware: HttpMiddleware[F] = { (routes: HttpRoutes[F]) =>
46-
GZip(routes)
47-
}.compose(routes => AutoSlash(routes))
46+
AutoSlash(GZip(routes))
47+
}
4848

4949
val fileHttpEndpoint: HttpRoutes[F] =
5050
new FileHttpEndpoint[F](fileService).service

http/src/main/scala/org/http4s/blaze/http/http2/ConnectionImpl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private final class ConnectionImpl(
6666
private[this] var currentState: Connection.State = Connection.Running
6767
private[this] var sentGoAway = false
6868

69-
override val serialExecutor = new SerialExecutionContext(parentExecutor) {
69+
override val serialExecutor: SerialExecutionContext = new SerialExecutionContext(parentExecutor) {
7070
override def reportFailure(cause: Throwable): Unit =
7171
invokeShutdownWithError(Some(cause), "SerialExecutor")
7272
}
@@ -75,7 +75,7 @@ private final class ConnectionImpl(
7575
new FrameEncoder(remoteSettings, new HeaderEncoder(remoteSettings.maxHeaderListSize))
7676

7777
override val idManager: StreamIdManager = StreamIdManager(isClient)
78-
override val writeController =
78+
override val writeController: WriteControllerImpl =
7979
new WriteControllerImpl(this, 64 * 1024, tailStage)
8080
override val pingManager: PingManager = new PingManager(this)
8181
override val sessionFlowControl: SessionFlowControl =

http/src/main/scala/org/http4s/blaze/http/http2/FlowStrategy.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ object FlowStrategy {
6464
}
6565

6666
/** Representation of the flow window increments to send to the remote peer */
67-
final case class Increment private (session: Int, stream: Int)
67+
final case class Increment private[FlowStrategy] (session: Int, stream: Int)
6868

6969
// Cached version for avoiding allocations in the common case
7070

0 commit comments

Comments
 (0)