Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Play v2.9, Scala 2.13, Java 11 #349

Merged
merged 7 commits into from Feb 14, 2024
Merged

Commits on Jan 23, 2024

  1. Upgrade to Play v2.9, Scala 2.13, Java 11

    These upgrades were prompted by guardian/atom-maker#94,
    but they're all a good idea anyway:
    
    * Play: 2.8 → 2.9
    * Scala: 2.12 → 2.13
    * Java: 8 → 11
    rtyley committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    6716668 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2024

  1. Configuration menu
    Copy the full SHA
    6c52f1a View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2024

  1. Use a longer stub value for play.http.secret.key

    https://www.playframework.com/documentation/2.9.x/ApplicationSecret
    
    Note that as atom-workshop currently doesn't _use_ the PLAY_SESSION
    cookie for anything (mainly because it uses
    https://github.com/guardian/pan-domain-authentication for authentication)
    it's probably okay for play.http.secret.key to _not_ be secret (which it
    isn't, being in this public repo) - but it _does_ need to be long enough
    to satisfy the Playframework and JJWT:
    
    playframework/playframework#10726
    
    If atom-workshop ever _does_ use the PLAY_SESSION cookie, it should
    adopt https://github.com/guardian/play-secret-rotation to stay secure.
    rtyley committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    8ed37f8 View commit details
    Browse the repository at this point in the history
  2. Use play.http.parser.maxMemoryBuffer config

    Prompted by this error message in the logs:
    
    application.conf @ file:/usr/share/atom-workshop/conf/application.conf: 9: parsers.text.maxLength is deprecated, use play.http.parser.maxMemoryBuffer instead
    
    Apparently the parsers.text.maxLength property has been deprecated since
    Play 2.4 and playframework/playframework#4093
    
    https://www.playframework.com/documentation/2.9.x/ScalaBodyParsers#Max-content-length
    
    In atom-workshop, the increased size was set to allow bigger chart atoms:
    
    #272
    rtyley committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    e0e1db4 View commit details
    Browse the repository at this point in the history
  3. Fix application.home problem in logback config

    Prompted by this error in the logs:
    
    Jan 26, 2024 @ 12:06:34.865	12:06:32,373 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(application.home_IS_UNDEFINED/logs/application.log,true) call failed. java.io.FileNotFoundException: application.home_IS_UNDEFINED/logs/application.log (No such file or directory)
    
    See also:
    
    * https://stackoverflow.com/a/47331903
    * https://github.com/guardian/ophan/blob/2ecb80da40915ce097e4a1de0e29b352b396323e/dashboard/conf/logback.xml#L16-L19
    rtyley committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    9f013aa View commit details
    Browse the repository at this point in the history
  4. Fix NoSuchMethodError for DiscardingCookie

    Prompted by this in the logs:
    
    Jan 26, 2024 @ 16:44:08.273	java.lang.NoSuchMethodError: 'void play.api.mvc.DiscardingCookie.<init>(java.lang.String, java.lang.String, scala.Option, boolean)'
    Jan 26, 2024 @ 16:44:08.273		at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    Jan 26, 2024 @ 16:44:08.273		at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656
    Jan 26, 2024 @ 16:44:08.271		at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
    Jan 26, 2024 @ 16:44:08.271		at com.gu.pandomainauth.action.AuthActions.com$gu$pandomainauth$action$AuthActions$$discardCookies$(Actions.scala:102)
    
    I had forgotten to update the version of Panda used - we're upgrading
    to Play 2.9, so we need pan-domain-auth-play_2-9.
    rtyley committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    459b5bf View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2024

  1. Set CI Java version to match AMI Java version (11)

    I'm not sure why I set the CI Java version to 17 (other than I have
    started using that Java version elsewhere) - but as the AMI is only
    `editorial-tools-focal-java11-ARM-WITH-cdk-base`, when the server
    tried to run code that had been compiled with Java 17, it gave an
    UnsupportedClassVersionError like this in the logs:
    
    play.api.UnexpectedException: Unexpected exception[RuntimeException: java.lang.UnsupportedClassVersionError: controllers/routes has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0]
    	at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:384)
    rtyley committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    6eee1b8 View commit details
    Browse the repository at this point in the history