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

Ludo java21 #9882

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Ludo java21 #9882

wants to merge 16 commits into from

Conversation

ludoch
Copy link
Contributor

@ludoch ludoch commented Dec 16, 2024

Description

Move all GAE java8 runtime (which is now EOL) to the latest GAE java21 runtime, using the compatible EE8 setting.
This way, the java source code should not change (i.e same servlets code), and only the xml config files, like appengine-web.xml are changed.
Manually tested with local devappserver as well as deployed to my cloud project.

Cannot submit without doing the Google public pages changes seen in pending cl/691482072 internally.
I am coordinating with the Google Cloud doc folks.

Checklist

  • I have followed Sample Format Guide
  • pom.xml parent set to latest shared-configuration
  • Appropriate changes to README are included in PR
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • Tests pass: mvn clean verify required
  • Lint passes: mvn -P lint checkstyle:check required
  • Static Analysis: mvn -P lint clean compile pmd:cpd-check spotbugs:check advisory only
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: bigtable Issues related to the Bigtable API. labels Dec 16, 2024
Copy link
Contributor

Gemini encountered an error creating the summary. You can try again by commenting @code-review-assist summarize.

@ludoch
Copy link
Contributor Author

ludoch commented Dec 17, 2024

@code-review-assist summarize

Copy link
Contributor

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

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

Hi @ludoch, Gemini is currently reviewing this pull request and will post a full review in a few minutes. In the meantime, here's a quick summary for you and other reviewers:

This pull request migrates all Java 8 App Engine samples to the latest Java 21 runtime. The goal is to update the samples to a supported runtime, while minimizing changes to the core servlet code. The primary changes involve modifying the appengine-web.xml files in each sample to specify the Java 21 runtime and using the compatible EE8 setting. Additionally, several README.md files have been updated to reflect the Java 21 runtime. The pom.xml files in several samples have also been updated to reflect the new artifact IDs.

