{"push_id":1403462839,"size":7,"distinct_size":7,"ref":"refs/heads/master","head":"2f55f5b81a1ac4f44a3b0fe693f36f3fe4d01ae8","before":"93bb4e007037fe721313530955852c9e73ca2ab0","commits":[{"sha":"2ec5738d811f48a66797b162898050ae68052640","author":{"name":"Christopher Townson","email":"1ab404878e46d892882bc722116d6f5877434cec@gmail.com"},"message":"Step 3: VERY IMPORTANT - update dependencies in project/MicroServiceBuild.scala\n\nUpdate your HMRC dependencies to the latest versions which are designed to support Play 2.5. See https://confluence.tools.tax.service.gov.uk/pages/viewpage.action?spaceKey=DTRG&title=Play+2.5.8+Upgrade+Guide for a full list of upgraded libraries. Upgrade any and all libraries listed in that Confluence page that you utilise.\n\nYou may also need to update your versions of 3rd party Play-dependent libraries, such as play-test and scalatest+play amongst others. It is important for YOU to verify that all of your dependencies are Play 2.5 compatible.\n\nIf you are seeing eviction warnings for Play 2.3, you MUST pay attention as they are almost certain to cause compilation failures (if you are lucky) or, more often, unexpected runtime errors.\n\nIt is quite possible that you depend on an HMRC library (possibly created by your team and only used by yourselves) that depends on Play but which has NOT been upgraded yet. In such cases, it is YOUR responsibility to upgrade the library.\n\nAfter completing this step, it is almost certain that your project will still not compile. At the very least, `sbt compile` will complain about `MetricsController`\n\n[error] /your-microservice/conf/prod.routes:5: object MetricsController is not a member of package com.kenshoo.play.metrics\n[error] Note: class MetricsController exists, but it has no companion object.\n[error] GET        /admin/metrics             com.kenshoo.play.metrics.MetricsController.metrics","distinct":true,"url":"https://api.github.com/repos/hmrc/example-play-25-microservice/commits/2ec5738d811f48a66797b162898050ae68052640"},{"sha":"bf2c96e2b30337c088ae5589dfc1909d74896c17","author":{"name":"Christopher Townson","email":"1ab404878e46d892882bc722116d6f5877434cec@gmail.com"},"message":"Step 4: update metrics-play configuration\n\nMetrics is now provided as a Play module with a class-based DI controller. As a result, some changes are needed to configuration and tests to get it to work:\n\n1. Delete conf/play.plugins\n\n2. Enable the metrics module by adding `play.modules.enabled += \"com.kenshoo.play.metrics.PlayModule\"` in conf/application.conf\n\n3. Prefix the MetricsController route with an \"@\" in conf/prod.routes, as follows `GET        /admin/metrics             @com.kenshoo.play.metrics.MetricsController.metrics`\n\n4. In your integration or unigration tests, wherever you are using the hmrctest `WithFakeApplication`, add `override def bindModules = Seq(new PlayModule)` ... basically, you need to ensure that your \"fake applications\" contain the modules your app uses, otherwise you are liable to get test failures due to Guice provisioning errors. Finding these problems with tests can be a bit hit-and-miss, so you may prefer to wait to fix this type of runtime error until everything compiles. If you were sensible enough to use ready-made scalatest/Play test harnesses, then you won't have this problem as the updated versions of `OneAppPerSuite`, `OneServerPerSuite` et al handle all of this for you\n\n5. If you were using other Play plugins in play.plugins (with the exception of HMRC health the migration of which is handled for you), then you also need to ensure that you update to use \"moduled\" versions of these and declare them in your application.conf. There is an example repo for the HNRC's ReactiveMongo plugin at `example-play-25-mongo-microservice`.\n\nAfter this step has been completed, your project will still probably not compile. Hopefully, you have started seeing compilation errors related to filters, which are covered next.","distinct":true,"url":"https://api.github.com/repos/hmrc/example-play-25-microservice/commits/bf2c96e2b30337c088ae5589dfc1909d74896c17"},{"sha":"7657e65062e9e5ce9e214813c0d6849e0d1e9352","author":{"name":"Christopher Townson","email":"1ab404878e46d892882bc722116d6f5877434cec@gmail.com"},"message":"Step 5: fix the inevitable compilation errors\n\nIt is almost 100% certain that you will now have a non-compiling project. The volume of compilation errors will obviously depend on the size of your project and its usage of the Play APIs. Attempts have been made wherever possible in supporting HMRC libraries to mitigate the effects of this.\n\nOne example of this is the requirement for filters to now provide an Akka Materializer. The microservice-bootstrap library provides a MicroserviceFilterSupport mixin trait which does this for you.\n\nSimilarly, the deprecation of FakeApplication in Play 2.5 is misleading as, in reality, it just won't work as intended for a Play 2.5 application that uses any form of DI anywhere (which HMRC Play 2.5 requires due to use of metrics-play). Therefore, the `WithFakeApplication` test mixin trait has replaced FakeApplication with GuiceApplicationBuilder which should, with any luck, transparently resolve this problem for you.\n\nConsequently, for an empty microservice created using init-service, the only compilation error that needed fixing was to make filters work by adding the `MicroserviceFilterSupport` trait.\n\nIf, like me, you are using scalatest+play, you should have remembered, unlike me, to update it with the other dependencies in step 3. `\"org.scalatestplus\" %% \"play\" % \"1.2.0\" % scope` has been superseded by `\"org.scalatestplus.play\" %% \"scalatestplus-play\" % \"1.5.1\"`.\n\nBy the time you complete this step, your project should build. It may even pass your tests, depending how thorough they are. However, it is certainly not yet fully-functional as there is one absolutely critical final step.","distinct":true,"url":"https://api.github.com/repos/hmrc/example-play-25-microservice/commits/7657e65062e9e5ce9e214813c0d6849e0d1e9352"},{"sha":"df112d68d2b20b85e13b06abd5bd437c42353e90","author":{"name":"Christopher Townson","email":"1ab404878e46d892882bc722116d6f5877434cec@gmail.com"},"message":"Step 6: CRITICAL make Play use your GlobalSettings for request handling\n\nBy default, Play 2.5 no longer calls application lifecycle event methods in GlobalSettings, instead using DI-based components. However, they do provide an out-of-the-box HttpRequestHandler implementation that will simply delegate back to the corresponding lifecycle event method in your GlobalSettings. You MUST use this in order for a great deal of HMRC functionality (and metrics) to work properly:\n\n1. Add `play.http.requestHandler = \"play.api.http.GlobalSettingsHttpRequestHandler\"` to you conf/application.conf\n\nCogratulations! You have migrated your microservice to Play 2.5!","distinct":true,"url":"https://api.github.com/repos/hmrc/example-play-25-microservice/commits/df112d68d2b20b85e13b06abd5bd437c42353e90"},{"sha":"116825b6a09b08b5638f947b55c1cc86fa915aa0","author":{"name":"Christopher Townson","email":"1ab404878e46d892882bc722116d6f5877434cec@gmail.com"},"message":"Step 7: rename application-logger.xml to logback.xml\n\nPlay 2.5 now works with logback defaults. Consequently, the `application-logger.xml` console and file logger configuration which is provided for developer convenience is no longer applied. This won't have any functional impact on your app or its logging in a deployment environment but you may want the developer logging back.\n\n1. Rename `conf/application-logger.xml` to `conf/logback.xml`","distinct":true,"url":"https://api.github.com/repos/hmrc/example-play-25-microservice/commits/116825b6a09b08b5638f947b55c1cc86fa915aa0"},{"sha":"bb4731b8f52c2507a28eee7e633e42e4ffc639f9","author":{"name":"Christopher Townson","email":"1ab404878e46d892882bc722116d6f5877434cec@gmail.com"},"message":"Step 8: make Guice logging quieter\n\nGuice logs the classpath that will be scanned at DEBUG level. This is usually very long and can spam your console log. If you want or need to turn it off, configure the appender in logback.xml for `com.google.inject`","distinct":true,"url":"https://api.github.com/repos/hmrc/example-play-25-microservice/commits/bb4731b8f52c2507a28eee7e633e42e4ffc639f9"},{"sha":"2f55f5b81a1ac4f44a3b0fe693f36f3fe4d01ae8","author":{"name":"Christopher Townson","email":"1ab404878e46d892882bc722116d6f5877434cec@gmail.com"},"message":"Example per-case configuration using OneAppPerTest\n\nI won't pretend that the support for this in OneAppPerTest is especially elegant nor that my solution is the best. Please feel free to improve!","distinct":true,"url":"https://api.github.com/repos/hmrc/example-play-25-microservice/commits/2f55f5b81a1ac4f44a3b0fe693f36f3fe4d01ae8"}]}
{"actor":{"display_login":"franekrichardson"}}