fix: make Java init respect --yes flag for non-interactive mode#1952
Closed
mashraf-222 wants to merge 2 commits intomainfrom
Closed
fix: make Java init respect --yes flag for non-interactive mode#1952mashraf-222 wants to merge 2 commits intomainfrom
mashraf-222 wants to merge 2 commits intomainfrom
Conversation
The --yes CLI flag was defined but never consumed by init_java_project(). Thread non_interactive through main.py → init_codeflash() → init_java_project() so that when --yes is set, auto-detected defaults are used without prompts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
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.
Problem
codeflash init --yesfor Java projects still prompts interactively. The--yesflag is defined in the CLI argument parser (cli.py:502) but never consumed by any init function —init_java_project()always callsshould_modify_java_config()andcollect_java_setup_info()which useConfirm.ask()andinquirer.prompt().Root Cause
init_java_project()has nonon_interactiveparameter. The--yesflag fromparse_args()is never threaded throughmain.py→init_codeflash()→init_java_project().Fix
main.py: Passargs.yestoinit_codeflash(non_interactive=...)cmd_init.py: Threadnon_interactivetoinit_java_project()init_java.py: Whennon_interactive=True, skipshould_modify_java_config()andcollect_java_setup_info()(both interactive), useJavaSetupInfo()defaults (all auto-detected values)Validation
uv run pytest tests/test_init_java.py -v— 2 tests passTest Coverage
tests/test_init_java.py(new) —TestInitJavaNonInteractivewith 2 tests:test_non_interactive_skips_prompts_and_uses_auto_detected— verifies auto-detectedJavaSetupInfodefaultstest_non_interactive_skips_should_modify_check— verifiesshould_modify_java_configis not calledCloses CF-1086