Skip to content

Latest commit

 

History

History
1859 lines (1161 loc) · 83.8 KB

CHANGELOG.md

File metadata and controls

1859 lines (1161 loc) · 83.8 KB

Change Log

All notable changes to this project will be documented in this file. Note that RB_ID=# and PHAB_ID=# correspond to associated message in commits.

[Unreleased]

Added

Changed

Fixed

Closed

finatra-18.7.0 (2018-07-10)

Added

  • inject-utils: Add 'toLoggable' implicit from Array[Byte] to String. PHAB_ID=D182262

Changed

Fixed

  • finatra-http: Fix infinite loop introduced by PHAB D180166. Fix underlying issue of the ResponseBuilder requiring a stored RouteInfo for classifying exceptions for stating. PHAB_ID=D189504

  • finatra-http: Fix FailureExceptionMapper handling of wrapped exceptions. Unwrap cause for all c.t.finagle.Failure exceptions, regardless of flags and add a try-catch to ExceptionManager to remap exceptions thrown by ExceptionMappers PHAB_ID=D180166

Closed

finatra-18.6.0 (2018-06-14)

Added

  • finatra: Add HTTP route, Thrift method, and Filter information to the Library registry. PHAB_ID=D177583

  • finatra-inject/inject-logback: Add an c.t.inject.logback.AsyncAppender to provide metrics about the underlying queue. PHAB_ID=D173278

Changed

  • inject-slf4j: Move the SLF4J API logging bridges from inject-slf4j to inject-app and inject-server. This allows code in the inject framework to be mostly useful in environments where having the bridges on the classpath causes issues. PHAB_ID=D179652

Fixed

  • finatra-http: Fail startup for incorrect Controller callback functions. Controller route callback functions that do not specify an input parameter or specify an incorrect input parameter should fail server startup but were not correctly detected when building routes in the CallbackConverter. The route building logic has been patched to correctly detect these routes which would fail at runtime to ensure we fail fast at server startup (and can thus be caught by StartupTests). PHAB_ID=D178330

  • finatra-http: Change exceptions emitted from c.t.f.http.filter.HttpNackFilter to not extend from HttpException and add a specific mapper over HttpNackException such that Nack exceptions are handled distinctly from HttpExceptions and thus more specifically. Handling of Nack exceptions should not be conflated with handling of the more generic HttpExceptions and it should be clear if a new mapper is desired that it is specifically for changing how Nack exceptions are handled. PHAB_ID=D172456

Closed

finatra-18.5.0 (2018-05-07)

Added

  • examples: Add external TwitterServer example. PHAB_ID=D161204

Changed

  • inject-utils: Remove deprecated c.t.inject.RootMonitor. PHAB_ID=D161036

  • finatra-http: Updated c.t.finatra.http.AdminHttpServer to isolate routes added to the admin. PHAB_ID=D157818

Fixed

  • inject-slf4j, finatra-http: Fix c.t.inject.logging.FinagleMDCAdapter to initialize properly. We were lazily initializing the backing java.util.Map of the FinagleMDCAdapter which could cause values to disappear when the map was not created eagerly enough. Typical usage would add one of the MDC logging filters to the top of the request filter chain which would put a value into the MDC thus creating the backing java.util.Map early in the request chain. However, if a filter which puts to the MDC was not included and the first put happened in a Future closure the map state would be lost upon exiting the closure.

    This change updates how the MDC mapping is stored to move from a Local to a LocalContext and introduces new ergonomics for using/initializing the framework MDC integration.

    Initialization of the MDC integration should now go through the c.t.inject.logging.MDCInitializer (that is users are not expected to need to interact directly with the FinagleMDCAdapter). E.g., to initialize the MDC:

    com.twitter.inject.logging.MDCInitializer.init()
    

    This will initialize the org.slf4j.MDC and swap out the default org.slf4j.spi.MDCAdapter with an instance of the c.t.inject.logging.FinagleMDCAdapter allowing for reading/writing MDC values across Future boundaries.

    Then to start the scoping of an MDC context, use c.t.inject.logging.MDCInitializer#let:

    com.twitter.inject.logging.MDCInitializer.let {
      // operations which set and read MDC values
      ???
    }
    

    Typically, this is done in a Filter wrapping the execution of the service in the Filter's apply, For example, the framework provides this initialization and scoping in both the c.t.finatra.http.filters.LoggingMDCFilter and the c.t.finatra.thrift.filters.LoggingMDCFilter.

    Simply including these at the top of the request filter chain for a service will allow MDC integration to function properly. PHAB_ID=D159536

  • inject-app: Ensure that installed modules are de-duped before creating injector. PHAB_ID=D160955

Closed

finatra-18.4.0 (2018-04-10)

Added

  • finatra-http: Added the ability for requests to have a maximum forward depth to c.t.finatra.http.routing.HttpRouter, which prevents requests from being forwarded an infinite number of times. By default the maximum forward depth is 5. PHAB_ID=D154737

  • inject-thrift-client: Update configureServicePerEndpoint and configureMethodBuilder in ThriftMethodBuilderClientModule to also pass a c.t.inject.Injector instance which allows users to use bound instances from the object graph when providing further thriftmux.MethodBuilder or ThriftMethodBuilderFactory configuration. PHAB_ID=D155451

  • inject-thrift-client: Update configureThriftMuxClient in ThriftClientModuleTrait to also pass a c.t.inject.Injector instance which allows users to use bound instances from the object graph when providing further ThriftMux.client configuration. PHAB_ID=D152973

  • inject-server: Capture errors on close of the underlying TwitterServer. The embedded testing utilities can now capture and report on an exception that occurs during close of the underlying TwitterServer. EmbeddedTwitterServer#assertCleanShutdown inspects for any Throwable captured from closing the underlying server which it will then throw. PHAB_ID=D148946

  • finatra-http: Created a new API into c.t.f.h.response.StreamingResponse which permits passing a transformer which is an AsynStream[T] => AsyncStream[(U, Buf)] for serialization purposes, as well as two callbacks -- onDisconnect, called when the stream is disconnected, and onWrite, which is a respond side-effecting callback to every individual write to the stream. PHAB_ID=D147925

Changed

  • inject-app: Update and improve the test #bind[T] DSL. The testing #bind[T] DSL is lacking in its ability to be used from Java and we would like to revise the API to be more expressive such that it also includes binding from a Type to a Type. Due to wanting to also support the ability to bind a Type to a Type, the DSL has been re-worked to more closely match the actual Guice binding DSL.

    For Scala users the #bind[T] DSL now looks as follows:

      bind[T].to[U <: T]
      bind[T].to[Class[U <: T]]
      bind[T].toInstance(T)
    
      bind[T].annotatedWith[Ann].to[U <: T]
      bind[T].annotatedWith[Ann].to[Class[U <: T]]
      bind[T].annotatedWith[Ann].toInstance(T)
    
      bind[T].annotatedWith[Class[Ann]].to[U <: T]
      bind[T].annotatedWith[Class[Ann]].to[Class[U <: T]]
      bind[T].annotatedWith[Class[Ann]].toInstance(T)
    
      bind[T].annotatedWith(Annotation).to[U <: T]
      bind[T].annotatedWith(Annotation).to[Class[U <: T]]
      bind[T].annotatedWith(Annotation).toInstance(T)
    
      bindClass(Class[T]).to[T]
      bindClass(Class[T]).to[Class[U <: T]]
      bindClass(Class[T]).toInstance(T)
    
      bindClass(Class[T]).annotatedWith[Class[Ann]].to[T]
      bindClass(Class[T]).annotatedWith[Class[Ann]].[Class[U <: T]]
      bindClass(Class[T]).annotatedWith[Class[Ann]].toInstance(T)
    
      bindClass(Class[T]).annotatedWith(Annotation).to[T]
      bindClass(Class[T]).annotatedWith(Annotation).[Class[U <: T]]
      bindClass(Class[T]).annotatedWith(Annotation).toInstance(T)
    

    For Java users, there are more Java-friendly methods:

      bindClass(Class[T], T)
      bindClass(Class[T], Annotation, T)
      bindClass(Class[T], Class[Annotation], T)
    
      bindClass(Class[T], Class[U <: T])
      bindClass(Class[T],  Annotation, Class[U <: T])
      bindClass(Class[T], Class[Annotation], Class[U <: T])
    

    Additionally, these changes highlighted the lack of Java-support in the TwitterModule for creating injectable Flags. Thus c.t.inject.TwitterModuleFlags has been updated to also provide Java-friendly flag creation methods:

      protected def createFlag[T](name: String, default: T, help: String, flggble: Flaggable[T]): Flag[T]
      protected def createMandatoryFlag[T](name: String, help: String, usage: String, flggble: Flaggable[T]): Flag[T]
    

    PHAB_ID=D149252

  • inject-thrift-client: The "retryBudget" in the c.t.inject.thrift.modules.ThriftMethodBuilderClientModule should be a RetryBudget and not the generic Budget configuration Param. Updated the type. PHAB_ID=D151938

  • inject-server: Move HTTP-related concerns out of the embedded testing utilities into specific HTTP "clients". The exposed httpAdminClient in the EmbeddedTwitterServer and the httpClient and httpsClient in the EmbeddedHttpServer are no longer just Finagle Services from Request to Response, but actual objects. The underlying Finagle Service[Request, Response] can be accessed via Client.service. PHAB_ID=D148946

Fixed

Closed

finatra-18.3.0 (2018-03-05)

Added

  • inject-server: Add a lint rule in c.t.inject.server.TwitterServer#warmup. If a server does not override the default implementation of TwitterServer#warmup a lint rule violation will appear on the lint page of the HTTP admin interface. PHAB_ID=D141267

  • inject-server: Add c.t.inject.server.TwitterServer#setup lifecycle callback method. This is run at the end of the postInjectorStartup phase and is primarily intended as a way for servers to start pub-sub components on which the server depends. Users should prefer this method over overriding the c.t.inject.server.TwitterServer#postWarmup @Lifecycle-annotated method as the callback does not require a call its super implementation for the server to correctly start and is ideally less error-prone to use. PHAB_ID=D135827

  • inject-app: Add c.t.inject.annotations.Flags#named for getting an implementation of an @Flag annotation. This is useful when trying to get or bind an instance of an @Flag annotated type. PHAB_ID=D140831

Changed

  • finatra-http: ReaderDiscarded failures writing in c.t.f.http.StreamingResponse now only log at the info level without a stack trace, while other failures log at the error level with a stacktrace. PHAB_ID=D141453

  • inject-thrift-client: Removed withBackupRequestFilter method on deprecated c.t.inject.thrift.filters.ThriftClientFilterChain. Instead of c.t.inject.thrift.modules.FilteredThriftClientModule, use c.t.inject.thrift.modules.ThriftMethodBuilderClientModule and use the idempotent method on c.t.inject.thrift.ThriftMethodBuilder to configure backup requests. PHAB_ID=D142049.

  • inject-app: c.t.inject.annotations.FlagImpl is no longer public and should not be used directly. Use c.t.inject.annotations.Flags#named instead. PHAB_ID=D140831