Specifically, the following files were modified:

  • appengine-java21/README.md
  • appengine-java21/analytics/README.md, appengine-java21/analytics/pom.xml, appengine-java21/analytics/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/appidentity/README.md, appengine-java21/appidentity/pom.xml, appengine-java21/appidentity/src/main/java/com/example/appengine/appidentity/IdentityServlet.java, appengine-java21/appidentity/src/main/java/com/example/appengine/appidentity/SignForAppServlet.java, appengine-java21/appidentity/src/main/java/com/example/appengine/appidentity/UrlShortener.java, appengine-java21/appidentity/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/bigquery/README.md, appengine-java21/bigquery/pom.xml, appengine-java21/bigquery/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/bigtable/README.md, appengine-java21/bigtable/build.gradle, appengine-java21/bigtable/pom.xml, appengine-java21/bigtable/settings.gradle, appengine-java21/bigtable/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/bigtable/src/main/webapp/WEB-INF/logging.properties, appengine-java21/bigtable/src/main/webapp/bigtable.jsp
  • appengine-java21/cloudsql/README.md
  • appengine-java21/datastore-indexes-exploding/pom.xml, appengine-java21/datastore-indexes-exploding/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/datastore-indexes-perfect/pom.xml, appengine-java21/datastore-indexes-perfect/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/datastore-indexes/pom.xml, appengine-java21/datastore-indexes/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/datastore-schedule-export/cron.yaml, appengine-java21/datastore-schedule-export/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/datastore-schedule-export/src/main/webapp/WEB-INF/logging.properties, appengine-java21/datastore-schedule-export/src/main/webapp/index.jsp
  • appengine-java21/datastore/README.md, appengine-java21/datastore/pom.xml, appengine-java21/datastore/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/datastore/src/test/java/com/example/appengine/QueriesTest.java
  • appengine-java21/firebase-tictactoe/README.md, appengine-java21/firebase-tictactoe/pom.xml, appengine-java21/firebase-tictactoe/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/firebase-tictactoe/src/main/webapp/WEB-INF/logging.properties
  • appengine-java21/gaeinfo/README.md, appengine-java21/gaeinfo/pom.xml, appengine-java21/gaeinfo/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/gaeinfo/src/main/webapp/WEB-INF/logging.properties
  • appengine-java21/guestbook-cloud-datastore/README.md, appengine-java21/guestbook-cloud-datastore/pom.xml, appengine-java21/guestbook-cloud-datastore/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/guestbook-cloud-datastore/src/main/webapp/WEB-INF/index.yaml, appengine-java21/guestbook-cloud-datastore/src/main/webapp/WEB-INF/logging.properties
  • appengine-java21/iap/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/images/README.md, appengine-java21/images/pom.xml, appengine-java21/images/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/mail/pom.xml, appengine-java21/mail/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/mail/src/main/webapp/WEB-INF/logging.properties
  • appengine-java21/mailgun/README.md, appengine-java21/mailgun/pom.xml, appengine-java21/mailgun/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/mailjet/README.md, appengine-java21/mailjet/pom.xml, appengine-java21/mailjet/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/memcache/pom.xml, appengine-java21/memcache/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/metadata/README.md, appengine-java21/metadata/pom.xml, appengine-java21/metadata/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/oauth2/README.md, appengine-java21/oauth2/pom.xml, appengine-java21/oauth2/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/pubsub/README.md, appengine-java21/pubsub/src/main/java/com/example/appengine/pubsub/PubSubAuthenticatedPush.java, appengine-java21/pubsub/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/remote-README.md, appengine-java21/remote-client/pom.xml, appengine-java21/remote-server/pom.xml, appengine-java21/remote-server/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/requests/README.md, appengine-java21/requests/pom.xml, appengine-java21/requests/src/main/java/com/example/appengine/requests/LoggingServlet.java, appengine-java21/requests/src/main/java/com/example/appengine/requests/RequestsServlet.java, appengine-java21/requests/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/search/README.md, appengine-java21/search/pom.xml, appengine-java21/search/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/sendgrid/README.md, appengine-java21/sendgrid/pom.xml, appengine-java21/sendgrid/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/spanner/README.md, appengine-java21/spanner/pom.xml, appengine-java21/spanner/src/main/webapp/WEB-INF/appengine-web.xml
  • appengine-java21/sparkjava-helloworld/README.md, appengine-java21/sparkjava-helloworld/pom.xml, appengine-java21/sparkjava-helloworld/src/main/java/HelloWorld.java, appengine-java21/sparkjava-helloworld/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/sparkjava-helloworld/src/main/webapp/WEB-INF/logging.properties
  • appengine-java21/springboot-helloworld/.mvn/wrapper/maven-wrapper.properties, appengine-java21/springboot-helloworld/lombok.config, appengine-java21/springboot-helloworld/mvnw, appengine-java21/springboot-helloworld/mvnw.cmd, appengine-java21/springboot-helloworld/pom.xml, appengine-java21/springboot-helloworld/src/main/java/com/example/appengine/demos/springboot/AppEngineConfig.java, appengine-java21/springboot-helloworld/src/main/java/com/example/appengine/demos/springboot/HelloworldController.java, appengine-java21/springboot-helloworld/src/main/java/com/example/appengine/demos/springboot/ServletInitializer.java, appengine-java21/springboot-helloworld/src/main/java/com/example/appengine/demos/springboot/SpringBootExampleApplication.java, appengine-java21/springboot-helloworld/src/main/java/com/example/appengine/demos/springboot/WebAppConfiguration.java, appengine-java21/springboot-helloworld/src/main/resources/application.yml, appengine-java21/springboot-helloworld/src/main/resources/logging.properties, appengine-java21/springboot-helloworld/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/springboot-helloworld/src/main/webapp/WEB-INF/datastore-indexes.xml, appengine-java21/springboot-helloworld/src/main/webapp/WEB-INF/jsp/index.jsp, appengine-java21/springboot-helloworld/src/main/webapp/WEB-INF/web.xml, appengine-java21/springboot-helloworld/src/test/java/com/example/appengine/demos/springboot/SpringBootExampleApplicationTests.java
  • appengine-java21/static-files/pom.xml, appengine-java21/static-files/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/static-files/src/main/webapp/index.html
  • appengine-java21/taskqueues-deferred/README.md, appengine-java21/taskqueues-deferred/pom.xml, appengine-java21/taskqueues-deferred/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/taskqueues-deferred/src/main/webapp/WEB-INF/logging.properties
  • appengine-java21/taskqueues-pull/README.md, appengine-java21/taskqueues-pull/pom.xml, appengine-java21/taskqueues-pull/src/main/webapp/WEB-INF/appengine-web.xml, appengine-java21/taskqueues-pull/src/main/webapp/WEB-INF/logging.properties
  • appengine-java21/taskqueues-push/README.md, appengine-java21/taskqueues-push/pom.xml, appengine-java21/taskqueues-push/src/main/webapp/WEB-INF/appengine-web.xml

