Skip to content

Feature/java21#52

Merged
sliu008 merged 10 commits into
developfrom
feature/java21
Jun 24, 2026
Merged

Feature/java21#52
sliu008 merged 10 commits into
developfrom
feature/java21

Conversation

@sliu008

@sliu008 sliu008 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #51

This pull request upgrades the project from Java 11 to Java 21 and updates related dependencies, build tools, and CI/CD workflows accordingly. It also improves test reliability by fixing file path handling in tests and modernizes the Docker and Gradle configurations. Below are the most important changes grouped by theme:

Java and Gradle Upgrade:

  • Upgraded the codebase, Dockerfile, and build/test workflows from Java 11 to Java 21, and from Gradle 7.6.4 to Gradle 8.8. Updated the documentation (README.md, CHANGELOG.md) to reflect these requirements. [1] [2] [3] [4] [5] [6] [7]

CI/CD and Workflow Modernization:

  • Updated GitHub Actions to use the latest versions of actions (e.g., actions/checkout, actions/setup-java, gradle/actions/setup-gradle, docker/build-push-action, hashicorp/setup-terraform, actions/add-to-project, actions/github-script, ncipollo/release-action) for improved reliability and compatibility. [1] [2] [3] [4] [5] [6]

Code Improvements and Test Reliability:

  • Refactored FootprintHandler to add getter methods for environment variables and updated internal usage for better maintainability and testability. [1] [2]
  • Improved FootprintHandlerTest by using TemporaryFolder to create real, writable temporary files instead of relying on resource files, making tests more robust and portable. [1] [2]

Docker and Dependency Updates:

  • Updated the Docker image base from amazoncorretto:11 to amazoncorretto:21, upgraded the Cumulus Message Adapter, and ensured Gradle and related paths are consistent with the new version. [1] [2] [3]

Terraform Provider Modernization:

  • Updated Terraform provider blocks to use the new source syntax, improving compatibility with recent Terraform versions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request upgrades Forge’s runtime/tooling baseline to Java 21 + Gradle 8.8 and aligns build/CI, Docker, and infrastructure configuration with that modernization, while also adjusting footprint handling code to be more testable.

Changes:

  • Upgraded Java/Gradle across the build (Gradle wrapper + toolchains), Docker image, and GitHub Actions workflows.
  • Refactored FootprintHandler env access (added getters) and updated tests to use a real writable output path.
  • Modernized Terraform provider declarations to the source = syntax.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
terraform/main.tf Updates provider declarations to modern Terraform provider source syntax.
src/test/java/gov/nasa/podaac/forge/FootprintHandlerTest.java Adjusts footprint handler tests to use a writable temporary output file path.
src/main/java/gov/nasa/podaac/forge/FootprintHandler.java Adds env-var getter methods and routes output config usage through them.
README.md Updates local runtime requirement to Java 21.
gradle/wrapper/gradle-wrapper.properties Upgrades Gradle wrapper distribution to 8.8.
docker/Dockerfile Moves base image to Corretto 21 and updates bundled Gradle/CMA versions.
CHANGELOG.md Documents the Java 21 modernization in Unreleased notes.
build.gradle Migrates build to Java 21 toolchains, refreshes dependencies/plugins, and updates tasks/reporting config for Gradle 8+.
.github/workflows/release-created.yml Updates release-branch automation to JDK 21 and newer Gradle action.
.github/workflows/build.yml Updates CI to JDK 21/Gradle 8.8 and refreshes action versions.
.github/workflows/add-to-project.yml Refreshes action versions for project automation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/gov/nasa/podaac/forge/FootprintHandler.java
Comment on lines +51 to +65
// 1. Initialize the temp folder
tempFolder.create();

@Test
public void testPerformFunctionURL() throws Exception {
ClassLoader classLoader = getClass().getClassLoader();

// 1. Handle Inputs (Existing logic)
File inputJsonFile = new File(classLoader.getResource("input.json").getFile());
inputMessageStr = new String(Files.readAllBytes(inputJsonFile.toPath()));
String inputMessageStr = new String(Files.readAllBytes(inputJsonFile.toPath()));

File granuleFile = new File(classLoader.getResource("20200101152000-JPL-L2P_GHRSST-SSTskin-MODIS_A-D-v02.0-fv01.0.nc").getFile());
File configFile = new File(classLoader.getResource("MODIS_A-JPL-L2P-v2019.0.cfg").getFile());
File outputFile = new File(classLoader.getResource("footprint.txt").getFile());
granuleFilePath = granuleFile.getAbsolutePath();
cfgFilePath = configFile.getAbsolutePath();
outputFootprintFilePath = outputFile.getAbsolutePath();

// 2. FIX: Create a real, writable path for the output instead of a resource
File tempOutputFile = tempFolder.newFile("footprint.txt");
String outputFootprintFilePath = tempOutputFile.getAbsolutePath();
Comment thread terraform/main.tf
Comment on lines +12 to +17
aws = {
source = "hashicorp/aws"
}
null = {
source = "hashicorp/null"
}
sliu008 and others added 2 commits June 23, 2026 14:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sliu008
sliu008 requested a review from jamesfwood June 23, 2026 21:14
@sliu008
sliu008 merged commit 004a569 into develop Jun 24, 2026
3 checks passed
@sliu008
sliu008 deleted the feature/java21 branch June 24, 2026 23:52
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.

Upgrade Java in forge to 21 (AWS Lambda)

3 participants