This file contains important reminders and guidelines for AI agents working on this codebase.
Do NOT use -DisableCache when running build.ps1 from agentic contexts. The start.spring.io service may block or rate-limit automated traffic, causing connection failures.
Instead, to get a fresh build:
- Delete the expanded project folder (e.g.,
workspace/springbootadmin/) - Run
.\build.ps1 <image-name>without the flag
Before submitting patch changes:
- Run a dry-run of each patch:
git apply --check <patch-file> - If dry-run succeeds, run the full build and verify Java compilation
- Test the resulting Docker image with a real client app
The build script uses git apply --unidiff-zero --recount --ignore-whitespace to apply patches, which is more forgiving than the traditional patch command.
-
Hunk headers should be accurate: The format is
@@ -old_start,old_count +new_start,new_count @@old_countis the number of lines in the hunk from the old file (context lines plus lines with-prefix)new_countis the number of lines in the hunk in the new file (context lines plus lines with+prefix)- For new file patches (
--- /dev/null),old_countis 0 andnew_countis the total number of lines in the new-file hunk - Note:
--recountwill automatically correct line counts, but keeping them accurate is still good practice
-
Trailing newlines are required: Patch files must end with a newline character.
-
Preserve exact whitespace: Context lines must match the target file exactly, including trailing spaces and tabs. The
--ignore-whitespaceflag provides some tolerance but exact matches are preferred. -
New file patches: Use
/dev/nullas the old file:--- /dev/null +++ ./path/to/NewFile.java 2026-01-27 00:00:00.000000000 +0000 @@ -0,0 +1,N @@ +line 1 +line 2 ...
If a patch adds 1 line, the hunk header should reflect this:
-@@ -37,3 +37,10 @@
+@@ -37,3 +37,11 @@While git apply --recount can fix minor line count issues, keeping patches accurate ensures reliable application and easier debugging.