Skip to content

Commit

Permalink
Merge commit '27c540c253487d3d11457dd9de51768c593470f1'
Browse files Browse the repository at this point in the history
  • Loading branch information
CSL committed Nov 16, 2017
2 parents e124df8 + 27c540c commit cd3d2e7
Show file tree
Hide file tree
Showing 68 changed files with 356 additions and 144 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ before_cache:

scala:
- 2.11.11
- 2.12.1
- 2.12.4

jdk:
- oraclejdk8
Expand Down
31 changes: 29 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ All notable changes to this project will be documented in this file. Note that `

### Closed

## [finatra-17.11.0](https://github.com/twitter/finatra/tree/finatra-17.11.0) (2017-11-15)

### Added

### Changed

* EmbeddedTwitterServer, EmbeddedHttpServer, and EmbeddedThriftServer flags
and args parameters changed to call-by-name. ``PHAB_ID=`D104733`

### Fixed

* inject-server: Ensure EmbeddedTwitterServer has started before trying to
close httpAdminClient. ``PHAB_ID=D111294``

### Closed

## [finatra-17.10.0](https://github.com/twitter/finatra/tree/finatra-17.10.0) (2017-10-26)

### Added
Expand All @@ -31,10 +47,14 @@ All notable changes to this project will be documented in this file. Note that `
that use the @Named binding annotation. ``PHAB_ID=D91330``

* finatra-http: Allow setting the content type of a Mustache view.
``PHAB_ID=D91857``
``PHAB_ID=D91949``

### Changed

* finatra-http: Move `FileResolver` to finatra/utils. ``PHAB_ID=D103536``

* finatra-utils: Move `ResponseUtils` to finatra/http. ``PHAB_ID=D103507``

* From now on, release versions will be based on release date in the format of
YY.MM.x where x is a patch number. ``PHAB_ID=D101244``

Expand Down Expand Up @@ -64,6 +84,13 @@ All notable changes to this project will be documented in this file. Note that `

### Fixed

* finatra-http: Parameterized route callback inputs fail because the lookup of a
corresponding `MessageBodyManager` reader lookup does not properly handle parameterized
types such as collections. This change updates the `MessageBodyManager` `MessageBodyReader`
lookup to take into account parameterized types. This allows for a user to parse a
`Seq[T]`, or `Map[K, V]` as a route callback input type using the default Finatra
`MessageBodyReader`. ``PHAB_ID=D104277``

* finatra-jackson: Fix issue causing `IllegalArgumentException` from Validations to
be swallowed. A catch clause in the `c.t.finatra.json.internal.caseclass.jackson.FinatraCaseClassDeserializer`
is too broad as it catches thrown `IllegalArgumentException`s from field validations
Expand Down Expand Up @@ -151,7 +178,7 @@ All notable changes to this project will be documented in this file. Note that `
### Fixed

* finatra-http: Correctly return a JsonParseException when the incoming JSON is not parsable
as an expected custom case class request object. ``RB_ID=``
as an expected custom case class request object. ``RB_ID=912529``

* finatra-http: Ensure underlying members are injected for AbstractControllers. ``RB_ID=911635``

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/src/test/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ junit_tests(
'finatra/inject/inject-core/src/test/scala:test-deps',
'finatra/inject/inject-request-scope/src/main/scala',
'finatra/jackson/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-core/src/main/scala',
'util/util-slf4j-api/src/main/scala',
'util/util-stats/src/main/scala',
Expand Down
12 changes: 6 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import scoverage.ScoverageKeys
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)

// All Twitter library releases are date versioned as YY.MM.patch
val releaseVersion = "17.10.0"
val releaseVersion = "17.11.0"

