Contribute to Hibernate ORM from an isx sandbox

This guide sets up a machine for working on Hibernate ORM: a clone of the code, the JDK it builds with, the container runtime its database tests use, and your coding agent. You branch a fresh machine for each change, and the agent builds and tests there with full autonomy.

In this setup, only your own contribution is supposed to reach the Hibernate project, and you send it yourself.

Hibernate's rules for AI-assisted work

Hibernate has not published rules for AI-assisted work, and its contributing guide does not mention it. Check that guide before you start, since rules may have appeared since this page was written.

Two things the contributing guide asks for are yours alone to give:

So in this guide, as in the Quarkus guide, the agent is supposed to work only inside its machine, and you decide what leaves it:

Before you start

You need isx set up with isx init: the Quick Start covers it. You also need a Hibernate Jira account, since each change needs an HHH issue whose key starts its commit messages.

Give the agent its own GitHub account, which isx init recommends, or no GitHub account at all. Its token from the page isx init gives cannot push, open a pull request or an issue, or comment on hibernate/hibernate-orm (why). With a token for your own account, the agent acts on GitHub as you, so give it another account first.

Create the template

This guide starts with a small template, so you can see each line Hibernate needs. For daily work, use the fuller one in Use the maintained Hibernate ORM template.

Create a template for Hibernate work:

isx templates new hibernate-orm-contrib

Fill it in:

name: hibernate-orm-contrib
description: Hibernate ORM contributions, with Claude Code
parent: tpl-minimal
packages:
  - java-25-openjdk-devel
tools:
  - claude
  - podman
default-action: claude
env:
  - name: JAVA_HOME
    value: /usr/lib/jvm/java-25-openjdk
agent_note: |
  Tests run on the embedded H2 database unless -Pdb names another. For a bug in
  one database, start it with ./db.sh <name> and run the tests with -Pdb=<name>.
repos:
  - url: https://github.com/hibernate/hibernate-orm.git
    path: ~/hibernate-orm
    prime: ./gradlew hibernate-core:compileTestJava
workdir: ~/hibernate-orm

The lines that are particular to Hibernate:

The agent here is Claude Code: claude under tools: installs it, and default-action: claude opens it in each new machine. To use another agent, put its tool name in both places, such as codex. Agents lists each agent, its tool name and the credential it signs in with.

Image schema fields describes every field a template can have, and A template with every field shows them all in one file.

Build it

isx build hibernate-orm-contrib

The build clones Hibernate ORM and compiles hibernate-core. If it fails, the error names the prime command, and isx build hibernate-orm-contrib --verbose shows its output.

Branch a machine for one change

Name the machine after the Jira issue:

isx branch hhh-12345 --from hibernate-orm-contrib

Your agent opens in ~/hibernate-orm. Give it the issue, and let it write a test that reproduces it, then the fix. Hibernate's test case templates are where a bug report's reproducer usually starts.

Check that it works

Open a shell in the machine with isx shell hhh-12345, and run a group of tests on the embedded H2 database:

./gradlew hibernate-core:test --tests 'org.hibernate.orm.test.flush.*'

Then run the same tests on PostgreSQL, in a container of the machine's own:

./db.sh postgresql
./gradlew hibernate-core:test -Pdb=postgresql --tests 'org.hibernate.orm.test.flush.*'

Both passing shows that the JDK, Gradle and the container runtime all work. The Hibernate README lists every database ./db.sh starts.

Take the change and send it yourself

Fetch the agent's commits into your own checkout of Hibernate ORM on the host, as Review and take an agent's commits shows. Read every line, run the tests yourself, and rework what you would not have written. Start each commit message with the Jira key, and rebase on main rather than merging, as the contributing guide asks.

Then push a branch named after the issue to your fork, and open the pull request in the browser. Keep the pull request template's licence confirmation, and write the description yourself.

Use the maintained Hibernate ORM template

The incus-spawn-templates repository keeps tpl-hibernate-orm, the template isx's maintainer uses for Hibernate work. It goes further than the one above, and it is the one to move to once that one builds.

What it adds:

Because its chain includes gh, give the agent its own GitHub account first, as Before you start says.

To use it, clone the repository and add it to searchPaths in ~/.config/incus-spawn/config.yaml, as its README shows. Then open tpl-mydev, its layer of personal preferences, with isx templates edit tpl-mydev, and put your own agent there. Build and branch it the same way:

isx build tpl-hibernate-orm
isx branch hhh-12345 --from tpl-hibernate-orm

Clean up

isx destroy hhh-12345

The template stays, so the next change starts from a built Hibernate. To bring the template up to the latest Hibernate, rebuild it with isx build hibernate-orm-contrib.

What this setup gives you

Each change gets a full Hibernate workstation of its own, ready the moment you branch it, and you can run several side by side.

Through all of it, nothing is supposed to reach Hibernate until you have read it, understood it and sent it yourself.