This is a significant update, so thorough testing is crucial. Let me know if you have any questions.

Small changes, big impact,
Java's new version's a pact,
Modernizing code's art.

@ludoch ludoch removed the api: bigtable Issues related to the Bigtable API. label Dec 17, 2024
@ludoch ludoch marked this pull request as ready for review December 17, 2024 23:01
@ludoch ludoch requested review from yoshi-approver and a team as code owners December 17, 2024 23:01
@ludoch
Copy link
Contributor Author

ludoch commented Dec 17, 2024

We need to wait that cl/691482072 is also done, and will need to coordinate the 2 changes at the same time.

@ludoch
Copy link
Contributor Author

ludoch commented Dec 17, 2024

Also, I cannot see any more information about the check "Inclusive Language Completed in 21s — Check failed due to error"
Where is the real output?

@@ -1,7 +1,7 @@
App Engine Java Guestbook
Copyright (C) 2010-2012 Google Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you modify this to be the correct format for showing copyright with just the first year and not the span.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link

snippet-bot bot commented Dec 17, 2024

Here is the summary of possible violations 😱

There are 145 possible violations for not having product prefix.
There is a format violation for a region tag.

The end of the violation section. All the stuff below is FYI purposes only.


Here is the summary of changes.

You are about to add 196 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@iennae
Copy link
Contributor

iennae commented Dec 17, 2024

looks like we need to fix [ERROR] Failed to execute goal on project gaeinfo-j21: Could not resolve dependencies for project com.example.appengine:gaeinfo-j21:war:1.0-SNAPSHOT: Could not transfer artifact com.squareup.okhttp3:okhttp:jar:4.12.0 from/to central (https://repo.maven.apache.org/maven2): GET request of: com/squareup/okhttp3/okhttp/4.12.0/okhttp-4.12.0.jar from central failed: Connection reset -> [Help 1]

@iennae
Copy link
Contributor

iennae commented Dec 18, 2024

snippetbot is complaining because a lot of region tags need the gae prefix. can you either remove the region tags (if they aren't used anymore or needed, might be a space for improvements to documentation) or rename to append the gae product prefix?

@ludoch
Copy link
Contributor Author

ludoch commented Dec 18, 2024

snippetbot is complaining because a lot of region tags need the gae prefix. can you either remove the region tags (if they aren't used anymore or needed, might be a space for improvements to documentation) or rename to append the gae product prefix?

So we are saying that all these added regions over the last 10+ years are not correct? Not sure how I can verify the correctness of tags. Where is the list of valid tags? Where is it documented, I want to put the correct strings.

@@ -1,5 +1,5 @@
/*
* Copyright 2015 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave the year to 2015. Inc to LLC is correct.

@@ -1,5 +1,5 @@
/*
* Copyright 2016 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

keep copyright year as 2016

@@ -1,5 +1,5 @@
/*
* Copyright 2016 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

keep copyright year as original

<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

# Google Cloud API Showcase: BigQuery & Cloud Monitoring in App Engine standard environment for Java 8
# Google Cloud API Showcase: BigQuery & Cloud Monitoring in App Engine standard environment for Java 21

This API Showcase demonstrates how to run an App Engine standard environment application with dependencies on both
Copy link
Contributor

Choose a reason for hiding this comment

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

I think [StackDriver Monitoring] needs to get updated to Cloud Monitoring

@@ -1,5 +1,5 @@
<!--
Copyright 2018 Google Inc.
Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave the original copyright year

@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave the original year

@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave the original year

@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave the original year

@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave the original year

@@ -1,5 +1,5 @@
/*
* Copyright 2016 Google Inc.
* Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave original year

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

leave original year

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google Inc.
Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave the year

@@ -3,7 +3,7 @@
<%@ page import="com.example.bigtable.BigtableHelloWorld" %>
<!-- [START_EXCLUDE] -->
<%--
~ Copyright 2017 Google Inc.
~ Copyright 2024 Google LLC
Copy link
Contributor

Choose a reason for hiding this comment

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

leave the year

@@ -19,9 +19,9 @@
# To use this configuration, copy it into your application's WEB-INF
# folder and add the following to your appengine-web.xml:
#
# <system-properties>
# <system-properties>
Copy link
Contributor

Choose a reason for hiding this comment

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

this also looks like an accidental change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants