Skip to content

Releases: twitter/finatra

Finatra 21.8.0

14 Aug 17:57
Compare
Choose a tag to compare

Fixed

  • inject-core: Fixed a bug where c.t.inject.TestMixin#assertFailedFuture would incorrectly pass
    for non-failed c.t.util.Future in some cases where the tested failure is a supertype of
    org.scalatest.exceptions.TestFailedException. b1f14ebb

Breaking API Change

  • inject-utils: Removed deprecated c.t.inject.conversions.string, use
    c.t.conversions.StringOps in the util/util-core project instead. ceed4f4a
  • inject-utils: Removed deprecated c.t.inject.conversions.tuple, use
    c.t.conversions.TupleOps in the util/util-core project instead. 0c95c240
  • inject-utils: Removed deprecated c.t.inject.conversions.seq, use
    c.t.conversions.SeqOps in the util/util-core project instead. 8bd42557
  • inject-utils: Removed implicit class RichMap from c.t.inject.conversions.map,
    use c.t.conversions.MapOps in the util/util-core project instead. 19ad496a

Changed

  • thrift: Update the test c.t.finatra.thrift.ThriftClient to close client and clean-up resources
    during the EmbeddedTwitterServer close. e6c792ed
  • finatra: Update ScalaCheck to version 1.15.4 f40869cd

Finatra 21.6.0

22 Jun 20:23
Compare
Choose a tag to compare

Changed

  • inject-thrift-client (BREAKING API CHANGE): Removed the deprecated
    c.t.inject.thrift.modules.FilteredThriftClientModule. Please use its successor
    c.t.inject.thrift.modules.ThriftMethodBuilderClientModule for per-method configuration of a
    Thrift client. 008d8ca1

  • thrift: Add service_class to Finatra library thrift registry entry. c5159208

  • finatra (BREAKING API CHANGE): Update to use the new util/util-jackson ScalaObjectMapper for
    case class object mapping. We've removed the custom Finatra c.t.finatra.jackson.ScalaObjectMapper
    and instead now use the c.t.util.jackson.ScalaObjectMapper. Since the c.t.util.jackson.ScalaObjectMapper
    does not support Joda-Time, backwards compatibility is
    maintained through usage of the Finatra ScalaObjectMapperModule for obtaining a configured
    ScalaObjectMapper which will be created with Joda-Time support, though support for Joda-Time in
    Finatra is deprecated and users should expect for Joda-Time support to be removed in an upcoming release.
    Users should prefer to use the JDK 8 java.time classes or java.util.Date.

    The finatra/inject c.t.inject.domain.WrappedValue has been removed and users should update to the
    util/util-core c.t.util.WrappedValue instead.

    The finatra/jackson JsonDiff utility is also removed. Users should switch to the improved version
    in util/util-jackson: c.t.util.jackson.JsonDiff.

    With the move to the util/util-jackson ScalaObjectMapper we're also able to clean up some awkward
    directory structures in Finatra which were necessary because of dependencies. Specifically, the
    finatra/json-annotations library no longer exists, as @InjectableValue is now an annotation in
    util/util-jackson-annotations, and the remaining binding annotations @CamelCaseMapper and @SnakeCaseMapper
    have been moved into finatra/jackson.

    Using the util/util-jackson ScalaObjectMapper also brings Java 8 date/time
    (JSR310) support via inclusion of the Jackson JavaTimeModule
    by default.

    Lastly, we've also added the YamlScalaObjectMapperModule which can be used in place of the
    ScalaObjectMapperModule in order to provide a YAMLFactory configured ScalaObjectMapper.
    9a168a98

  • inject-utils: Remove deprecated c.t.inject.utils.StringUtils. Users should prefer to use
    the corresponding methods in com.twitter.conversions.StringOps from util/util-core, instead.
    3a063a9e

  • inject-utils: Remove deprecated c.t.inject.utils.AnnotationUtils. Users should instead prefer
    c.t.util.reflect.Annotations from util/util-reflect. 35b58d34

Finatra 21.5.0

29 May 01:48
Compare
Choose a tag to compare

Fixed

  • finatra-jackson: Do not enforce CaseClassDeserializer deserialization semantics for a
    field until after any deserializer annotation has been resolved. This fully allows a deserializer
    to specify how to deserialize a field completely independent of the CaseClassDeserializer
    requirements for fields. For example, if a user wanted to allow parsing of a JSON null value
    into a null field instance value, they could define a custom deserializer to do so and annotate
    the case class field with @JsonDeserialize(using = classOf[CustomNullableDeserializer]).

    Additionally, we fix a bug in how String case class fields are handled when the incoming JSON is
    not a String-type. The current code incorrectly returns an empty string when the field value is
    parsed into Jackson ContainerNode or ObjectNode types and an incorrect toString representation
    for a PojoNode type. We now correctly represent the field value as a string in these cases to
    deserialize into the case class field. 715890a4

  • finatra-jackson: Properly handle Scala enumeration fields wrapped in an Option during
    deserialization failures in the CaseClassDeserializer#isScalaEnumerationType method.
    a6cb5a10

Changed

  • finatra-kafka: Deprecate c.t.finatra.kafka.consumers.TracingKafkaConsumer
    as it only produced single-span traces and there is no way to propagate the TraceId back to the
    caller without changing the entire API. Users should use the
    c.t.finatra.kafka.consumers.KafkaConsumerTracer.trace method instead to enable tracing for
    Kafka Consumers. Also added c.t.finatra.kafka.producers.KafkaProducerTraceAnnotator and
    c.t.finatra.kafka.consumers.KafkaConsumerTraceAnnotator services which will can be used to add
    custom trace annotations to the producer and consumer spans. bba748e6

  • finatra (BREAKING API CHANGE): Update to use the new util/util-validator ScalaValidator for case
    class field validations. We've removed the custom Finatra c.t.finatra.validation.Validator and
    instead now use the c.t.util.validation.ScalaValidator. Constraint annotations and validator
    implementations now use the standard jakarta.validation API interface classes instead of any
    custom Finatra types. We've deprecated the custom Finatra constraints as they are duplicative of
    already existing "standard" or otherwise provided constraints and validators. Additionally,
    c.t.finatra.validation.ErrorCode is deprecated with no replacement. The same data carried can be
    obtained via the standard jakarta.validation.ConstraintViolation[T].

    Adapting the Finatra framework to use the util/util-validator also includes the framework Jackson
    integration. We're also taking this opportunity to clean up the error reporting interface of
    the CaseClassFieldMappingException to define a CaseClassFieldMappingException.Reason type to
    replace the usage of the (removed) ValidationResult.Invalid type. The Reason carries a message
    String as well as a CaseClassFieldMappingException.Detail which can be one of several possible
    types including a CaseClassFieldMappingException.ValidationError which carries any failed validation
    information including the emitted ConstraintViolation[T].

    Lastly, we are deprecating support for JSON serialization/deserialization of JodaTime fields in
    case classes. This support will be dropped in an upcoming release. Users should prefer to use the
    JDK 8 java.time classes and we will be adding support for these types in the Finatra Jackson
    integration in the future. 0731782d

  • finatra-jackson: (BREAKING API CHANGE) JsonLogging should use the lazy Scala SLF4J logger
    and no longer return the passed in argument that's logged as JSON. 67252f30

Finatra 21.4.0

28 Apr 18:08
Compare
Choose a tag to compare

Changed

  • http-core: Add support to build a multipart/form-data POST request in Finatra RequestBuilder.
    8d2d8c58
  • finatra-kafka-streams: Update AsyncTransformer to support threadpools. 0498a06a
  • finatra-kafka-streams: Set kafka.producer.acks=all by default cce382d9

Finatra 21.3.0

30 Mar 17:37
Compare
Choose a tag to compare

Added

  • inject-thrift-client: Add per-method retry configuration withMaxRetries in
    com.twitter.inject.thrift.ThriftMethodBuilder for customizing configureServicePerEndpoint.
    be9f27c8

Breaking API Changes

  • finatra: Deprecate c.t.inject.utils.AnnotationUtils, users should instead use
    c.t.util.reflect.Annotations from com.twitter:util-reflect. Deprecate
    c.t.finatra.utils.ClassUtils, users should instead use either
    c.t.util.reflect.Classes#simpleName, c.t.util.reflect.Types#isCaseClass or
    c.t.util.reflect.Types#notCaseClass from com.twitter:util-reflect. 291d1b78
  • finatra: Builds are now only supported for Scala 2.12+ 5f08f469

