Skip to content

Update Java and CORS template docs - #362

Merged
alexellis merged 3 commits into
openfaas:masterfrom
welteki:update-java-template-docs
Sep 29, 2026
Merged

alexellis merged 3 commits into
openfaas:masterfrom
welteki:update-java-template-docs

Conversation

@welteki

@welteki welteki commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Description

Update the Java OpenJDK 11 tutorial to state that the templates use Eclipse Temurin on Ubuntu 24.04 Noble, and replace the removed Gradle compile dependency configuration with implementation.

Refresh the CORS post with current HTTP template names: replace Node 12 with Node 26, retain the supported golang-http and golang-middleware templates, and update the Python and .NET template names. Retain java11-vert-x and ruby-http.

Motivation and Context

This documentation update accompanies openfaas/templates#321 and openfaas/templates#319. The Java templates are moving away from removed OpenJDK image tags, and the affected website content needs to reflect the current images, Gradle syntax, and HTTP templates.

Have you applied the editorial and style guide to your post?

Yes.

How have you tested the instructions for any tutorial steps?

Verified the image names and Gradle version against the templates change, checked the CORS template names against the upstream template repositories and template store, and ran git diff --check.

Types of changes

  • New blog post
  • Updating an existing blog post
  • Updating part of an existing page
  • Adding a new page

Checklist:

  • I have given attribution for any images I have used and have permission to use them under Copyright law
  • My code follows the writing-style of the publication and I have checked this
  • I have read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s

@reviewfn

This comment has been minimized.

@welteki welteki changed the title Update Java template docs for Temurin/Noble Update Java and CORS template docs Sep 28, 2026
@reviewfn

This comment has been minimized.

@reviewfn

This comment has been minimized.

@welteki
welteki force-pushed the update-java-template-docs branch 2 times, most recently from 447e36c to 396e627 Compare September 28, 2026 14:24
@reviewfn

This comment has been minimized.

@reviewfn

This comment has been minimized.

@welteki
welteki force-pushed the update-java-template-docs branch 2 times, most recently from 396e627 to 9769a72 Compare September 28, 2026 14:37
@reviewfn

This comment has been minimized.

@welteki
welteki force-pushed the update-java-template-docs branch from 9769a72 to 4ccff05 Compare September 28, 2026 17:12
@reviewfn

This comment has been minimized.

Refresh the Java walkthrough so it matches the current templates and works end
to end. The templates now use Eclipse Temurin on Ubuntu 24.04 Noble, while the
article still referenced older base images, repositories, handler contracts,
dependencies, and external services.

- Document the Temurin/Noble base images and Maven Central.
- Use Gradle declarations compatible with each template runtime.
- Align handler types and generated YAML filenames with current faas-cli output.
- Replace the unavailable quote service and refresh tested examples.
- Correct the java11-vert-x template name in the CORS guide.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
Align the homepage Java 11 snippet with the current template and
entrypoint contract. Implementing IHandler directly causes the
entrypoint to reject the handler at runtime because it expects an
AbstractHandler subtype.

Extend com.openfaas.model.AbstractHandler explicitly so the displayed
example matches the generated template and runs correctly.

Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
@welteki
welteki force-pushed the update-java-template-docs branch from 4ccff05 to 889a4ee Compare September 28, 2026 17:29
@reviewfn

reviewfn Bot commented Sep 28, 2026

Copy link
Copy Markdown

AI Pull Request Overview

Disclaimer: This review was generated by automated AI and may contain errors. Do not trust its outputs without human verification.

Summary

  • Documentation-only PR updating Java OpenJDK 11 tutorial content, Java landing-page sample code, and CORS template names.
  • The Java examples mostly align with the newer handler base class and java11-vert-x naming.
  • The CORS template list is refreshed to current template names.
  • One Java tutorial dependency snippet still uses the removed Gradle compile configuration, which undercuts the stated migration goal.

Approval rating (1-10)

7/10. The scope is useful, but the Java tutorial still contains a dependency syntax regression that can break readers following the updated steps.

Summary per file

Summary per file
File path Summary
_includes/landing-page/code-examples/java.html Updates Java sample to extend AbstractHandler.
_posts/2020-01-30-get-started-with-java-openjdk11.md Refreshes Java tutorial images, APIs, commands, examples, and links.
_posts/2020-04-08-function-cors.md Updates CORS-compatible template names.

Overall Assessment

The PR moves stale documentation in the right direction and fixes several outdated references. However, the updated Java tutorial still tells readers to add OkHttp dependencies with Gradle's removed compile configuration, while the PR's purpose is explicitly to replace that syntax. That is a concrete reproducibility issue for the primary tutorial path and should be fixed before merge.

Detailed Review

Detailed Review

Content review

Medium: Java tutorial still uses removed Gradle compile configuration for OkHttp dependencies

In _posts/2020-01-30-get-started-with-java-openjdk11.md lines 152-159, the tutorial says to keep the template dependencies and add:

compile 'com.squareup.okhttp3:okhttp:3.10.0'
compile 'com.squareup.okio:okio:1.14.1'

This is the same removed Gradle configuration the PR description says it is replacing. The later Vert.x dependency snippet was updated to implementation, so readers following Example 1 can still hit a Gradle configuration failure or copy outdated syntax into the refreshed Java 11 template. Use implementation for both OkHttp dependencies:

implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okio:okio:1.14.1'

The title and excerpt still match the article's scope: getting started with Java 11 and Vert.x on OpenFaaS. The opening clearly explains the image and dependency-source changes. The Example 1 flow is otherwise coherent after switching from QuoteGarden to DummyJSON, and the CORS article's changed section is concise and limited to template-name maintenance.

AI agent details.

Agent processing time: 1m9.829s
Environment preparation time: 5.891s
Total time from webhook: 1m29.867s

@welteki
welteki marked this pull request as ready for review September 28, 2026 17:31
@welteki

welteki commented Sep 28, 2026 •

Copy link
Copy Markdown
Member Author

Medium: Java tutorial still uses removed Gradle compile configuration for OkHttp dependencies

The blog post is correct the Java11 template uses an older Gradle version. Question is if the template should be modernized.

@alexellis
alexellis merged commit 2b41f10 into openfaas:master Sep 29, 2026
1 check passed
@alexellis

Copy link
Copy Markdown
Member

A newer Java template is worth creating - but I would imagine it'd be vert-x only not Java 11 which is very old at this point.

Java 21 runs to at least September 2028. Java 25 is now the current LTS

That'd be a new template, triaged on Trello and managed properly, with updated/latest vert-x patterns and version. Gradle again too - but updated.

@welteki
welteki deleted the update-java-template-docs branch September 29, 2026 08:13
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