Fixed

  • inject-thrift-client: Fix for duplicate stack client registration. The c.t.inject.thrift.modules.ThriftMethodBuilderClientModule was incorrectly calling the ThriftMux.client twice. Once to create a MethodBuilder and once to create a ServicePerEndpoint. Now, the ServicePerEndpoint is obtained from the configured MethodBuilder. PHAB_ID=D141304

  • inject-thrift-client: Convert non-camel case ThriftMethod names, e.g., "get_tweets" to camelCase, e.g., "getTweets" for reflection lookup on generated ServicePerEndpoint interface in c.t.inject.thrift.ThriftMethodBuilder. PHAB_ID=D138499

Closed

finatra-18.2.0 (2018-02-05)

Added

  • inject-thrift-client: Add methods to c.t.inject.thrift.filters.ThriftClientFilterChain to allow Tunable timeouts and request timeouts. PHAB_ID=D128506

  • inject-thrift-client: Add idempotent and nonIdempotent methods to c.t.inject.thrift.ThriftMethodBuilder, which can be used to configure retries and the sending of backup requests. PHAB_ID=D129959

  • inject-thrift-client: Add c.t.inject.thrift.modules.ServicePerEndpointModule for building ThriftMux clients using the thriftmux.MethodBuilder. PHAB_ID=D128196

Changed

  • inject-thrift: Update c.t.inject.thrift.PossibleRetryable to specify a ResponseClassifier and update usages in inject-thrift-client to use it. PHAB_ID=D134328

  • inject-thrift-client: Un-deprecate c.t.inject.thrift.modules.ThriftClientModule and update for parity with ServicePerEndpointModule in regards to ThriftMux client configuration. Update documentation. Rename ServicePerEndpointModule to the more descriptive and consistently named ThriftMethodBuilderClientModule. PHAB_ID=D129891

Fixed

Closed

finatra-18.1.0 (2018-01-17)

Added

  • finatra-thrift: Add support for building all types of Finagle Thrift clients to the underlying embedded TwitterServer with the c.t.finatra.thrift.ThriftClient test utility. See: https://twitter.github.io/scrooge/Finagle.html#creating-a-client PHAB_ID=D123915

  • finatra-jackson: Added support to finatra/jackson for deserializing com.twitter.util.Duration instances from their String representations. PHAB_ID=D122366

Changed

  • finatra-http: Change visibility of internal class c.t.finatra.http.internal.marshalling.RequestInjectableValues to be correctly specified as private to the http package. PHAB_ID=D127975

Fixed

  • finatra-http: Ensure we close resources in the ResponseBuilder. Addresses #440. PHAB_ID=D120779

Closed

finatra-17.12.0 (2017-12-08)

Added

  • finatra-thrift: Add tests for new Scrooge ReqRepServicePerEndpoint functionality. PHAB_ID=D107397

