feat: add Rundeck Runner support and repository-named subdirectories#44
Open
elioe wants to merge 1 commit into
Open
feat: add Rundeck Runner support and repository-named subdirectories#44elioe wants to merge 1 commit into
elioe wants to merge 1 commit into
Conversation
elioe
commented
May 20, 2026
- Implement ProxyRunnerPlugin and ProxySecretBundleCreator for secure distributed execution.
- Add gitUseRepoNameSubdirectory option to clone under base directory using the git repo name.
- Clean up temporary SSH keys on factory close and fix hard reset behavior in GitManager.
- Add Spock unit tests for secret bundling and repo name extraction.
- Implement ProxyRunnerPlugin and ProxySecretBundleCreator for secure distributed execution. - Add gitUseRepoNameSubdirectory option to clone under base directory using the git repo name. - Clean up temporary SSH keys on factory close and fix hard reset behavior in GitManager. - Add Spock unit tests for secret bundling and repo name extraction.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Rundeck Runner compatibility to the Git workflow steps by implementing runner/secret-bundling interfaces, introduces an option to clone into a repository-named subdirectory under the configured base directory, and improves SSH key lifecycle management by explicitly closing/deleting temporary key material after JGit transport operations.
Changes:
- Implement
ProxyRunnerPlugin+ProxySecretBundleCreatorfor Git Clone/Commit/Push steps, backed by new secret path/bundle helpers inGitPluginUtil. - Add
gitUseRepoNameSubdirectoryoption and repo-name extraction utility (extractRepoName) to support repository-named clone directories. - Improve JGit SSH transport cleanup by making
PluginSshSessionFactoryCloseableand ensuring factories are closed after clone/pull/push; add Spock tests for secret bundling, repo name extraction, and SSH temp key cleanup.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/groovy/com/rundeck/plugin/util/GitPluginUtil.groovy | Adds repo name extraction and shared secret-path/secret-bundle helpers for Runner support. |
| src/main/groovy/com/rundeck/plugin/GitCloneWorkflowStep.groovy | Adds Runner interfaces, repo-name subdir option handling, and secret bundle/path delegation. |
| src/main/groovy/com/rundeck/plugin/GitCommitWorkflowStep.groovy | Adds Runner interfaces, repo-name subdir option handling, and secret bundle/path delegation. |
| src/main/groovy/com/rundeck/plugin/GitPushWorkflowStep.groovy | Adds Runner interfaces, repo-name subdir option handling, and secret bundle/path delegation. |
| src/main/groovy/com/rundeck/plugin/util/PluginSshSessionFactory.groovy | Makes SSH session factory reusable/closeable and deletes temp key files on close. |
| src/main/groovy/com/rundeck/plugin/GitManager.groovy | Adds hard reset/clean before pull and ensures SSH factories are closed after operations. |
| src/test/groovy/com/rundeck/plugin/WorkflowStepSecretBundleSpec.groovy | Tests workflow steps implement runner/secret-bundle interfaces and return/bundle secrets correctly. |
| src/test/groovy/com/rundeck/plugin/util/GitPluginUtilSecretBundleSpec.groovy | Unit tests for secret-path resolution and secret bundle preparation behavior. |
| src/test/groovy/com/rundeck/plugin/util/GitPluginUtilExtractRepoNameSpec.groovy | Parameterized tests for extracting repo names from various Git URL formats. |
| src/test/groovy/com/rundeck/plugin/util/PluginSshSessionFactorySpec.groovy | Updates behavior expectation (factory reuse) and adds tests for idempotent close + temp key deletion. |
Comments suppressed due to low confidence (1)
src/main/groovy/com/rundeck/plugin/GitManager.groovy:209
- The success/failure logging here is incorrect: the
elsebranch logs the same "not successful" message as the failure branch. This makes logs misleading during normal successful pulls.
if (!result.isSuccessful()) {
logger.info("Pull is not successful.")
} else {
logger.debug("Pull is not successful.")
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+113
to
+124
| static String extractRepoName(String gitUrl) { | ||
| if (!gitUrl) return null | ||
| String cleaned = gitUrl.replaceAll('/+$', '') | ||
| int lastSlash = cleaned.lastIndexOf('/') | ||
| int lastColon = cleaned.lastIndexOf(':') | ||
| int lastSep = Math.max(lastSlash, lastColon) | ||
| String name = lastSep >= 0 ? cleaned.substring(lastSep + 1) : cleaned | ||
| if (name.endsWith('.git')) { | ||
| name = name.substring(0, name.length() - 4) | ||
| } | ||
| return name ?: null | ||
| } |
Comment on lines
+226
to
228
| sshFactory = setupTransportAuthentication(sshConfig, pushCommand, this.gitURL) | ||
| withPluginClassLoader { pushCommand.call() } | ||
| logger.info("Push is not successful.") |
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.