Skip to content

Commit

Permalink
Merge commit '6f824b232f475c36034eab560a0b821a72f5af30'
Browse files Browse the repository at this point in the history
  • Loading branch information
CSL committed Feb 4, 2017
2 parents b1be1df + 6f824b2 commit 58f6657
Show file tree
Hide file tree
Showing 418 changed files with 9,482 additions and 5,495 deletions.
22 changes: 21 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# container-based build
sudo: false

language: scala

scala:
Expand All @@ -6,9 +9,26 @@ scala:
env:
- JAVA_OPTS="-Dsbt.log.noformat=true"

# These directories are cached to S3 at the end of the build
cache:
directories:
- $HOME/.ivy2
- $HOME/.sbt/boot/scala-$TRAVIS_SCALA_VERSION
- $HOME/.dodo

before_cache:
# Tricks to avoid unnecessary cache updates
- find $HOME/.ivy2 -name "ivydata-*.properties" -delete
- find $HOME/.sbt -name "*.lock" -delete

jdk:
- oraclejdk8

notifications:
hipchat:
rooms:
secure: UlvjA1u/K7a/ykVt9hfRksqI5coq9k5fFqpeGCcEmqPOyrkOnCLj21xHHB16SzUfwy3pqjVK+B8kWORB9zaNyalHZm6I11Ba1hfmPXWemH/qA972IN/hdAQxnMVhhnWqJPzuoVlW7WAFxwltPTbAwDMzIczmsyMv+rCc2Xffiks=

before_script:
# default $SBT_OPTS is irrelevant to sbt launcher
- unset SBT_OPTS
Expand All @@ -20,4 +40,4 @@ script:
- ./sbt ++$TRAVIS_SCALA_VERSION coverageAggregate

after_success:
- bash <(curl -s https://codecov.io/bash)
- bash <(curl -s https://codecov.io/bash)
71 changes: 70 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Change Log
All notable changes to this project will be documented in this file. Note that ``RB_ID=#`` corresponds to associated message in commits.
All notable changes to this project will be documented in this file. Note that ``RB_ID=#`` and ``DIFF_ID=#`` correspond to associated message in commits.

## [Unreleased]

Expand All @@ -12,6 +12,75 @@ All notable changes to this project will be documented in this file. Note that `

### Closed

## [finatra-2.8.0](https://github.com/twitter/finatra/tree/finatra-2.8.0) (2017-02-03)

### Added

* finatra-http: Add Java support for declaring admin routes. ``RB_ID=906264``

* finatra-http: Add AbstractExceptionMapper for ExceptionMapper usage from Java.
Also update the HttpRouter to allow for registration of AbstractExceptionMappers.
``RB_ID=902995``

* finatra-http: Support for JSON Patch (https://tools.ietf.org/html/rfc6902). Utilities are
located in package `com.twitter.finatra.http.jsonpatch`. ``RB_ID=889152``

* finatra: Created companion trait mixins for Test/FeatureTest/IntegrationTest/HttpTest.
``RB_ID=897778``

* finatra-http: Support for optional trailing slashes in HTTP routes. Routes can
now specify that they allow an optional trailing slash by ending the route URI
in the Controller with "/?". ``RB_ID=893167``

* finatra-http: Support for Controller route prefixes. This allows users to define a
common prefix for a set of routes declaratively inside a controller. ``RB_ID=894695``

### Changed

* finatra-http: Allow routes which begin with "/admin" to be exposed on the external
interface and routes which DO NOT begin with "/admin" to be exposed on the admin interface.
NOTE: routes which begin with "/admin/finatra" will continue to be on the admin interface
only. Routes which begin with "/admin" that should be served from the admin interface MUST
set the flag "admin = true" on the route in the Controller. ``RB_ID=905225``

* finatra: Move conversions and retry utilities from finatra/utils to finatra/inject/inject-utils.
``RB_ID=905109``

* finatra: (BREAKING API CHANGE) Rename the existing test helper classes to include
their current opinionated testing style, "WordSpec". These are functionally
equivalent as this is just a name change. We also introduce new versions of the
test helpers which mix in the recommended FunSuite. Thus it will look like your
tests are broken as you will need to update to change to use the new "WordSpec"
classes or changed your testing style to the recommended `FunSuite` style.
``DIFF_ID=D19822``

* inject-core: Remove JUnitRunner from `c.t.inject.Test`. This was only necessary for
internal building with pants and is no longer required. The sbt build uses the
ScalaTest runner and is thus not affected. Additionally, update specs2 to 2.4.17 and
to depend on just the `specs2-mock` dependency where needed. ``DIFF_ID=D18011``

### Fixed

* finatra-http: Fix issue where added admin routes did not have their HTTP method
correctly specified leading to all routes being defaulted to 'GET'. ``RB_ID=905887``

* finatra-http: Fix for custom request case class collection-type fields which are
annotated with either `@RouteParam`, `@QueryParam`, or `@FormParam` to correctly
use a specified default value when a value is not sent in the request. ``RB_ID=903697``

* inject-app: Fix TestInjector to properly parse flags. The TestInjector didn't
properly handle defaulted boolean flags when defined in Modules. Updated the
TestInjector logic to properly parse flags. Fixes [Issue #373](https://github.com/twitter/finatra/issues/373)
``RB_ID=901525``

* finatra: Correctly filter published tests-javadocs and tests-sources jars for
projects. We are incorrectly publishing tests in the sources and javadocs jars
for projects which publish a test-jar dependency (http, httpclient, jackson,
thrift, util, inject-app, inject-core, inject-modules, and inject-server).
``RB_ID=901153``

### Closed

## [finatra-2.7.0](https://github.com/twitter/finatra/tree/finatra-2.7.0) (2016-12-20)

### Added
Expand Down
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Finatra

[![Build Status](https://secure.travis-ci.org/twitter/finatra.png?branch=master)](http://travis-ci.org/twitter/finatra?branch=master)
[![Test Coverage](http://codecov.io/github/twitter/finatra/coverage.svg?branch=master)](http://codecov.io/github/twitter/finatra?branch=master)
[![Build Status](https://secure.travis-ci.org/twitter/finatra.png?branch=master)](https://travis-ci.org/twitter/finatra?branch=master)
[![Test Coverage](https://codecov.io/github/twitter/finatra/coverage.svg?branch=master)](https://codecov.io/github/twitter/finatra?branch=master)
[![Project status](https://img.shields.io/badge/status-active-brightgreen.svg)](#status)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.twitter/finatra-http_2.11/badge.svg)][maven-central]
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/twitter/finatra)
Expand All @@ -13,13 +13,13 @@ and is being actively developed and maintained.

<img src="./finatra_logo_text.png" title="Finatra Logo" alt="Finatra Logo" height=394 width=679/>

Finatra is a lightweight framework for building fast, testable, scala applications on top of [TwitterServer][twitter-server] and [Finagle][finagle]. Finatra provides an easy-to-use API for creating and [testing](http://twitter.github.io/finatra/user-guide/testing/) [Finagle servers](http://twitter.github.io/finagle/guide/Servers.html) and [apps](http://twitter.github.io/util/docs/#com.twitter.app.App) as well as powerful JSON support, modern logging via [SLF4J][slf4j], [Finagle client](http://twitter.github.io/finagle/guide/Clients.html) utilities, and more.
Finatra is a lightweight framework for building fast, testable, scala applications on top of [TwitterServer][twitter-server] and [Finagle][finagle]. Finatra provides an easy-to-use API for creating and [testing](https://twitter.github.io/finatra/user-guide/testing/index.html) [Finagle servers](https://twitter.github.io/finagle/guide/Servers.html) and [apps](https://twitter.github.io/util/docs/#com.twitter.app.App) as well as powerful JSON support, modern logging via [SLF4J][slf4j], [Finagle client](https://twitter.github.io/finagle/guide/Clients.html) utilities, and more.


## Getting involved

* Website: [https://twitter.github.io/finatra/](https://twitter.github.io/finatra/)
* Latest news: [Blog](http://twitter.github.io/finatra/blog/archives/)
* Latest news: [Blog](https://twitter.github.io/finatra/blog/archives/)
* Github Source: [https://github.com/twitter/finatra/](https://github.com/twitter/finatra/)
* Gitter: [https://gitter.im/twitter/finatra](https://gitter.im/twitter/finatra)
* Mailing List: [finatra-users@googlegroups.com](https://groups.google.com/forum/#!forum/finatra-users)
Expand All @@ -31,12 +31,12 @@ Finatra is a lightweight framework for building fast, testable, scala applicatio
* ~50 times faster than v1.6 in several benchmarks.
* Powerful Feature and Integration test support.
* Optional JSR-330 Dependency Injection using [Google Guice][guice].
* [Jackson][jackson]-based JSON parsing supporting required fields, default values, and [validations](http://twitter.github.io/finatra/user-guide/json/#validation-framework).
* [Logback][logback] [MDC][mdc] integration with [com.twitter.util.Local][local] for contextual logging across [futures](http://twitter.github.io/util/guide/util-cookbook/futures.html).
* [Jackson][jackson]-based JSON parsing supporting required fields, default values, and [validations](https://twitter.github.io/finatra/user-guide/json/validations.html).
* [Logback][logback] [MDC][mdc] integration with [com.twitter.util.Local][local] for contextual logging across [futures](https://twitter.github.io/util/guide/util-cookbook/futures.html).

## Documentation

To get started, see the [Getting Started](http://twitter.github.io/finatra/user-guide/getting-started) section of our [User Guide](http://twitter.github.io/finatra/user-guide/) to get up and running. Or check out the sections for building [HTTP](http://twitter.github.io/finatra/user-guide/build-new-http-server/) or [Thrift](http://twitter.github.io/finatra/user-guide/build-new-thrift-server/) servers.
To get started, see the [Getting Started](https://twitter.github.io/finatra/user-guide/getting-started/index.html) section of our [User Guide][user-guide] to get up and running. Or check out the specific sections for building [HTTP](https://twitter.github.io/finatra/user-guide/http/server.html) or [Thrift](https://twitter.github.io/finatra/user-guide/thrift/server.html) servers.

## Examples

Expand Down Expand Up @@ -94,7 +94,7 @@ class ExampleServer extends ThriftServer {

## Example Projects

Finatra includes working examples which highlight various features of the framework and include tests. In the [develop branch](https://github.com/twitter/finatra/tree/develop/examples) these examples are included in the root [sbt](http://www.scala-sbt.org/) build and are thus buildable as part of the entire project. In the [master branch](https://github.com/twitter/finatra/tree/master/examples) (or a [release branch](https://github.com/twitter/finatra/tree/finatra-2.7.0/examples)) these examples can be built using their invididual [sbt](http://www.scala-sbt.org/) (or [Maven](http://maven.apache.org/)) build files.
Finatra includes working examples which highlight various features of the framework and include tests. In the [develop branch](https://github.com/twitter/finatra/tree/develop/examples) these examples are included in the root [sbt][sbt] build and are thus buildable as part of the entire project. In the [master branch](https://github.com/twitter/finatra/tree/master/examples) (or a [release branch](https://github.com/twitter/finatra/tree/finatra-2.8.0/examples)) these examples can be built using their invididual [sbt][sbt] (or [Maven][maven]) build files.

Please take a look through the [examples](/examples) for more detailed information on features, testing, and building with sbt (or Maven).

Expand All @@ -104,7 +104,7 @@ The [master branch](https://github.com/twitter/finatra/tree/master) in Github tr

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.twitter/finatra-http_2.11/badge.svg)][maven-central]

available on Maven Central. See the [basics](http://twitter.github.io/finatra/user-guide/getting-started/#dependencies) section in the [User Guide][user-guide] for how to add dependencies.
available on Maven Central. See the [First Steps](https://twitter.github.io/finatra/user-guide/getting-started/basics.html#first-steps) section in the [User Guide][user-guide] for how to add dependencies.

Releases are done on an approximately monthly schedule. While
[semver](http://semver.org/) is not followed, the
Expand All @@ -119,7 +119,7 @@ For more information on providing contributions, please see our [CONTRIBUTING.md

## Presentations

Check out our list of presentations: [Finatra Presentations](http://twitter.github.io/finatra/presentations/).
Check out our list of presentations: [Finatra Presentations](https://twitter.github.io/finatra/presentations/).

## Authors

Expand All @@ -128,22 +128,24 @@ Check out our list of presentations: [Finatra Presentations](http://twitter.gith

A full list of [contributors](https://github.com/twitter/finatra/graphs/contributors?type=a) can be found on GitHub.

Follow [@finatra](http://twitter.com/finatra) on Twitter for updates.
Follow [@finatra](https://twitter.com/finatra) on Twitter for updates.

## License

Copyright 2013-2016 Twitter, Inc.
Copyright 2013-2017 Twitter, Inc.

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Licensed under the Apache License, Version 2.0: https://www.apache.org/licenses/LICENSE-2.0

[twitter-server]: https://github.com/twitter/twitter-server
[finagle]: https://github.com/twitter/finagle
[util-app]: https://github.com/twitter/util/tree/master/util-app
[guice]: https://github.com/google/guice
[jackson]: https://github.com/FasterXML/jackson
[logback]: http://logback.qos.ch/
[slf4j]: http://www.slf4j.org/manual.html
[logback]: https://logback.qos.ch/
[slf4j]: https://www.slf4j.org/manual.html
[local]: https://github.com/twitter/util/blob/master/util-core/src/main/scala/com/twitter/util/Local.scala
[mdc]: http://logback.qos.ch/manual/mdc.html
[maven-central]: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.twitter%22%20AND%20%28a%3A%22finatra-http_2.11%22%20OR%20a%3A%22finatra-thrift_2.11%22%29
[user-guide]: http://twitter.github.io/finatra/user-guide/
[mdc]: https://logback.qos.ch/manual/mdc.html
[maven]: https://maven.apache.org/
[maven-central]: https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.twitter%22%20AND%20%28a%3A%22finatra-http_2.11%22%20OR%20a%3A%22finatra-thrift_2.11%22%29
[user-guide]: https://twitter.github.io/finatra/user-guide/index.html
[sbt]: http://www.scala-sbt.org/
17 changes: 8 additions & 9 deletions benchmarks/src/test/scala/BUILD
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
junit_tests(
dependencies=[
'3rdparty/jvm/org/openjdk/jmh:jmh-core',
'3rdparty/jvm/com/google/inject:guice',
'3rdparty/jvm/org/slf4j:slf4j-simple',
'finagle/finagle-stats',
'finatra/benchmarks/src/main/java',
'finatra/http',
'finatra/inject/inject-request-scope',
'twitter-server',
'finatra/benchmarks',
'3rdparty/jvm/com/fasterxml/jackson/datatype:jackson-datatype-joda',
'3rdparty/jvm/com/fasterxml/jackson/module:jackson-module-scala',
'3rdparty/jvm/com/github/nscala_time:nscala_time',
'3rdparty/jvm/com/google/inject/extensions:guice-assistedinject',
'3rdparty/jvm/com/google/inject/extensions:guice-multibindings',
'3rdparty/jvm/com/google/inject/extensions:guice-testlib',
'3rdparty/jvm/com/google/inject:guice',
'3rdparty/jvm/joda-time:joda-time',
'3rdparty/jvm/net/codingwell:scala-guice',
'3rdparty/jvm/org/clapper:grizzled-slf4j',
'3rdparty/jvm/org/openjdk/jmh:jmh-core',
'3rdparty/jvm/org/scalatest:scalatest',
'3rdparty/jvm/org/slf4j:slf4j-simple',
'finagle/finagle-core/src/main/scala:scala',
'finagle/finagle-http/src/main/scala:scala',
'finagle/finagle-stats/src/main/scala:scala',
'finatra/benchmarks/src/main/java:java',
'finatra/http/src/main/scala:scala',
'finatra/inject/inject-app/src/test/scala:test-deps',
'finatra/inject/inject-core/src/main/scala:scala',
'finatra/inject/inject-core/src/test/scala:test-deps',
'finatra/inject/inject-request-scope/src/main/scala:scala',
'finatra/jackson/src/main/scala:scala',
'twitter-server/src/main/scala:scala',
'util/util-core/src/main/scala:scala',
'util/util-stats/src/main/scala:scala',
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.twitter.finatra.http.benchmarks

import com.twitter.inject.Test
import com.twitter.inject.WordSpecTest

class ControllerBenchmarkTest extends Test {
class ControllerBenchmarkTest extends WordSpecTest {

val benchmark = new ControllerBenchmark

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class FinagleRequestScopeBenchmark {
val route = Route(
name = "groups",
method = Method.Get,
path = "/groups/",
uri = "/groups/",
admin = false,
index = None,
callback = defaultCallback,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.twitter.finatra.http.benchmarks

import com.twitter.inject.Test
import com.twitter.inject.WordSpecTest

class FinagleRequestScopeBenchmarkTest extends Test {
class FinagleRequestScopeBenchmarkTest extends WordSpecTest {

"test" in {
val benchmark = new FinagleRequestScopeBenchmark()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class RouteBenchmark {
val route = Route(
name = "groups",
method = Method.Post,
path = "/groups/",
uri = "/groups/",
admin = false,
index = None,
callback = defaultCallback,
Expand All @@ -29,7 +29,7 @@ class RouteBenchmark {
val routeWithPathParams = Route(
name = "groups",
method = Method.Post,
path = "/groups/:id",
uri = "/groups/:id",
admin = false,
index = None,
callback = defaultCallback,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.twitter.finatra.http.benchmarks

import com.twitter.inject.Test
import com.twitter.inject.WordSpecTest

class RouteBenchmarkTest extends Test {
class RouteBenchmarkTest extends WordSpecTest {

"test" in {
val benchmark = new RouteBenchmark()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class RoutingServiceBenchmark {
def route(path: String) = Route(
name = path,
method = Method.Get,
path = path,
uri = path,
admin = false,
index = None,
callback = defaultCallback,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.twitter.finatra.http.benchmarks

import com.twitter.inject.Test
import com.twitter.inject.WordSpecTest

class RoutingServiceBenchmarkTest extends Test {
class RoutingServiceBenchmarkTest extends WordSpecTest {

"test" in {
val benchmark = new RoutingServiceBenchmark()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.twitter.finatra.json.benchmarks

import com.twitter.inject.Test
import com.twitter.inject.WordSpecTest

class JsonBenchmarkTest extends Test {
class JsonBenchmarkTest extends WordSpecTest {

"test" in {
val benchmark = new JsonBenchmark()
Expand Down
Loading

0 comments on commit 58f6657

Please sign in to comment.