fix: detect fresh Java projects via pom.xml/build.gradle#39
Closed
mashraf-222 wants to merge 1 commit intomainfrom
Closed
fix: detect fresh Java projects via pom.xml/build.gradle#39mashraf-222 wants to merge 1 commit intomainfrom
mashraf-222 wants to merge 1 commit intomainfrom
Conversation
The hook's detect_project() only checked for codeflash.toml to identify Java projects. Fresh projects with only pom.xml or build.gradle were invisible — the hook silently did nothing when .java files were committed. On the current codeflash main branch, the CLI auto-detects and auto-configures Java from build files via handle_first_run(), so no pre-configuration step is needed in the hook. Changes: - Add pom.xml/build.gradle/build.gradle.kts detection in detect_project() - Add HAS_JAVA_CHANGES guard (matching existing Python/JS guards) - Remove broken "not configured" block that called interactive codeflash init - Add 6 Java bats tests + test helpers (add_java_commit, create_pom_xml, etc.) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
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
The hook only checked for
codeflash.tomlto identify Java projects. Fresh projects with onlypom.xmlorbuild.gradlewere invisible — the hook silently exited when.javafiles were committed.Fix
pom.xml/build.gradle/build.gradle.ktsdetection indetect_project()HAS_JAVA_CHANGESguard to match existing Python/JS guards--subagent)Test plan
.py-only commit in Java project → Java path skipped