Changed

  • finatra-http: add a multipart = true arg to EmbeddedHttpServer.httpMultipartFormPost ``PHAB_ID=D113151`
  • inject-sever: Do not use the c.t.inject.server.EmbeddedTwitterServer InMemoryStatsReceiver for embedded http clients. The http client stats are emitted with the server under test stats which can be confusing, thus we now create a new InMemoryStatsReceiver when creating an embedded http client. PHAB_ID=D112024

Fixed

Closed

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 (2017-10-26)

Added

  • inject-core: Remove deprecated c.t.inject.TestMixin#resetMocks. Properly use c.t.inject.Mockito trait in tests. Deprecate resetting of mocks and resettables in c.t.inject.IntegrationTestMixin. PHAB_ID=D93876

  • finatra-http: Parameterize @RouteParam,@QueryParam,@FormParam, and @Header to allow specifying the field name to read from the params or header map. Previously these annotations only looked for values by the case class field name leading to possible ugliness when defining case class fields (especially with @Header). ``PHAB_ID=D94220

  • finatra: Add support for using a java.lang.annotation.Annotation instance with the #bind[T] testing DSL. This adds a way to bind instances in tests that use the @Named binding annotation. PHAB_ID=D91330

  • finatra-http: Allow setting the content type of a Mustache view. 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

  • finatra-utils: Remove deprecated ExternalServiceExceptionMatcher. PHAB_ID=D98343

  • finatra-jackson: ScalaType's isMap and isCollection methods now check that the given object's class is a subclass of scala.collection.Map[Any, Any] and scala.collection.Iterable[Any], respectively. Previously the superclasses' packages were unspecified. This is a runtime behavior change. PHAB_ID=D93104

  • finatra-http: Require that route URIs and prefixes begin with forward slash (/). PHAB_ID=D90895

  • inject-utils: (BREAKING API CHANGE) RichOption toFutureOrFail, toTryOrFail, and toFutureOrElse signature changed to take the fail or else parameter by name. PHAB_ID=D89544

  • inject-server: Remove usage of deprecated c.t.inject.logging.Slf4jBridgeUtility. Change usages to c.t.util.logging.Slf4jBridgeUtility. PHAB_ID=D88095

  • finatra-http, inject-thrift-client: Remove netty3 specific types and dependency. In finatra-http, the code using these types is deprecated and can be removed allowing us to remove netty3-specific dependencies. In inject-thrift-client we can default to use the DefaultTimer for the backupRequestFilter method param instead of the HashedWheelTimer. PHAB_ID=D88025

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 IllegalArgumentExceptions from field validations when the annotation is applied to a field of the incorrect type, e.g., when @Max is applied to a String field. PHAB_ID=D95306

Closed

finatra-2.13.0 (2017-09-06)

Added

  • inject-server: Add ability to fail embedded server startup on lint rule violation. There is now a flag in the embedded servers that when set to true will fail server startup if a lint rule violation is detected. This will then fail the running test. PHAB_ID=D82399

Changed

  • finatra-http: No longer depend on bijection-util. PHAB_ID=D86640

  • finatra-jackson: Deprecate c.t.finatra.json.utils.CamelCasePropertyNamingStrategy. This object was created to reduce ambiguity with previous releases of Jackson in which the default PropertyNamingStrategy was an abstract class with a default of camel case. Users are encouraged to use the Jackson PropertyNamingStrategy constants directly. PHAB_ID=D81707

Fixed

Closed

finatra-2.12.0 (2017-08-15)

Added

  • finatra-jackson: Add support for injecting a snake case FinatraObjectMapper by annotating parameters with a new @SnakeCaseMapper binding annotation. PHAB_ID=D7798

Changed

  • finatra-http: Add close hook when constructing a StreamingResponse to allow for resource release without consuming an entire AsyncStream. PHAB_ID=D64013

  • finatra-http: Unmarshalling JSON no longer consumes the body of a HTTP Request. PHAB_ID=D74519

  • finatra-inject: RetryUtil.retry has been removed because it used a blocking call to Thread.sleep. Blocking Finagle threads results in poor performance and RetryUtil.retryFuture should be used instead. PHAB_ID=D73949

Fixed

Closed

finatra-2.11.0 (2017-06-06)

Added

Changed

Fixed

  • finatra-jackson: Fix JSON deserialization of scala.util.Either type in FinatraObjectMapper for Scala 2.12. RB_ID=917699

Closed

finatra-2.10.0 (2017-04-20)

Added

Changed

  • finatra-http: Increase composability and flexibility of RouteDSL. RB_ID=912095

  • inject-app: Run installed modules postInjectorStartup before server function. This makes reasoning about the server lifecycle a bit more straight-forward and simplifies things like the exception manager logic for adding and overridding mappers. RB_ID=911965

  • finatra-jackson: Update framework tests to FunSuite ScalaTest testing style. RB_ID=911745

  • finatra: Move finatra/benchmarks and finatra/utils framework tests to FunSuite ScalaTest testing style. RB_ID=910680

Fixed

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

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

  • finatra-jackson: Patch FinatraDatetimeDeserializer to support parsing of Long value passed as String, e.g., when parsing a query parameter.RB_ID=911162

  • finatra: Close embedded server clients on embedded server close. RB_ID=910862

Closed

finatra-2.9.0 (2017-03-10)

Added

Changed

  • inject-core: (BREAKING API CHANGE) Allow for binding of higher-kinded types when testing. Deprecated @Bind mechanism for replacing bound types in an object graph. Now instead of using @Bind like this:

    class DarkTrafficCanonicalResourceHeaderTest
      extends FeatureTest
      with Mockito {
    
      @Bind
      @DarkTrafficService
      val darkTrafficService: Option[Service[Request, Response]] =
        Some(smartMock[Service[Request, Response]])
    
      /* mock request */
      darkTrafficService.get.apply(any[Request]).returns(Future.value(smartMock[Response]))
    
      override val server = new EmbeddedHttpServer(
        twitterServer = new DarkTrafficTestServer)
    
      test("DarkTrafficServer#has Canonical-Resource header correctly set") {
        ...
    

    Users can instead do:

    class DarkTrafficCanonicalResourceHeaderTest
      extends FeatureTest
      with Mockito {
    
      val darkTrafficService: Option[Service[Request, Response]] =
        Some(smartMock[Service[Request, Response]])
    
      /* mock request */
      darkTrafficService.get.apply(any[Request]).returns(Future.value(smartMock[Response]))
    
      override val server = new EmbeddedHttpServer(
        twitterServer = new DarkTrafficTestServer)
        .bind[Option[Service[Request, Response]], DarkTrafficService](darkTrafficService)
    
      test("DarkTrafficServer#has Canonical-Resource header correctly set") {
        ...
    

    This allows for more flexibility (as the binding is now per object graph, rather than per test files) and is less susceptible to errors due to incorrect usage.

    The breaking API change is due to adding this support in the TestInjector, it is now required that users call the TestInjector#create method in order to build the injector and that this is done after calls to TestInjector#bind. Previously, an Injector was directly returned from TestInjector#apply which is no longer true, thus it may look like your IntegrationTests are broken as you now need to add a call to TestInjector#create.

    Additionally, this change updates all of the framework tests in the inject modules to the FunSuite testing style from the deprecated WordSpec testing style. RB_ID=910011

  • finatra-thrift: Update framework tests to FunSuite ScalaTest testing style. RB_ID=910262

  • inject-core: Move Logging from grizzled-slf4j to util/util-slf4j-api. c.t.inject.Logger is now deprecated in favor of c.t.util.logging.Logger in util. PHAB_ID=D29713

  • finatra-httpclient: Update framework tests to FunSuite ScalaTest testing style. RB_ID=909526

  • finatra-http: Update framework tests to FunSuite ScalaTest testing style. RB_ID=909349

  • finatra: Bump guava to 19.0. RB_ID=907807

  • inject-thrift-client: Various APIs have changed to work with ThriftMethod.SuccessType instead of ThriftMethod.Result. See ThriftClientFilterChain, Controller, ThriftWarmup, PossiblyRetryable. RB_ID=908846

Fixed

  • finatra-http: Correctly support adding Java AbstractController by instance. RB_ID=910502

Closed

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

  • inject-core: Add back JUNitRUnner to c.t.inject.Test and c.t.inject.WordSpecTest so that tests can be run when building with maven. RB_ID=909789

  • 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. PHAB_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. PHAB_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 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 (2016-12-20)

Added

  • finatra-http: Add built-in support for Scala scala.concurrent.Future. The CallbackConverter now supports a return type of Scala scala.concurrent.Future by using a bijection to convert to a Twitter c.t.util.Future. RB_ID=898147

  • finatra-http: Support for request forwarding. Requests can be forwarded from one route to another. Forwarded requests will not go through the server's defined filter chain again but will pass through any Controller defined filters on the "forwarded to" route. RB_ID=883224

Changed

Fixed

Closed

finatra-2.6.0 (2016-11-22)

Added

  • finatra: Move the OSS documentation to internal code repository to be co-located with source code. RB_ID=881112

Changed

  • finatra-http: Decompose the ThrowableExceptionMapper to allow users to more easily replace the portions they care about. Users can now just replace the functionality per exception type rather than needing to replace the entire ThrowableExceptionMapper. `RB_ID=891666``

  • finatra-http: The 'cookie' method of c.t.finatra.http.response.ResponseBuilder#EnrichedResponse that takes a Netty 3 cookie instance has been deprecated. Please use the method which takes a Finagle HTTP cookie instead. RB_ID=888683

  • finatra-http: Update adding routes to the TwitterServer HTTP Admin Interface to use c.t.finagle.http.RouteIndex and remove the c.t.finatra.http.routing.AdminIndexInfo. Also relaxed the rules for what routes can be added to the index to include constant /POST routes. Additionally, no longer fail if you define conflicting admin routes -- we will now only warn. It is up to the user to not shoot themselves in the foot. RB_ID=889792

  • finatra-http: Request in request case classes no longer requires Inject annotation. RB_ID=888197

  • inject-utils: Deprecated RootMonitor since finagle DefaultMonitor is implicitly installed and handles all exceptions caught in stack. We provide a monitor method by default is a NullMonitor in c.t.finatra.thrift.modules.DarkTrafficFilterModule and c.t.inject.thrift.modules.FilteredThriftClientModule, users can handle other exceptions (unhandled by DefaultMonitor) by overriding the monitor method RB_ID=886773

  • finatra: We now depend on a fork of libthrift hosted in the Central Repository. The new package lives in the 'com.twitter' organization. This removes the necessity of depending on maven.twttr.com. This also means that eviction will not be automatic and using a newer libthrift library requires manual eviction if artifacts are being pulled in transitively. RB_ID=885879

  • inject-thrift-client: (BREAKING API CHANGE) Update filter building API with FilteredThriftClientModule. The c.t.inject.thrift.filters.ThriftClientFilterChain builder API has changed along with the underlying mechanisms to support enforcement of a "correct" filter order when using the helper methods. Methods have been renamed to a 'with'-syntax to be more inline with other builders and the confusing "globalFilter" method to the more verbose but more accurate "withAgnosticFilter". RB_ID=878260

  • inject-thrift-client: Remove deprecated package aliases. We'd like people to move the correct packages.RB_ID=879330

  • finatra-http: (BREAKING API CHANGE) Update StreamingResponse to avoid keeping a reference to the head of the AsyncStream. This resolves the memory leak when streaming an infinite stream. The constructor is now private; use the StreamingResponse object methods that take an AsyncStream by-name instead. ``RB_ID=890205''

