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 Java 11 #107

Merged
merged 13 commits into from
Apr 8, 2024
Merged

Upgrade to Java 11 #107

merged 13 commits into from
Apr 8, 2024

Conversation

lindseydew
Copy link
Contributor

@lindseydew lindseydew commented Mar 25, 2024

What does this change?

This updates the run time environment of the app to Java 11

How to test

Using the iOS Simulator

  • Able to display saved articles
  • Able to remove all articles
  • Able to add a new article

Using the lambda console

  • Ability to delete a user

@lindseydew lindseydew requested a review from rtyley March 25, 2024 11:18
@lindseydew lindseydew mentioned this pull request Mar 25, 2024
7 tasks
@lindseydew lindseydew force-pushed the ld/upgrade-11-after-dynamo-upgrade branch from c8c55d7 to 1a7bfe5 Compare March 25, 2024 11:33
@rtyley rtyley mentioned this pull request Mar 26, 2024
4 tasks
Base automatically changed from ld/upgrade-dynamo-sync to main March 27, 2024 10:27
@rtyley rtyley force-pushed the ld/upgrade-11-after-dynamo-upgrade branch from 023043b to c62c41b Compare March 27, 2024 16:36
Some changes in this commit:

* Non scala changes for java upgrade
* Remove jackson mapper
* Add notes for testing on CODE
@rtyley rtyley force-pushed the ld/upgrade-11-after-dynamo-upgrade branch from c62c41b to 6b346d4 Compare March 27, 2024 16:42
Copy link
Member

@rtyley rtyley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the extra documentation in docs/testing/user-deletion.md & README.md, brilliant work!

New files being added...

There's 3 files being added with this PR, that I'm not sure of why they're being added:

  • cdk/yarn.lock
  • mobile-save-for-later-user-deletion/template.yml
  • mobile-save-for-later/template.yml

Are the template.yml ones auto-generated - do they need to be committed in order for deploy to work, or are they involved in manual deploy steps? I'm kind of surprised to see them if this project is using GuCDK- maybe they should be added to .gitignore? It would reduce the size of this diff if they were excluded.

MergeFilesStrategy

This is the biggest code change included in this PR - as noted in build.sbt, could we add some context on why the change is necessary? Is it because sbt-assembly has been upgraded?

BTW I actually will be around in the office this morning if you want to chat/pair on any of this in person!

.github/workflows/ci-mobile-save-for-later.yaml Outdated Show resolved Hide resolved
.github/workflows/ci-mobile-save-for-later.yaml Outdated Show resolved Hide resolved
build.sbt Show resolved Hide resolved
cdk/lib/mobile-save-for-later.ts Show resolved Hide resolved
build.sbt Outdated
Comment on lines 54 to 93
case "META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat" =>
new MergeFilesStrategy
case PathList(ps @ _*) if ps.last equalsIgnoreCase "Log4j2Plugins.dat" =>
import java.io.FileInputStream
import java.io.FileOutputStream
import org.apache.logging.log4j.core.config.plugins.processor.PluginCache

import scala.collection.JavaConverters.asJavaEnumerationConverter

import sbt.io.{IO, Using}
import sbtassembly.Assembly.Dependency

CustomMergeStrategy("Log4j2Plugins") { conflicts =>
val dependencyStreamResource =
Using.resource((dependency: Dependency) => dependency.stream())
val tempDir = "target/log4j2-plugin-cache"
val urls = conflicts
.map { conflict =>
dependencyStreamResource(conflict) { is =>
val file = new File(
s"$tempDir/${conflict.module.get.jarName}-Log4j2Plugins.dat"
)
IO.write(file, IO.readBytes(is))
file.toURI.toURL
}
}
val aggregator = new PluginCache()
aggregator.loadCacheFiles(urls.toIterator.asJavaEnumeration)
val pluginCache = new File(s"$tempDir/Log4j2Plugins.dat")
val pluginCacheOutputStream = new FileOutputStream(pluginCache)
aggregator.writeCache(pluginCacheOutputStream)
pluginCacheOutputStream.close()
Right(
Vector(
JarEntry(
conflicts.head.target,
() => new FileInputStream(pluginCache)
)
)
)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this chunk of code has come from project/MergeFilesStrategy.scala, and taken on some more modifications?

It's quite a big and obscure bit of code though, so I feel like keeping it in its own file in MergeFilesStrategy.scala is not a bad idea - we should probably include some explanation or references for it (like, where did we get this code, and what prompted the changes to it that are occurring now?)

project/dependencies.scala Outdated Show resolved Hide resolved
@lindseydew
Copy link
Contributor Author

Love the extra documentation in docs/testing/user-deletion.md & README.md, brilliant work!

New files being added...

There's 3 files being added with this PR, that I'm not sure of why they're being added:

  • cdk/yarn.lock
  • mobile-save-for-later-user-deletion/template.yml
  • mobile-save-for-later/template.yml

Are the template.yml ones auto-generated - do they need to be committed in order for deploy to work, or are they involved in manual deploy steps? I'm kind of surprised to see them if this project is using GuCDK- maybe they should be added to .gitignore? It would reduce the size of this diff if they were excluded.

MergeFilesStrategy

This is the biggest code change included in this PR - as noted in build.sbt, could we add some context on why the change is necessary? Is it because sbt-assembly has been upgraded?

BTW I actually will be around in the office this morning if you want to chat/pair on any of this in person!

Thanks for the thorough feedback, much appreciated :). Yes I'm in the office today, sitting on the 4th floor, a quick chat would be great if you have the time.

Copy link
Member

@rtyley rtyley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing all the fixes! Lovely work 👍

@lindseydew lindseydew merged commit e4e9f76 into main Apr 8, 2024
2 checks passed
@lindseydew lindseydew deleted the ld/upgrade-11-after-dynamo-upgrade branch April 8, 2024 13:04
@lindseydew lindseydew mentioned this pull request Apr 25, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants