refactor(startup): rotate ascii banners, drop the 1s startup sleep (#36887) - #36888
refactor(startup): rotate ascii banners, drop the 1s startup sleep (#36887)#36888wezell wants to merge 4 commits into
Conversation
…36887) - Replaces the single hardcoded banner with a rotating set of 7, picked per boot. - artDone becomes an AtomicBoolean with compareAndSet, closing the check-then-set race that could let two threads both print. - Removes Thread.sleep(1000) from doArt(), giving back a second on every startup. Backslashes in the art are escaped (\\) because Java text blocks still process escape sequences; \s marks trailing spaces that text blocks would otherwise strip. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
❌ Linked Issue Needs Team LabelThis PR is linked to issue #36887, but that issue has no How to fix this:Apply a This comment was automatically generated by the issue linking workflow |
|
Claude finished @wezell's task in 2m 29s —— View job Code ReviewReviewed the diff against New IssuesNo blocking issues found. Two minor notes below, neither blocks merge.
Notes (non-issues, verified OK)
Unrelated to the code: the CI comment flags that linked issue #36887 needs a Overall this does what the description says and is safe to merge. The two medium notes are optional polish. |
…getenv
Banner 1 was tab-indented. Java text blocks strip one tab as incidental
whitespace, and the terminal expands each remaining tab to 8 columns, so
the top rows were shoved right relative to the rest of the art. Converted
to plain spaces.
The art also started on the same line as the log prefix, offsetting the
first row by ~30 characters. Extracted a print() helper that emits leading
newlines so the banner starts in column 0.
Replaced System.getenv("DOT_SHOW_ALL_ASCII_ART") with
Config.getBooleanProperty("SHOW_ALL_ASCII_ART", false) per the Config/Logger
rule; Config resolves it from the same DOT_-prefixed env var, so existing
usage is unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
doArt() runs exactly once, guarded by the AtomicBoolean, so there is no reason to keep the banner array reachable for the life of the JVM. Clear it on the way out and make the field private. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The banners lived in text blocks, which meant every backslash had to be escaped as \\ and every trailing space marked with \s — easy to get wrong, and the literals stayed interned in the class constant pool for the life of the JVM regardless of clearing the array. Moved the art to /ascii-art.txt, banners separated by a %%% line, and load it once in doArt(). The art is plain text (single backslashes, real trailing spaces) and is garbage once doArt() returns. A missing or unreadable resource skips the banner rather than breaking startup. Verified the resource round-trips identically to the old text blocks: 7 banners, no tabs, backslash-heavy art literal, trailing spaces intact. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fixes #36887
Summary
Cosmetic startup change with one real win:
doArt()no longer sleeps for a second on every boot.private static boolean artDone+ check-then-setAtomicBoolean.compareAndSet— two racing threads can't both printThread.sleep(1000)Note for reviewers: text blocks and backslashes
Java text blocks still process escape sequences, so ASCII art containing
\does not compile as-is:Every backslash in the art is escaped as
\\, and\sis used where a trailing space must survive (text blocks strip incidental trailing whitespace). If you add a banner, run it throughjavacbefore pushing.Verification
Compiled the class standalone against a stub
Loggerand rendered all 7 banners — output is byte-identical to the source art, including the trailing spaces preserved by\s.Checklist
🤖 Generated with Claude Code