Changed

  • finatra: Revert to scala version 2.12.12 due to scoverage/sbt-scoverage#319
    6f74aedb
  • finatra: Bump scala version to 2.12.13 029c7500
  • finatra: Move com.twitter.finatra.http.{jsonpatch,request} from the finatra/http-server project to
    finatra/http-core project. Please update your build artifact references accordingly.
    f8a810b2
  • http-server,http-core,jackson,thrift,validation: Update to use c.t.util.reflect.Types
    in places for TypeTag reflection. c132a053
  • finatra: Move c.t.finatra.http.{context,exceptions,response} from the finatra/http-server project
    to finatra/http-core project. Please update your build artifact references accordingly.
    9f6c9405
  • finatra: Move c.t.finatra.http.streaming from the finatra/http-server project to
    finatra/http-core project. Please update your build artifact references accordingly.
    d454fd0e
  • http-core: Introduce c.t.finatra.http.marshalling.MessageBodyManager#builder for creating an immutable
    c.t.finatra.http.marshalling.MessageBodyManager. The MessageBodyManager's constructor is now private.
    d8886dab
  • http-server: Move c.t.finatra.http.modules.MessageBodyFlagsModule to
    c.t.finatra.http.marshalling.modules.MessageBodyFlagsModule. 0cd97c79
  • validation: Remove deprecated constraint type aliases under com.twitter.finatra.validation, users
    should prefer the actual constraint annotations at com.twitter.finatra.validation.constraints.
    498ebe4a
  • jackson: Remove deprecated com.twitter.finatra.json.utils.CamelCasePropertyNamingStrategy,
    users should prefer to use PropertyNamingStrategy#LOWER_CAMEL_CASE or an equivalent directly.
    Also remove the deprecated com.twitter.finatra.json.annotations.JsonCamelCase, users should
    use the @JsonProperty or @JsonNaming annotations or an appropriately configured
    Jackson PropertyNamingStrategy instead. da836c55
  • inject-core: (BREAKING API CHANGE) Rename c.t.inject.TwitterModule.closeOnExit to onExit so
    it mirrors the API from c.t.inject.App. b8f00879
  • http-client: Remove deprecated c.t.finatra.httpclient.modules.HttpClientModule.
    Use c.t.finatra.httpclient.modules.HttpClientModuleTrait instead.
    333c782a
  • http-client: Remove deprecated c.t.finatra.httpclient.RichHttpClient. Use c.t.finagle.Http.Client
    or c.t.finatra.httpclient.modules.HttpClientModuleTrait instead. Additionally,
    c.t.finatra.httpclient.modules.HttpClientModule.provideHttpService has been removed. Use
    c.t.finatra.httpclient.modules.HttpClientModuleTrait.newService(injector, statsReceiver)
    instead. 2af18ede
  • finatra: Move c.t.finatra.http.fileupload from the finatra/http-server project to
    finatra/http-core project. Please update your build artifact references accordingly.
    8b0ea169
  • http-client: Remove deprecated method get from c.t.finatra.httpclient.HttpClient.
    Use HttpClient's execute instead. eada0515
  • finatra: Create the finatra/http-core project, which is meant to contain common artifacts
    for the finatra/http-server and finatra/http-client project. As part of this
    change, the com.twitter.finatra.httpclient.RequestBuilder has been deprecated
    and should be updated to reference com.twitter.finatra.http.request.RequestBuilder.
    5e3da631
  • finatra: Rename the finatra/httpclient project to finatra/http-client. Please update your
    build artifact references (i.e. SBT, Maven) to use "finatra-http-client".
    c0b0ae61
  • kafkaStreams: Switch the default Kafka client and Kafka Stream client to version 2.4.1.
    d2367485
  • finatra: Rename the finatra/http project to finatra/http-server. Please update your
    build artifact references (i.e. SBT, Maven) to use "finatra-http-server". See the
    Finatra User's Guide
    2cb398e6

Finatra 21.2.0

11 Feb 01:26
Compare
Choose a tag to compare

Changed

  • finatra: all subprojects cross-building with 2.13.1. 7deb1153
  • kafkaStreams: Enables cross-build for 2.13.1 for projects kafkaStreamsStaticPartitioning,
    kafkaStreamsPrerestore, and kafkaStreamsQueryableThrift. c9e5bda1

Finatra 21.1.0

19 Jan 20:05
Compare
Choose a tag to compare

Changed

  • kafka: Enables cross-build for 2.13.1. Note that kafka 2.5 is bundled with scala 2.13+
    and kafka 2.2 is bundled with scala 2.12-. 7bdba713
  • kafkaStreams: Enables cross-build for 2.13.1. Note that kafka 2.5 is bundled with
    scala 2.13+ and kafka 2.2 is bundled with scala 2.12-. 7bdba713
  • benchmarks: Enables cross-build for 2.13.1. c811e18a
  • inject-thrift-client-http-mapper: Enables cross-build for 2.13.1. 7c3f13ba
  • http-mustache: Enables cross-build for 2.13.1. 7c3f13ba
  • thrift: (BREAKING API CHANGE) Removed JavaThriftRouter.add(controller, protocolFactory) method.
    Use AbstractThriftServer.configureThriftServer to override Thrift-specific stack params
    (including Thrift.param.ProtocolFactory). bc34aa7b
  • finatra-http: Remove deprecated c.t.finatra.http.response.StreamingResponse.
    Use c.t.finatra.http.streaming.StreamingResponse instead. 851a06a5
  • finatra-kafka-streams: (BREAKING API CHANGE) Changed the delayWithStore DSL call to ensure that
    the store name is consistent across shards. Requires a new storeName parameter to allow
    for multiple delays in a single topology. 7373b478

Fixed

  • finatra-kafka-streams: Renamed implicit Kafka Streams DSL classes in order to
    permit multiple DSL extensions to be used in the same Kafka Streams topology.
    b48d4c5c
  • thrift: Fixed a bug where Thrift stack params (i.e., protocol factory) that are passed to
    AbstractThriftServer.configureThriftServer are ignored in JavaThriftRouter.
    bc34aa7b

Finatra 20.12.0

19 Jan 20:05
Compare
Choose a tag to compare

Added

  • finatra-kafka-streams: Add async map commands to Kafka Streams DSL (flatMapAsync,
    flatMapValuesAsync, mapAsync, and mapValuesAsync) 4922a984
  • finatra-kafka-streams: Allow String configuration to be null and set upgradefrom to null if it is running in 2.5 kafka client. 6703da53
  • finatra-http: Allow injecting filtered controllers in HttpRouter from Java. de2a8f78
  • inject-utils: Move deprecation warning from c.t.inject.conversions.map to
    c.t.inject.conversions.map.RichMap. 4364eb6e
  • kafka: Add an option includePartitionMetrics to KafkaFinagleMetricsReporter to not include
    metrics per partition of the FinagleKafkaConsumer. Defaults to true. 1f5a00ee
  • finatra: Enables cross-build for 2.13.1 for inject-logback. 0468a613
  • finatra-kafka-streams: Add delay DSL calls to insert a delay into a Kafka Streams topology.
  • finatra: Enables cross-build for 2.13.1 for inject-thrift-client. 82cf2830
  • finatra-kafka-streams: Add c.t.f.k.t.s.PersistentTimerValueStore which stores a value in the
    timerstore that can be used when the timer is triggered. 3cd8bfc0
  • inject-core: Add ability to call InMemoryStats#waitFor with a fixed timeout
    306b7196
  • finatra: Enables cross-build for 2.13.1 for httpclient, http, and jackson. d6dbc074

Changed

  • inject-utils: Deprecate all methods in c.t.inject.conversions.map.RichMap, and move
    functionality to c.t.conversions.MapOps in the util/util-core project. e765b5ae
  • inject-utils: Deprecate all methods in c.t.inject.conversions.tuple, and move functionality
    to c.t.conversions.TupleOps in the util/util-core project. 2bd6dbf6
  • inject-utils: Deprecate all methods in c.t.inject.conversions.seq, and move functionality
    to c.t.conversions.SeqOps in the util/util-core project. 0ad0d114
  • inject-utils: Remove deprecated camelify, pascalify, and snakify from
    c.t.inject.conversions.string.RichString. Additionally, deprecate toOption and
    getOrElse in c.t.inject.conversions.string.RichString, and move functionality to
    c.t.conversions.StringOps in the util/util-core project. b058e7f4
  • c.t.finatra.http.exceptions.ExceptionMapperCollection changed from Traversable to Iterable
    for cross-building 2.12 and 2.13. d6dbc074
  • inject-core: (BREAKING API CHANGE) Move the testing utility InMemoryStatsReceiverUtility
    and InMemoryStats into inject-core from inject-server. They can both be found under
    com.twitter.inject. fa5d5d69
  • validation: (BREAKING API CHANGE) Introduce new Validation Framework APIs which support
    cascading validation to nested case classes and other improvements which also closer align
    to JSR380. Validator#validate has changed from returning Unit and throwing an exception
    to model the JSR380 version that returns a Set of failed constraints. There is a new method
    which replicates the throwing behavior. 19008194
  • kafka: Split c.t.f.kafka.tracingEnabled flag into c.t.f.k.producers.producerTracingEnabled and
    c.t.f.k.consumers.consumerTracingEnabled to selectively enable/disable tracing for
    producers/consumers. Producer tracing is turned on by default and consumer tracing is turned off
    by default now. b95b8460

