Update LiquibaseCommandLineTest expectedHelpOutput for the three new ALLOW_* audit flags#7760
Conversation
…ree new ALLOW_* flags Three upstream PRs from the May-2026 audit batch each added a new GlobalConfiguration.builder.define() entry that picocli auto-renders into the CLI --help output as a global option, but none of the three PRs updated the byte-exact snapshot fixture in LiquibaseCommandLineTest.expectedHelpOutput. Surfaces in liquibase-pro subtree-sync CI (LiquibaseCommandLineTest.'help output':854) once the sibling MSSQL regression (DAT-23093 / #7756) cleared and the Maven reactor advanced past liquibase-standard into liquibase-cli. Missed PRs (all merged into upstream main, all by the same author): #7747 CWE-78 allowExecuteCommand — declared at GlobalConfiguration:57 #7748 CWE-470 allowCustomChange — declared at GlobalConfiguration:56 #7750 CWE-22 allowParentDirectoryReferences — declared at GlobalConfiguration:58 Add three picocli-rendered stanzas to expectedHelpOutput at the alphabetical insertion points the renderer actually emits (captured verbatim from a local 'mvn test -Dtest=LiquibaseCommandLineTest#help output' run after the missing flags were declared): - --allow-custom-change=PARAM inserted BEFORE --allow-duplicated-changeset-identifiers (alphabetical: 'c' < 'd' within 'allow-*') - --allow-execute-command=PARAM inserted BETWEEN --allow-duplicated-changeset-identifiers and --allow-inherit-logical-file-path (alphabetical: 'd' < 'e' < 'i') - --allow-parent-directory-references=PARAM inserted BETWEEN --allow-inherit-logical-file-path and --always-drop-instead-of-replace (alphabetical: 'i' < 'p' within 'allow-*'; 'allow-*' < 'always-*' since 'l' < 'w' at position 2 of the suffix) Each stanza copies the description text VERBATIM from picocli's .usage() renderer — including picocli's specific line-wrap points, which depend on description length, terminal width assumptions, and where word boundaries fall. Hand-editing the stanzas would risk drifting from picocli's rendering on the next build; capturing them as picocli emits is the only way to keep the snapshot stable. Test: full liquibase-cli reactor passes (115 / 115 specs across ParameterUtilTest, CommandLineArgumentValueProviderTest, LiquibaseCommandLineProCommandTest, LiquibaseCommandLineTest (40 incl. 'help output'), LiquibaseCommandLineThreadingTest, LiquibaseLauncherTest, ProCommandErrorMessageTest). Once this merges and a follow-up subtree-sync pulls it into liquibase-pro, the 'help output' assertion at line 854 of the synced fixture file flips green. Note for the audit-batch follow-up: a similar fixture-drift gap will appear when the remaining open PRs in this batch (#7749 customPrecondition, #7753 sqlCheck, #7754 includeAll filter/comparator classes, #7755 external changelog paths) merge into main, because each declares a new GlobalConfiguration entry. Each of those PRs should ideally include its own LiquibaseCommandLineTest fixture update before merging; if any merge without one, a follow-up of this PR's shape will be needed for it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request updates ChangesCLI help text for security-related options
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…w allowExternalChangelogPaths flag This PR introduces ALLOW_EXTERNAL_CHANGELOG_PATHS in GlobalConfiguration (allowExternalChangelogPaths=true by default). The help-output snapshot reflects over all registered config definitions, so the new flag appears in --help and the fixture needs the matching block. Block captured byte-exact from picocli's actual --help output. Mirrors the #7760 pattern for the three already-merged ALLOW_* audit flags (this branch's merge from origin/main brought those in; this commit adds the fourth). Note on the UNC double-backslash: the description references the leading '\\' UNC path prefix. In Groovy triple-quoted source the inserted text is escaped as '\\\\' (four source backslashes → two runtime backslashes) so the runtime fixture matches picocli's literal output. The other 35 block lines apply verbatim. LiquibaseCommandLineTest 40/40 green locally.
…put for the new allowIncludeAllClasses flag This PR introduces ALLOW_INCLUDE_ALL_CLASSES in GlobalConfiguration (allowIncludeAllClasses=true by default), governing the includeAll resourceFilter/resourceComparator class-name attributes. The help-output snapshot reflects over all registered config definitions, so the new flag appears in --help and the fixture needs the matching block. Block captured byte-exact from picocli's actual --help output, inserted alphabetically between --allow-execute-command and --allow-inherit-logical- file-path. Mirrors the #7760 pattern for the three already-merged ALLOW_* audit flags (the merge from origin/main brought those in; this commit adds the fourth). LiquibaseCommandLineTest 40/40 green locally.
…w allowSqlPrecondition flag This PR introduces ALLOW_SQL_PRECONDITION in GlobalConfiguration (allowSqlPrecondition=true by default), governing the <sqlCheck> changelog precondition. The help-output snapshot reflects over all registered config definitions, so the new flag appears in --help and the fixture needs the matching block. Block captured byte-exact from picocli's actual --help output, inserted alphabetically after --allow-parent-directory-references and before --always-drop-instead-of-replace. Mirrors the #7760 pattern for the three already-merged ALLOW_* audit flags (merge from origin/main brought those in; this commit adds the fourth). LiquibaseCommandLineTest 40/40 green locally.
TL;DR
Three audit-batch PRs that landed in
mainrecently — #7747 (CWE-78allowExecuteCommand), #7748 (CWE-470allowCustomChange), #7750 (CWE-22allowParentDirectoryReferences) — each added a newGlobalConfiguration.builder.define()entry that picocli auto-renders into--helpoutput. None of those PRs updated the byte-exactexpectedHelpOutputsnapshot inLiquibaseCommandLineTest.groovy. This PR adds the three missing stanzas at the alphabetical positions picocli actually emits.Captured the stanzas verbatim from a local
mvn test -Dtest='LiquibaseCommandLineTest#help output'run; not hand-written, so the wrap points exactly match what picocli renders.Why this regression wasn't caught at PR-author time
picocli reflects over
LiquibaseConfiguration.getRegisteredDefinitions()at CLI startup (seeLiquibaseCommandLine.addGlobalArgumentsline 1203) and adds anOptionSpecper registered definition automatically. Authors of new flags get the--helprendering "for free" without touching CLI code, which is exactly when it's easy to forget there's a downstream snapshot test pinning every byte of that output.The snapshot is a single ~691-line inline string literal in
LiquibaseCommandLineTest, which doesn't show up in IDE call-graphs ofGlobalConfiguration.ALLOW_CUSTOM_CHANGE(it's literally just a string). Each of the three authors (same author, three different PRs) missed the linkage three times in a row.Why it surfaced in CI now, not before
Maven's reactor stops at the first module-level test failure. On the liquibase-pro subtree-sync runs,
liquibase-standard'sMSSQLDatabaseTest.getTargetUniquenessAttributes_allAuthMethods_produceSameUrlwas failing first (the regression fixed in #7756). The reactor never advanced toliquibase-cli, so this fixture gap stayed invisible. After #7756 merged and the subtree-sync was retried, the reactor advanced pastliquibase-standard, andLiquibaseCommandLineTest.'help output':854immediately tripped.The fix
Three new stanzas inserted at the alphabetical positions picocli emits:
--allow-duplicated-changeset-identifiers--allow-custom-change=PARAM(#7748 / CWE-470)--allow-duplicated-…and--allow-inherit-logical-file-path--allow-execute-command=PARAM(#7747 / CWE-78)--allow-inherit-logical-file-pathand--always-drop-instead-of-replace--allow-parent-directory-references=PARAM(#7750 / CWE-22)Alphabetical ordering rationale:
allow-*:c<d<e<i<p— socustom-changecomes first,parent-directory-referencescomes last.allow-*(a-l-l-o-w) <always-*(a-l-w-a-y-s) becausel<wat position 2 of the suffix.Each stanza is the verbatim output of picocli's
.usage()renderer for that flag, including picocli's specific line-wrap points. The stanzas are NOT hand-written. Hand-editing risks drifting from picocli's rendering on the next build — capturing them as picocli emits them is the only way to keep this snapshot stable.Captured-output methodology (for future fixture updates)
For anyone adding a new
GlobalConfigurationflag and needing to update this fixture:new File("target/help-output-actual.txt").text = bytes.toString()to the'help output'test'swhen:block.mvn test -Dtest='LiquibaseCommandLineTest#help output'— it'll fail, buttarget/help-output-actual.txtwill contain the full picocli output.expectedHelpOutput.This is the procedure I used to generate this PR.
Test plan
Full
liquibase-clireactor passes (115/115 specs acrossParameterUtilTest,CommandLineArgumentValueProviderTest,LiquibaseCommandLineProCommandTest,LiquibaseCommandLineTest40 incl.'help output',LiquibaseCommandLineThreadingTest,LiquibaseLauncherTest,ProCommandErrorMessageTest).Things to be aware of
Fixture-only change. No production behaviour change. The three flags themselves (their actual gating logic) were merged via CWE-78: opt-in restricted mode for executeCommand changelog change #7747/CWE-470: opt-in restricted mode for customChange changelog change #7748/CWE-22 deprecation flag: opt-in path containment via liquibase.allowParentDirectoryReferences #7750.
No new tests. This PR adds 71 lines to the existing snapshot literal; it doesn't add new specs. The existing 'help output' spec is the only consumer of
expectedHelpOutput.Forward-looking risk: the same fixture-drift gap will reappear when the remaining audit-batch PRs land in main, because each introduces a new
GlobalConfigurationentry:customPrecondition) — updates description of existingALLOW_CUSTOM_CHANGE, will drift the stanza I added in this PRsqlCheck→ALLOW_SQL_PRECONDITION)includeAllfilter/comparator →ALLOW_INCLUDE_ALL_CLASSES)ALLOW_EXTERNAL_CHANGELOG_PATHS)Each should ideally include its own fixture update before merging. If any merge without one, a follow-up of this PR's shape will be needed for it. Adding a release-process note / PR-template checkbox to enforce this is filed as a separate TECHOPS follow-up.
Coordination
LiquibaseCommandLineTest.'help output'after this PR merges and a follow-up subtree-sync pulls it in.PostgreSQLIntegrationTest.testStatusRunDuringUpdateNPE inAlternateConnectionExecutor.<init>) is a pre-existing test-fixture wiring issue, unrelated to this PR.Related
allowExecuteCommand(the original PR that should have updated the fixture)allowCustomChange(same)allowParentDirectoryReferences(same)Part of the May-2026 OSS credential-handling-and-changelog-injection audit slice (
sdoulabel).