Fixed

  • finatra-http: Allow 0,1,t,f as valid boolean values for QueryParam case class requests. RB_ID=881939

Closed

finatra-2.5.0 (2016-10-10)

Added

  • finatra-http: Add DarkTrafficFilterModule symmetric with thrift/DarkTrafficFilterModule. Add DarkTrafficService annotation in finatra-utils and a filter function used for requests annotated with Annotation Type in order to add DarkTrafficFilter. RB_ID=878079

Changed

  • finatra: No longer need to add an additional resolver that points to maven.twttr.com. RB_ID=878967
  • inject-thrift-client: Stop counting response failures in the c.t.inject.thrift.ThriftClientFilterChain as these are now counted in the c.t.finagle.thrift.ThriftServiceIface. RB_ID=879075
  • finatra-jackson: Fix issue around JsonProperty annotation empty value. In CaseClassField.jsonNameForField, if the @JsonProperty annotation is used without a value, the property name is interpreted as "". It now follows the default Jackson behavior of using the name field name as the property name when the annotation is empty. RB_ID=877060
  • finatra: Correct instances of misspelled word "converter". There are several instances where the word "converter" is misspelled as "convertor". Specifically, TwitterModule.addTypeConvertor has been changed to TwitterModule.addTypeConverter. Other internal renamings are TwitterDurationTypeConverter, JodatimeDurationTypeConverter, and JacksonToGuiceTypeConverter. RB_ID=877736
  • finatra: Move installation of the SLF4JBridgeHandler to the constructor of c.t.inject.server.TwitterServer. The c.t.finatra.logging.modules.Slf4jBridgeModule has been removed as there is now little reason to use it unless you are building an application directly from c.t.inject.app.App since the functionality is now provided by default in the constructor of c.t.inject.server.TwitterServer. If using c.t.inject.app.App, then users can use the c.t.inject.logging.modules.LoggerModule. The main advantage is that slf4j bridges are now installed earlier in the application or server lifecycle and thus more of the initialization logging is bridged to the slf4j-api. RB_ID=870913

Fixed

  • finatra-jackson: Test jar is missing files. Classes in the test c.t.finatra.validation package were not properly marked for inclusion in the finatra-jackson tests jar. They've now been added. RB_ID=878755

Closed

finatra-2.4.0 (2016-09-07)

Added

  • finatra-thrift: Enhanced support for Java Thrift services. RB_ID=868254
  • finatra-examples: Add web/UI application example. RB_ID=868027
  • inject-server: Allow for the ability to disable test logging via System property. RB_ID=867344

Changed

  • finatra-http: Simplify ExceptionMapper configuration and usage. We are dropping the need for a specialized DefaultExceptionMapper (which was simply an ExceptionMapper[Throwable]). Instead we now allow the configuration of mappers in the ExceptionManager to be much more flexible. Previously, the framework tried to prevent a user from registering a mapper over a given exception type multiple times and specialized a "default" ExceptionMapper to invoke on an exception type of Throwable. The ExceptionManager will now accept any mapper. If a mapper is added over a type already added, the previous mapper will be overwritten.

    The last registered mapper for an exception type wins.

    The framework adds three mappers to the manager by default. If a user wants to swap out any of these defaults they simply need add their own mapper to the manager for the exception type to map. E.g., by default the framework will add: Throwable -> com.twitter.finatra.http.internal.exceptions.ThrowableExceptionMapper JsonParseException -> com.twitter.finatra.http.internal.exceptions.json.JsonParseExceptionMapper CaseClassMappingException -> com.twitter.finatra.http.internal.exceptions.json.CaseClassExceptionMapper

    The manager walks the exception type hierarchy starting at the given exceptiontype and moving up the inheritence chain until it finds mapper configured for the type. In this manner an ExceptionMapper[Throwable] will be the last mapper invoked and performs as the "default".

    Thus, to change the "default" mapper, simply adding a new mapper over the Throwable type will suffice, i.e., ExceptionMapper[Throwable] to the ExceptionManager. There are multiple ways to add a mapper. Either through the HttpRouter:

    override def configureHttp(router: HttpRouter): Unit = { router .exceptionMapper[MyDefaultExceptionMapper] ... }

    Or in a module which is then added to the Server, e.g.,

    object MyExceptionMapperModule extends TwitterModule { override def singletonStartup(injector: Injector): Unit = { val manager = injector.instance[ExceptionManager] manager.add[MyDefaultExceptionMapper] manager.add[OtherExceptionMapper] } }

    override val modules = Seq( MyExceptionMapperModule, ...)

    This also means we can simplify the HttpServer as we no longer need to expose any "framework" module for overridding the default ExceptionMappers. So the "def exceptionMapperModule" has also been removed.RB_ID=868614

  • finatra-http: Specify HTTP Java API consistently. RB_ID=868264

  • inject-core: Clean up inject.Logging trait. Remove dead code from Logging. RB_ID=868261

  • finatra-http: Move integration tests to a package under com.twitter.finatra.http. RB_ID=866487

Fixed

  • finatra-http: Fix issue with unimplemented methods in NonValidatingHttpHeadersResponse. RB_ID=868480

Closed

finatra-2.3.0 (2016-08-25)

Added

  • finatra-thrift: Add non-guice method to add controller to ThriftRouter RB_ID=863977
  • finatra-thrift: Add support for a "dark" traffic filter in thrift routing. Add a Finatra implementation of the Finagle AbstractDarkTrafficFilter which sub-classes ThriftFilter and will work in the Finatra filter chain. This will allow users to play incoming requests to a configured "dark" service. RB_ID=852338

Changed

  • finatra-http: Performance improvements from latest micro-benchmarking run.
    • BREAKING API CHANGE: Removed HttpHeaders#setDate, HttpHeaders#set and HttpHeaders#GMT. RB_ID=865247
  • finatra-thrift: Provide access to statsReceiver argument in ThriftClientFilterBuilder. RB_ID=857286

Fixed

  • finatra-http: Add content headers for EmbeddedHttpServer #httpDelete and #httpPatch methods. RB_ID=862200

Closed

finatra-2.2.0 (2016-07-07)

Added

  • finatra-thrift: Add python namespace to finatra_thrift_exceptions.thrift. RB_ID=844668
  • finatra-http: Support ANY method in HTTP Controllers. Adds support for defining routes which will answer to "any" HTTP method. RB_ID=830429

