Skip to content

fix(template): ship a buildable Spring Boot app and drop the shared ALB priority - #5

Merged
Alexanderamiri merged 1 commit into
mainfrom
fix/template-deployable
Oct 31, 2026
Merged

Alexanderamiri merged 1 commit into
mainfrom
fix/template-deployable

Conversation

@Alexanderamiri

Copy link
Copy Markdown
Member

Problem

  • The Dockerfile runs ./mvnw package, but the template has no mvnw or pom.xml. A repo created from it fails at the Docker build on its first push.
  • app.yaml sets compute.health_check: /health. A Spring Boot app serves /actuator/health unless configured otherwise, so the ALB health check would fail even once the app builds.
  • app.yaml ships routing.priority: 100. Every repo created from the template gets that same value, and the second one to deploy hits PriorityInUse (jz-watch did).
  • The README did not say plainly that the repo must be added to the GitHub team before the first push to main. CI checks repo → team before it hands out credentials.

Change

  • Adds a minimal Spring Boot 4.1 app (Java 21, Maven wrapper 3.3.4 / Maven 3.9.16). It serves GET / and GET /actuator/health on 8080 and exposes only the health actuator endpoint over HTTP. It includes a @SpringBootTest that checks both paths.
  • Dockerfile: copies the wrapper and pom first and runs dependency:go-offline so dependencies are cached between builds. It runs as USER 1000 with java.io.tmpdir=/tmp, the same as the platform's non-root, read-only-root container. Adds .dockerignore, and adds target/ to .gitignore.
  • app.yaml: sets health_check: /actuator/health and removes routing.priority. A comment explains that the platform derives a priority and when you would still set one yourself.
  • README: the Getting Started steps now run in order (register team → add repo to team → customize → push), with the warning before the first push. A new "The App" section covers running it locally. CLAUDE.md is updated to match.

Depends on

The generator on platform main still requires routing.priority (routing.priority is required: a unique integer 1-50000). Merge this after javaBin/platform#181, which derives the priority. Until then, a repo made from this template fails at the expand step.

Verification

  • docker build .: succeeds.
  • docker run --read-only --tmpfs /tmp -p 18080:8080: GET /actuator/health → {"groups":["liveness","readiness"],"status":"UP"}, GET / → 200, /actuator/env → 404, id → uid=1000.
  • ./mvnw -B verify (in eclipse-temurin:21-jdk-alpine): 2 tests, 0 failures.
  • With the generator from fix(generator): derive ALB priorities, check them at plan, require name, validate compute platform#181, generate-modules.py against this app.yaml produces health_check_path = "/actuator/health" and a derived listener_rule_priority. With the generator on platform main it fails as described above.

🤖 Generated with Claude Code

…LB priority

The Dockerfile ran ./mvnw package but the template had no mvnw or pom.xml,
so a repo made from it could not build. Add a minimal Spring Boot 4 app
(Java 21, Maven wrapper) that serves / and /actuator/health on 8080, runs as
user 1000 and only writes to /tmp, and point compute.health_check at
/actuator/health.

Remove routing.priority: 100, which every repo made from the template
shared and which collided on deploy (PriorityInUse); the platform derives
one. Order the README steps so the repo is added to the GitHub team
before the first push to main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Alexanderamiri
Alexanderamiri merged commit 237ebef into main Oct 31, 2026
1 check passed
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.

1 participant