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

Update ODE Java Version to Java 21 #50

Merged
merged 9 commits into from
Jan 15, 2024
Merged

Update ODE Java Version to Java 21 #50

merged 9 commits into from
Jan 15, 2024

Conversation

mwodahl
Copy link

@mwodahl mwodahl commented Jan 3, 2024

This PR Updates the Java version used by the ODE to the latest long-term support version of Java (21)

These changes have been tested by running the ODE application in the devcontainer and by examining the output of mvn clean package

  • Defect fix (non-breaking change that fixes an issue)

  • [ X ] New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that cause existing functionality to change)

  • [ X ] I have added any new packages to the sonar-scanner.properties file

  • My change requires a change to the documentation.

  • I have updated the documentation accordingly.

  • [ X ] I have read the CONTRIBUTING document.
    ODE Contributing Guide

  • [ X ] I have added tests to cover my changes.

  • [ X ] All new and existing tests passed.

Copy link
Collaborator

@drewjj drewjj left a comment

Choose a reason for hiding this comment

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

Everything functions with a docker-compose. The tests pass if I manually run them. Sonar seems to fail building the jpo-ode-common project though. Complaining about incompatibilities with Java 21. This may be a sonar configuration issue but I don't think it would be good to entirely break sonar unless we know what is going on.

Copy link
Member

@dmccoystephenson dmccoystephenson left a comment

Choose a reason for hiding this comment

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

This looks good!

Verified the following:

  • Zookeeper/kafka still works in dev container
  • Unit tests pass
  • Program starts up without issue

I left a few clarifying questions also.

@@ -148,7 +149,7 @@ public void subscribe(String... topics) {
boolean gotMessages = false;
while (isRunning) {
try {
ConsumerRecords<K, V> records = consumer.poll(CONSUMER_POLL_TIMEOUT_MS);
ConsumerRecords<K, V> records = consumer.poll(Duration.ofMillis(CONSUMER_POLL_TIMEOUT_MS));
Copy link
Member

Choose a reason for hiding this comment

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

Why was this change necessary?

@iyourshaw
Copy link

The sonar log has this error thrown by the maven compiler plugin:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project jpo-ode-common: Fatal error compiling: error: release version 21 not supported

That's happening at the compilation step, before Sonar is trying to scan or anything.

I think the java version it runs with is set in .github/workflows/ci.yaml, isn't it? That still has Java 11 configured. Have you tried changing that to 21?

https://github.com/CDOT-CV/jpo-ode/blob/update/java-lts-version/.github/workflows/ci.yml

current contents:

name: ci

on: [pull_request, push]

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Build
        uses: docker/build-push-action@v3

  sonar:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: recursive
      - name: Set up JDK
        uses: actions/setup-java@v3
        with:
          java-version: "11"
          distribution: "temurin"
      - name: Run Sonar
        env:
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        run: |
          ls -la && pwd
          mvn -e -X clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.projectKey=usdot.jpo.ode:jpo-ode -Dsonar.projectName=jpo-ode -Dsonar.organization=usdot-jpo-ode -Dsonar.host.url=https://sonarcloud.io -Dsonar.branch.name=$GITHUB_REF_NAME

@mwodahl mwodahl requested a review from drewjj January 15, 2024 15:26
Copy link
Collaborator

@drewjj drewjj left a comment

Choose a reason for hiding this comment

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

This is good now. Same old sonar failure we have seen for a long time now.

@drewjj drewjj merged commit f14a82d into dev Jan 15, 2024
3 of 4 checks passed
@drewjj drewjj deleted the update/java-lts-version branch January 15, 2024 16:14
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.

4 participants