Skip to content

Comments

fix bug where scminfo.origin is not populated#117

Merged
wakingrufus merged 1 commit intomainfrom
fix-scminfo-origin-bug
Jan 23, 2026
Merged

fix bug where scminfo.origin is not populated#117
wakingrufus merged 1 commit intomainfrom
fix-scminfo-origin-bug

Conversation

@wakingrufus
Copy link
Member

@wakingrufus wakingrufus commented Jan 23, 2026

if .git directory is detected, but git command fails, it was wa causing the scminfo.origin property to have a null value for the conventions, which causes an error when accessed elsewhere in the plugin. this change will fallback to LOCAL when the git command fails to find the origin (ie git is not installed, or there is no remote set)

modernize some tests to allow gradle cache to be used in github actions

@wakingrufus wakingrufus requested a review from rpalcolea January 23, 2026 21:12
if .git directory is detected, but git command fails, it was wa causing the scminfo.origin property to have a null value for the conventions, which causes an error when accessed elsewhere in the plugin. this change will fallback to LOCAL when the git command fails to find the origin (ie git is not installed, or there is no remote set)

modernize some tests to allow gradle cache to be used in github actions
@wakingrufus wakingrufus force-pushed the fix-scminfo-origin-bug branch from 3fde94e to 96bad5b Compare January 23, 2026 21:13
@NullMarked
public class TestHelpers {
public static void withGit(File workingDir, Consumer<Git> work) {
try (Git git = Git.init().setBare(false).setDirectory(workingDir).setInitialBranch("main").call()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to get away from grgit and use plain jgit to make transition off of groovy easier

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, even though we cleaned up the usage of grgit in plugins due to config cache, we never cleaned up the usage in tests. Using jgit directly makes sense to me

private String executeGitCommand(File projectDir, Object... args) {
try {
return providerFactory.exec {
it.workingDir(projectDir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes complete sense, thanks for fixing this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this fixed issues I was having in the tests where the git command was not executing in the test project directory

@wakingrufus wakingrufus merged commit dd85c42 into main Jan 23, 2026
3 checks passed
@wakingrufus wakingrufus deleted the fix-scminfo-origin-bug branch January 23, 2026 21:20
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