Changed

  • finatra: Address lifecycle around com.twitter.inject.app.App#appMain.

    • (BREAKING CHANGE) EmbeddedApp has been completely re-written to be a better utility for testing command-line applications, as a result there are transparent changes to EmbeddedTwitterServer.
    • com.twitter.inject.app.App#appMain is now com.twitter.inject.app.App#run and com.twitter.inject.server.TwitterServer#start. #run() is used for "running" applications and #start() is used for "starting" servers. In the lifecycle TwitterServer implements App#run() as final and simply delegates to the start() method.
    • Server await callback for adding server Awaitables to a list so that the server will now Await.all on all collected Awaitables.
    • Added a new TwitterModuleLifecycle method: singletonPostWarmupComplete.
    • More documentation around server and app Lifecycle methods, their intended usages, and usages of callback functions.RB_ID=844303
  • finatra: Narrow visibility on classes/objects in internal packages. Classes/objects in internal packages are not intended for use outside of the framework. RB_ID=845278

  • finatra-http: fix HttpHeaders's Date locale problem. RB_ID=843966

  • inject-thrift: Address issues with com.twitter.inject.exceptions.PossiblyRetryable. PossiblyRetryable does not correctly determine what is retryable. Updated to correct the logic for better default retry utility. RB_ID=843428

  • finatra: finatra: Move com.twitter.finatra.annotations.Flag|FlagImpl to com.twitter.inject.annotations.Flag|FlagImpl. RB_ID=843383

  • finatra: Remove com.twitter.inject.conversions.map#atomicGetOrElseUpdate. This was necessary for Scala 2.10 support since #getOrElseUpdate was not atomic until Scala 2.11.6. See: scala/scala#4319. RB_ID=842684

  • finatra: Upgrade to Jackson 2.6.5. RB_ID=836819

  • inject: Introduce inject/inject-thrift module to undo cyclic dependency introduced in RB 839427. RB_ID=841128

  • inject-thrift-client: Improvements to FilteredThriftClientModule to provide finer-grain insight on ThriftClientExceptions. NOTE: previously per-route failure stats were in the form: route/add1String/GET/status/503/handled/ThriftClientException/Adder/add1String/com.twitter.finatra.thrift.thriftscala.ServerError

    These will now split across per-route and detailed "service component" failure stats, e.g.,

    // per-route route/add1String/GET/failure/adder-thrift/Adder/add1String/com.twitter.finatra.thrift.thriftscala.ServerError route/add1String/GET/status/503/mapped/ThriftClientException // service component service/failure/adder-thrift/Adder/add1String/com.twitter.finatra.thrift.thriftscala.ServerError

    Where the latter is in the form "service/failure/SOURCE/THRIFT_SERVICE_NAME/THRIFT_METHOD/NAME/details". "SOURCE" is by default the thrift client label, however, users are able to map this to something else.RB_ID=839427

  • finatra: Renamed Embedded testing utilities constructor args, clientFlags --> flags and extraArgs --> args. RB_ID=839537

  • finatra-http: Set Content-Length correctly in EmbeddedHttpServer, to support multi-byte characters in the request body. RB_ID=837438

  • finatra-http: No longer special-case NoSuchMethodException in the ExceptionMappingFilter. RB_ID=837369

  • finatra-http: Remove deprecated package objects in com.twitter.finatra. Callers should be using code in the com.twitter.finatra.http package. RB_ID=836194

  • finatra-http: Removed deprecated ExceptionBarrierFilter. NOTE: The ExceptionBarrierFilter produced stats in the form: "server/response/status/RESPONSE_CODE". Using the replacement StatsFilter (in combination with the ExceptionMappingFilter) will produce more granular per-route stats. The comparable stats from the StatsFilter will be in the form: "route/ROUTE_URI/HTTP_METHOD/status/RESPONSE_CODE" with an additional aggregated total stat. RB_ID=836073 E.g, server/response/status/200: 5, server/response/status/201: 5, server/response/status/202: 5, server/response/status/403: 5,

    will now be: route/bar_uri/GET/status/200: 5, route/bar_uri/GET/status/2XX: 5, route/bar_uri/GET/status/400: 5, route/bar_uri/GET/status/401: 5, route/bar_uri/GET/status/403: 5, route/bar_uri/GET/status/4XX: 15, route/foo_uri/POST/status/200: 5, route/foo_uri/POST/status/2XX: 5, route/foo_uri/POST/status/400: 5, route/foo_uri/POST/status/401: 5, route/foo_uri/POST/status/403: 5, route/foo_uri/POST/status/4XX: 15,

  • finatra: Made implicit classes extend AnyVal for less runtime overhead. RB_ID=835972

  • finatra-http: Remove deprecated package objects in com.twitter.finatra. Callers should be using code in the com.twitter.finatra.http package. RB_ID=836194

  • finatra: Publish all artifacts under com.twitter organization. RB_ID=834484

  • finatra: Update sbt memory settings. RB_ID=834571

  • inject-server: Rename com.twitter.inject.server.TwitterServer#run to com.twitter.inject.server.TwitterServer#handle. RB_ID=833965

  • finatra-http: Move test utilities in com.twitter.finatra.http.test.* to com.twitter.finatra.http.*. RB_ID=833170

  • finatra: Update SLF4J to version 1.7.21 and Logback to 1.1.7. Also update example logging configurations for best practices. RB_ID=832633

  • Builds are now only for Java 8 and Scala 2.11. See the blog post <https://finagle.github.io/blog/2016/04/20/scala-210-and-java7/>_ for details. RB_ID=828898

Fixed

  • finatra-examples: Add sbt-revolver to the hello-world example. Fixes GH-209. RB_ID=838215
  • finatra: Fix to properly support Java controllers that return Futures in their route callbacks. RB_ID=834467

Closed

finatra-2.1.6 (2016-04-26)

Full Changelog

Added

  • finatra-thrift: Add ThriftWarmup for thrift servers. RB_ID=820771
  • finatra-inject/inject-server: Register framework in Library registry. RB_ID=809458
  • finatra-http: Support for trace, connect & options in RequestBuilder. RB_ID=811102
  • finatra-thrift: Allow for thrift server configuration. RB_ID=811126

Changed

  • finatra/twitter-server: Update to register TwitterServer as library in /admin/registry.json. RB_ID=825129
  • finatra-inject/inject-server: Deprecate PromoteToOldGenUtils in favor of twitter-server's prebindWarmup event. RB_ID=819411
  • finatra-http: Move HttpServer to new Http stack API. RB_ID=812718

