Repository navigation
chore: reflow long string literals to fix librarian generation diff check - #14896
Merged
Merged
Conversation
…heck Run google-java-format 1.25.2 (with long-string reflow, as used by 'librarian generate') on two handwritten test files whose string literals exceeded the line limit. fmt-maven-plugin does not reflow long strings, so these passed the PR lint check but fail the post-merge generation diff check on main. Fixes #14862
Contributor
There was a problem hiding this comment.
Code Review
This pull request formats long string literals in AbstractReadContextTest.java and ITGrpcDirectPathTest.java by splitting them into concatenated substrings to adhere to line length limits. There are no review comments, and I have no feedback to provide.
zhumin8
marked this pull request as ready for review
November 2, 2026 21:20
blakeli0
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix generation diff, unblocks the Librarian upgrade and API sources regen.
What
Runs
google-java-format1.25.2 on two handwritten test files, so their long string literals are reflowed the same waylibrarian generate --allreflows them:java-storage/.../it/ITGrpcDirectPathTest.java:@Ignoremessage (added in feat(storage): add support for DirectPath over Interconnect #14006)java-spanner/.../AbstractReadContextTest.java:FAILED_PRECONDITIONmessage (added in fix(spanner): cancel queries promptly on close and synchronize error handling #14887)The result is identical to the diff in the failing generation check run (same blob hashes:
06333bef,bc58e312). These are formatting-only changes, with no behavior change.Why the PRs passed lint but broke
mainlintjob: runsfmt-maven-plugin2.25. ItsFormattercallsformatSource()and then only fixes imports. It never reflows long strings (StringWrapper.wrap).librarian generate: runs thegoogle-java-format --replaceCLI, wherereflowLongStringsdefaults totrue. It runs on every.javafile in each library, including handwritten tests.librarian_generation_check.yaml: runs only on push tomain, so the mismatch shows up only after merge.Both tools use google-java-format 1.25.2, so the version isn't the cause. The difference is the long-string reflow step. This will happen again whenever a handwritten string literal is longer than 100 columns, until the two formatters agree. That follow-up is out of scope for this PR.
Fixes #14862