Fixed

  • inject-server: Wire through HTTP method in AdminHttpClient so that POST requests can be made to
    HTTPAdmin endpoints. 8d846128

Finatra 20.10.0

27 Oct 18:09
Compare
Choose a tag to compare

Added

  • finatra-kafka-streams: Add toCluster DSL call to publish to another Kafka cluster. 449eea1a

  • jackson: Add support for validating @JsonCreator annotated static (e.g., companion object defined apply methods) or secondary case class constructors. 1c1b55c9

  • inject-app: Allow injecting flags without default values as both scala.Option and java.util.Optional. b74fe9e9

Changed

  • utils: Undo usage of TypesApi for help in determining if a class is a Scala case class
    as this fails for generic case classes in Scala 2.11, failing some supported cases for
    Jackson processing. b1d43381
  • utils: Update ClassUtils#simpleName to handle when package names have underscores
    followed by a number which throws an InternalError. Add tests. bbc0cf7b
  • utils: Revamp ClassUtils#isCaseClass to use the TypesApi for help in determining
    if a class is a Scala case class. Add tests. bbc0cf7b
  • http: The http server did not properly log the bound address on server startup. Fix this
    and make the thrift server consistent. 4410ff38
  • utils: (BREAKING API CHANGE) Rename maybeIsCaseClass to notCaseClass in
    ClassUtils and change the scope of the method. 82ffb4be
  • http: Adding support for optionally passing chain in the TLS sever trait. 5bcce35c
  • finatra: Bump version of Joda-Time to 2.10.8. e2cbca30

Fixed

  • finatra-kafka-streams: Revert AsyncTransformer to still use ConcurrentHashMap. 7d5b3ccf

  • inject-thrift-client: The Singleton annotation has been removed from the DarkTrafficFilter and the JavaDarkTrafficFilter. It was there in error. 5efc1ab2

  • inject-thrift-client: When using RepRepServicePerEndpoint, Finatra's DarkTrafficFilter would throw a NoSuchMethodException when trying to lookup an inherited Thrift endpoint.
    697b2137

Finatra 20.9.0

25 Sep 02:55
Compare
Choose a tag to compare

Added

  • finatra-inject: TestInjector has been reworked to allow users executing modules' lifecycle
    callbacks. Specifically, the TestInjector builder API has been moved under TestInjector.Builder
    to allow TestInjector extends Injector with two new methods: start() and close().
    07bf53fa

Changed

  • finatra-kafka-streams: Update and separate the Finatra kafka stream code base which has direct
    dependency on Kafka 2.2. Separate any code which cannot easily be upgraded to separate build
    target. 3c78c34d
  • inject-core: c.t.inject.Injector is now an abstract class. Use Injector.apply to create
    a new instance (versus the new Injector(...) before). 64ba51e9
  • http: Ensure HttpWarmer creates the request exactly the number of times requested and
    mutates the correct objects. 0a3be376
  • kafka: Replaced the com.twitter.finatra.kafka.TracingEnabled toggle with a GlobalFlag enabling
    Zipkin tracing for Kafka clients. 0e829aae
  • finatra: Bump version of Jackson to 2.11.2. 94bc773d

Fixed

  • jackson: Fix issue in the handling of unknown properties. The CaseClassDeserializer only
    considered the case where the incoming JSON contained more fields than the case class and
    not the case where the incoming JSON contained less fields than specified in the case class.
    This has been fixed to ensure that when the fields of the JSON do not line up to the
    non-ignored case class fields the handling of unknown properties is properly invoked.
    9762145d
  • validation: c.t.f.validation.Validator would throw an IndexOutOfBoundsException when
    trying to validate a case class which contained additional fields that are not included in the
    constructor parameters. bb342c09