lazy val buildSettings = Seq(
version := releaseVersion,
scalaVersion := "2.12.1",
crossScalaVersions := Seq("2.11.11", "2.12.1"),
ivyScala := ivyScala.value.map(_.copy(overrideScalaVersion = true)),
scalaVersion := "2.12.4",
crossScalaVersions := Seq("2.11.11", "2.12.4"),
scalaModuleInfo := scalaModuleInfo.value.map(_.withOverrideScalaVersion(true)),
fork in Test := true,
javaOptions in Test ++= travisTestJavaOptions
)
Expand Down Expand Up @@ -160,7 +160,7 @@ lazy val publishSettings = Seq(
resourceGenerators in Compile += Def.task {
val dir = (resourceManaged in Compile).value
val file = dir / "com" / "twitter" / name.value / "build.properties"
val buildRev = Process("git" :: "rev-parse" :: "HEAD" :: Nil).!!.trim
val buildRev = scala.sys.process.Process("git" :: "rev-parse" :: "HEAD" :: Nil).!!.trim
val buildName = new java.text.SimpleDateFormat("yyyyMMdd-HHmmss").format(new java.util.Date)
val contents = s"name=${name.value}\nversion=${version.value}\nbuild_revision=$buildRev\nbuild_name=$buildName"
IO.write(file, contents)
Expand Down Expand Up @@ -530,7 +530,7 @@ lazy val utils = project
previous.filter(mappingContainsAnyPath(_, utilsTestJarSources))
}
).dependsOn(
injectApp % "test->test",
injectApp % "test->test;compile->compile",
injectCore % "test->test",
injectServer % "test->test",
injectUtils)
Expand Down
12 changes: 7 additions & 5 deletions doc/src/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ To continue getting started, please see the `Finatra User's Guide <user-guide/in
Useful Links
------------

- `User's Guide <user-guide/index.html>`__
- `Scaladocs <https://twitter.github.io/finatra/scaladocs/index.html>`__
- `Finagle Blog <http://finagle.github.io/blog/>`__
- `Presentations <presentations/index.html>`__
- `Forum <https://groups.google.com/forum/#!forum/finatra-users>`__
.. toctree::

user-guide/index
Scaladocs <https://twitter.github.io/finatra/scaladocs/index.html>
Finagle Blog <https://finagle.github.io/blog/>
presentations/index
Forum <https://groups.google.com/forum/#!forum/finatra-users>

Contributing
------------
Expand Down
2 changes: 2 additions & 0 deletions doc/src/sphinx/presentations/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _presentations:

Finatra Presentations
=====================

Expand Down
4 changes: 1 addition & 3 deletions doc/src/sphinx/user-guide/logging/logback.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ Examples

See the
`logback.xml <https://github.com/twitter/finatra/blob/develop/examples/hello-world/src/main/resources/logback.xml>`__
and
`logback-test.xml <https://github.com/twitter/finatra/blob/develop/examples/hello-world/src/test/resources/logback-test.xml>`__
configuration files in the
configuration file in the
`hello-world <https://github.com/twitter/finatra/tree/develop/examples/hello-world>`__
example project for example Logback configurations.

Expand Down
2 changes: 1 addition & 1 deletion examples/benchmark-server/src/main/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ scala_library(
'finatra/inject/inject-core/src/main/scala',
'finatra/inject/inject-server/src/main/scala',
'finatra/inject/inject-slf4j/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala:scala',
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-world/src/main/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ scala_library(
'finatra/inject/inject-core/src/main/scala',
'finatra/inject/inject-server/src/main/scala',
'finatra/inject/inject-slf4j/src/main/scala:scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala:scala',
Expand Down
2 changes: 1 addition & 1 deletion examples/java-http-server/src/main/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ java_library(
'finatra/inject/inject-slf4j/src/main/scala',
'finatra/inject/inject-utils/src/main/scala',
'finatra/utils/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala',
Expand Down
2 changes: 1 addition & 1 deletion examples/java-http-server/src/test/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ junit_tests(
'finatra/inject/inject-server/src/main/scala',
'finatra/inject/inject-server/src/test/scala:test-deps',
'finatra/inject/inject-slf4j/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-logging/src/main/scala',
Expand Down
2 changes: 1 addition & 1 deletion examples/java-server/src/main/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ java_library(
'finatra/inject/inject-server/src/main/scala',
'finatra/inject/inject-slf4j/src/main/scala',
'finatra/inject/inject-utils/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala',
Expand Down
2 changes: 1 addition & 1 deletion examples/java-server/src/test/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ junit_tests(
'finatra/inject/inject-server/src/main/scala',
'finatra/inject/inject-server/src/test/scala:test-deps',
'finatra/inject/inject-slf4j/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-logging/src/main/scala',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
java_library(
dependencies=[
'3rdparty/jvm/com/fasterxml/jackson:jackson-annotations',
'3rdparty/jvm/com/google/inject:guice',
'3rdparty/jvm/javax/inject:javax.inject',
'3rdparty/jvm/org/apache/thrift:libthrift-0.5.0',
Expand All @@ -16,7 +15,7 @@ java_library(
'finatra/inject/inject-slf4j/src/main/scala',
'finatra/inject/inject-utils/src/main/scala',
'finatra/thrift/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ junit_tests(
'finatra/inject/inject-slf4j/src/main/scala',
'finatra/thrift/src/main/scala',
'finatra/thrift/src/test/scala:test-deps',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-logging/src/main/scala',
Expand Down
2 changes: 1 addition & 1 deletion examples/streaming-example/src/main/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ scala_library(
'finatra/inject/inject-core/src/main/scala',
'finatra/inject/inject-server/src/main/scala',
'finatra/inject/inject-slf4j/src/main/scala:scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala:scala',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ scala_library(
'finatra/thrift/src/main/scala',
'finatra/thrift/src/main/thrift:thrift-scala',
'scrooge/scrooge-core/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala:scala',
Expand Down
2 changes: 1 addition & 1 deletion examples/twitter-clone/src/main/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ scala_library(
'finatra/inject/inject-utils/src/main/scala',
'finatra/jackson/src/main/scala',
'finatra/utils/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala:scala',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package finatra.quickstart.modules

import com.twitter.finatra.httpclient.modules.HttpClientModule
import com.twitter.finatra.utils.ResponseUtils._
import com.twitter.finatra.http.response.ResponseUtils._
import com.twitter.inject.conversions.time._
import com.twitter.inject.utils.RetryPolicyUtils._

Expand Down
2 changes: 1 addition & 1 deletion examples/web-dashboard/src/main/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ scala_library(
'finatra/inject/inject-slf4j/src/main/scala:scala',
'finatra/inject/inject-thrift-client/src/main/scala',
'finatra/inject/inject-utils/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-core/src/main/scala',
'util/util-lint/src/main/scala:scala',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ class DashboardController extends Controller {

/**
* An example of how to serve files or an index. If the path param of "*" matches the name/path
* of a file that can be resolved by the [[com.twitter.finatra.http.routing.FileResolver]]
* of a file that can be resolved by the [[com.twitter.finatra.utils.FileResolver]]
* then the file will be returned. Otherwise the file at 'indexPath' (in this case 'index.html')
* will be returned. This is useful for building "single-page" web applications.
*
Expand Down
2 changes: 1 addition & 1 deletion http/src/main/scala/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ scala_library(
'finatra/jackson/src/main/scala',
'finatra/utils/src/main/java',
'finatra/utils/src/main/scala',
'twitter-server/src/main/scala',
'twitter-server/server/src/main/scala',
'util/util-app/src/main/scala',
'util/util-collection/src/main/scala',
'util/util-core/src/main/scala',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import com.twitter.finatra.http.response.{ResponseBuilder, StreamingResponse}
import com.twitter.finatra.json.FinatraObjectMapper
import com.twitter.finatra.json.internal.streaming.JsonStreamParser
import com.twitter.io.Buf
import com.twitter.util.{FuturePool, Promise, Future}
import com.twitter.util.{Future, FuturePool, Promise}
import javax.inject.Inject
import scala.concurrent.{Future => ScalaFuture, ExecutionContext => ScalaExecutionContext}
import scala.util.{Success, Failure}
import scala.concurrent.{ExecutionContext => ScalaExecutionContext, Future => ScalaFuture}
import scala.util.{Failure, Success}

private[http] class CallbackConverter @Inject()(
messageBodyManager: MessageBodyManager,
Expand All @@ -20,8 +20,6 @@ private[http] class CallbackConverter @Inject()(

/* Public */

// Note we use Manifest here as we support Scala 2.10 and reflection is not thread-safe in 2.10 (precluding the use
// of typeTag and/or classTag). See: http://docs.scala-lang.org/overviews/reflection/thread-safety.html
def convertToFutureResponse[RequestType: Manifest, ResponseType: Manifest](
callback: RequestType => ResponseType
): Request => Future[Response] = {
Expand Down
Loading

0 comments on commit cd3d2e7

Please sign in to comment.