Fixed

  • finatra: Revert sbt-scoverage plugin to 1.2.0. RB_ID=812098
  • finatra-http: Ensure headers are set correctly in requests and responses. RB_ID=813969

Closed

v2.1.5 (2016-03-15)

Full Changelog

Added

  • finatra-http: Ability to access the finagle request in the ResponseBuilder for templating. RB_ID=805317
  • finatra-http: Added ability to register routes into the TwitterServer admin UI. RB_ID=808272
  • finatra: Added PULL_REQUEST_TEMPLATE RB_ID=808946

Changed

  • finatra: Move to develop branch as default branch for Github. RB_ID=810088
  • finatra: Updated test jars to only contain test utility code. RB_ID=809803

Fixed

  • finatra-http; finatra-thrift: Slf4JBridgeModule is added by default and no longer breaks services which use the slf4k-jdk14 logging implementation. RB_ID=807171
  • finatra-http: Fixed incorrect (or missing) content-type on some http responses. RB_ID=807773
  • finatra-jackson: Fix to support doubles/floats in the jackson Min/Max/Range validations. RB_ID=809821

v2.1.4 (2016-02-25)

Full Changelog

Fixed

Closed

v2.1.3 (2016-02-05)

Full Changelog

Closed

v2.1.2 (2015-12-09)

Full Changelog

Fixed

Closed

v2.1.1 (2015-10-29)

Full Changelog

Closed

Merged pull requests:

v2.1.0 (2015-10-01)

Full Changelog

Merged pull requests:

v2.0.1 (2015-09-21)

Full Changelog

Closed

Merged pull requests:

v2.0.0 (2015-09-09)

Full Changelog

Closed

Merged pull requests:

v2.0.0.M2 (2015-06-12)

Full Changelog

Closed

Merged pull requests:

v2.0.0.M1 (2015-04-30)

Full Changelog

Closed

Merged pull requests:

1.6.0 (2015-01-08)

Full Changelog

Closed

Merged pull requests:

1.5.4 (2014-07-07)

Full Changelog

Closed

Merged pull requests:

1.5.3 (2014-04-16)

Full Changelog

Closed

Merged pull requests:

1.5.2 (2014-02-03)

Full Changelog

Closed

Merged pull requests:

1.5.1 (2014-01-13)

Full Changelog

Closed

Merged pull requests:

1.5.0a (2014-01-08)

Full Changelog

Closed

1.5.0 (2014-01-07)

Full Changelog

Closed

Merged pull requests:

finatra-1.4.1 (2013-11-13)

Full Changelog

Closed

Merged pull requests:

1.4.0 (2013-10-14)

Full Changelog

Closed

finatra-1.4.0 (2013-10-14)

Full Changelog

1.3.9 (2013-10-14)

Full Changelog

finatra-1.3.9 (2013-10-14)

Full Changelog

1.3.8 (2013-09-22)

Full Changelog

finatra-1.3.8 (2013-09-22)

Full Changelog

Closed

  • Make mustache factory use baseTemplatePath local docroot and template path Github Issue 56

Merged pull requests:

1.3.7 (2013-07-20)

Full Changelog

finatra-1.3.7 (2013-07-20)

Full Changelog

finatra-1.3.4 (2013-07-20)

Full Changelog

Closed

Merged pull requests:

finatra-1.3.3 (2013-06-14)

Full Changelog

Merged pull requests:

finatra-1.3.2 (2013-06-13)

Full Changelog

Merged pull requests:

finatra-1.3.1 (2013-03-12)

Full Changelog

Closed

finatra-1.3.0 (2013-03-10)

Full Changelog

finatra-1.2.2 (2013-03-10)

Full Changelog

Closed

Merged pull requests:

finatra-1.2.0 (2013-01-22)

Full Changelog

finatra-1.1.1 (2012-12-06)

Full Changelog

Closed

Merged pull requests:

finatra-1.1.0 (2012-11-20)

Full Changelog

Closed

finatra-1.0.3 (2012-11-13)

Full Changelog

finatra-1.0.2 (2012-11-13)

Full Changelog

Closed

finatra-1.0.1 (2012-11-11)

Full Changelog

Closed

Merged pull requests:

finatra-1.0.0 (2012-11-08)

Full Changelog

Closed

finatra-0.3.4 (2012-11-07)

Full Changelog

Closed

finatra-0.3.3 (2012-11-05)

Full Changelog

finatra-0.3.2 (2012-11-04)

Full Changelog

Closed

finatra-0.2.4 (2012-08-18)

Full Changelog

Merged pull requests:

finatra-0.2.3 (2012-08-08)

Full Changelog

Merged pull requests:

finatra-0.2.1 (2012-07-20)

Full Changelog

Merged pull requests:

finatra-0.2.0 (2012-07-20)

Full Changelog

Closed

Merged pull requests:

finatra-0.1.10 (2012-07-14)

Full Changelog

finatra-0.1.9 (2012-07-14)

Full Changelog

finatra-0.1.8 (2012-07-14)

Full Changelog

Closed

finatra-0.1.7 (2012-07-13)

Full Changelog

finatra-0.1.6 (2012-07-13)

Full Changelog

Closed

finatra-0.1.5 (2012-07-13)

Full Changelog

Closed

finatra-0.1.3 (2012-07-13)

Full Changelog

finatra-0.1.2 (2012-07-13)

Full Changelog

Closed

finatra-0.1.1 (2012-07-13)

Full Changelog

finatra-0.1.0 (2012-07-12)

Full Changelog

finatra-0.0.1 (2012-07-12)

Merged pull requests: