Skip to content

TS-47508 Accept a folder for the git-properties-jar option - #962

Merged
DreierF merged 2 commits into
masterfrom
ts/47508_git_properties_folder
Aug 21, 2026
Merged

TS-47508 Accept a folder for the git-properties-jar option#962
DreierF merged 2 commits into
masterfrom
ts/47508_git_properties_folder

Conversation

@karottenreibe

Copy link
Copy Markdown
Contributor

What

git-properties-jar now also accepts a folder, which is searched for git.properties files. Previously a folder was rejected with a warning and the option was dropped, so deployments that keep git.properties in a resources folder (e.g. /app/resources in a container image) instead of inside the profiled archive got no commit auto-detection at all.

How

The search machinery already handled both shapes: GitPropertiesLocatorUtils.findGitPropertiesInFile branches into an archive or a folder search, and the folder branch is what the automatic detection already uses for exploded class folders (BOOT-INF/classes, JBoss vfs temp folders). The obstacles were only:

  • the !isFile() rejection in AgentOptionsParser.getGitPropertiesJarFile (now getGitPropertiesFileOrFolder), and
  • the three call sites in AgentOptions hardcoding isJarFile = true, which now derive it from isDirectory(). ArtifactoryConfig.parseGitProperties got the corresponding parameter.

A non-existent path still logs a warning and lets the application continue.

Decisions

  • Folder recursion semantics unchanged: the folder tree is always walked for git.properties, while search-git-properties-recursively only controls whether archives inside the folder are opened too. Making the flag also gate subfolders would change the existing automatic detection for exploded class folders, where git.properties usually sits in a subfolder — a breaking change with no upside here.
  • Option name kept: no new alias and no deprecation, so an option named ...-jar now also takes a folder. Documented in the KDoc, the log messages and the CHANGELOG.

Drive-by fix

The inconsistency warning in GitSingleProjectPropertiesLocator pointed users at teamscale-git-properties-jar, which was replaced by git-properties-jar in 31.0.0. It now references the current option constant. The Artifactory "found no git.properties" message likewise named the deprecated artifactory-git-properties-jar.

Tests

  • AgentOptionsTest.testGitPropertiesJarDoesNotAcceptFolders replaced by testGitPropertiesJarAcceptsFolders.
  • DelayedCommitDescriptorRetrievalTest now covers both an archive and a folder search root.
  • Folder scanning itself was already covered by GitPropertiesLocatorTest.testReadingGitPropertiesInJarFileNestedInFolder.
  • ./gradlew :agent:test passes.

Manual verification against a real Teamscale/Artifactory upload is still pending.

Out of scope

Testwise mode error messages list git-properties-jar as a way to supply a commit, but no testwise code path reads gitPropertiesJar. That pre-existing gap is untouched.

🤖 Generated with Claude Code

The option only accepted a regular file so far. A folder was rejected
with a warning and the option was dropped, so deployments that keep
git.properties in a resources folder instead of inside the profiled
archive got no commit auto-detection at all.

The search itself already handles both shapes:
GitPropertiesLocatorUtils.findGitPropertiesInFile branches into an
archive or a folder search, and the folder branch is what the automatic
detection uses for exploded class folders such as BOOT-INF/classes or
the JBoss vfs temp folders. The only obstacles were the parser's
isFile() check and the three call sites hardcoding isJarFile = true,
which now derive the flag from isDirectory().

Folder semantics stay as they are: the folder tree is always walked for
git.properties files, while search-git-properties-recursively only
controls whether archives inside the folder are opened as well. Changing
that would also change the automatic detection for exploded class
folders, where git.properties usually sits in a subfolder.

The option keeps its name for compatibility, so an option named
"...-jar" now also takes a folder. Log messages and documentation state
this.

Also fixes the inconsistency warning in
GitSingleProjectPropertiesLocator, which pointed users to
teamscale-git-properties-jar. That option was replaced by
git-properties-jar in 31.0.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@DreierF
DreierF merged commit ae7a2f1 into master Aug 21, 2026
3 of 4 checks passed
@DreierF
DreierF deleted the ts/47508_git_properties_folder branch August 21, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants