Skip to content

Hold the finished application of the Getting Started tutorial - #14

Open
peholmst wants to merge 3 commits into
mainfrom
claude/github-issue-13-03e93a
Open

peholmst wants to merge 3 commits into
mainfrom
claude/github-issue-13-03e93a

Conversation

@peholmst

Copy link
Copy Markdown
Member

Closes #13.

Replaces the Vaadin 24.4 chat tutorial on main with the finished application of the Getting Started tutorial, and adds CI that generates, tests, and publishes a branch for every step from the tutorial in vaadin/docs.

What changed

  • main holds the finished application, as it is at the end of Add Tests. It starts from the skeleton that Set Up Project links to (platformVersion=v25.3, Vaadin 25.3.2, Spring Boot 4.1.1), with H2, Spring Data JDBC, and validation added. The code comes from the tutorial unchanged: package-private classes in com.example.product, MainLayout and ViewTitle in com.example.base.ui, and OrdersView in com.example.order.
  • The 24.4 chat tutorial stays available at the existing v24.4 tag, which already points at the last commit of the old main (95d22cd). I didn't add a v24.4 branch: a branch and a tag with the same name make v24.4 ambiguous in git. GitHub links such as /tree/v24.4 work for the tag.
  • GenerateSteps.java is a single-file Java program, run with java GenerateSteps.java <docs> <out>. It reads the tutorial pages from a vaadin/docs checkout and downloads the skeleton from the link in Set Up Project, using the attributes in _vaadin-version.adoc. It adds the <dependency> listings of each step to pom.xml and copies schema.sql and data.sql. Then, step by step, it writes the files from each "Complete Code for This Step" section on top of the previous step. Steps such as Add Navigation list only the files they change, so the steps have to build on each other.
  • commit-steps.sh commits the steps as a chain, one commit per step, on step/setup … step/add-tests. It reuses a step's commit when its tree and parent haven't changed, so a change to the docs rewrites only the step it affects and the steps after it.
  • CI runs on pushes to main, on pull requests, every Monday, and on demand. It:
    • builds main with ./mvnw verify,
    • generates the steps from the vaadin/docs branch in DOCS_REF (v25.3, the branch behind docs/latest) and runs ./mvnw verify on each step in a matrix,
    • checks that main matches the last step, except for README.md and .github, and that the README mentions every step branch,
    • on main, pushes the step branches that changed.
  • README: what the application is, how to run and test it, a table of the step branches, how to start from a step or see what a step changes, how the branches are generated, and how to update main or move to a new Vaadin version.

After merging

The step/* branches don't exist yet. The first CI run on main after the merge creates them. That job needs contents: write for GITHUB_TOKEN, which the workflow requests. If the org policy doesn't allow it, the job fails, and .github/steps/commit-steps.sh <out> --push can be run locally instead.

Once the branches exist, the tutorial index and the end of Add Tests in vaadin/docs can link here (vaadin/docs#6288, finding 5).

How it was verified

  • Generated all nine steps from vaadin/docs v25.3 (90771e4). The tutorial pages there are identical to docs main. ./mvnw verify passes on every step and on this branch. Add Tests runs 6 tests, with 0 failures.
  • Ran the finished application in a browser. The layout and menu render, selecting a row opens /products/3 with Save and Delete, and /orders shows the placeholder.
  • Tested commit-steps.sh in a scratch clone, without pushing:
    • The first run creates nine chained commits. mvnw is executable, and mvnw.cmd keeps the skeleton's CRLF blob.
    • A second run reports every branch unchanged.
    • Changing the Add Navigation output rewrites only Add Navigation, Deep Link, and Add Tests.
  • Tested the main check locally: it passes against this branch and fails with a diff against a changed step.
  • The skeleton's pom.xml names a per-download start.vaadin.com project ID in a comment. The generator drops that line, so that repeated runs give the same files.

🤖 Generated with Claude Code

peholmst and others added 3 commits October 13, 2026 15:56
It stays available at the v24.4 tag. This makes room for the
application of the current Getting Started tutorial.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The product catalog of the Getting Started tutorial, as it is at the end
of the Add Tests step. It is generated from the code listings of the
tutorial in vaadin/docs (v25.3), starting from the project skeleton that
the Set Up Project step links to.

Closes #13

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GenerateSteps.java generates the application at the end of each step
from the tutorial in vaadin/docs. CI builds main, builds and tests every
step, checks that main matches the last step, and on main pushes the
step/<page> branches as one commit per step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Hold the finished application of the Getting Started tutorial

1 participant