Skip to content

feat: Update Jenkins integration to use the latest Octopus CLI#161

Merged
Jtango18 merged 42 commits intomainfrom
noamgal/sc-118140/update-jenkins-integration-to-use-the-latest
Feb 12, 2026
Merged

feat: Update Jenkins integration to use the latest Octopus CLI#161
Jtango18 merged 42 commits intomainfrom
noamgal/sc-118140/update-jenkins-integration-to-use-the-latest

Conversation

@ATGardner
Copy link
Collaborator

Refactor the OctopusDeploy plugin to utilize a new CLI wrapper, enhancing maintainability and readability. Introduce a unified interface for executing CLI commands, consolidating functionality to reduce code duplication. Add comprehensive unit tests to ensure reliability of the CLI integration.

implements Update Jenkins integration to use the latest Octopus CLI

…dency

- Upgrade Jenkins plugin version to 0.51.0 for improved compatibility.
- Add Apache Commons Text library to test dependencies for enhanced text manipulation capabilities.
- Introduce VSCode settings for better development environment configuration.
…ommands

- Introduce LegacyCliWrapper to encapsulate Octopus CLI command execution.
- Replace direct command construction in OctopusDeployPushBuildInformationRecorder,
  OctopusDeployPushRecorder, and OctopusDeployReleaseRecorder with the new wrapper.
- Add methods in OctopusDeployPlugin for retrieving OctopusDeployServer instances.
- Enhance error handling and logging for CLI command execution.
- Update OctopusValidator to use new server ID retrieval method.

This refactor improves code maintainability and readability by centralizing
CLI command handling in the LegacyCliWrapper, allowing for easier updates
and modifications in the future.
Replace LegacyCliWrapper with new CliWrapper for executing Octopus CLI commands.
Introduce OctopusCliExecutor interface to unify command execution across
legacy and new CLI implementations. Add OctopusCliWrapperBuilder for
configuring CLI instances. This change enhances compatibility with the
latest Octopus CLI features and improves maintainability.
- Move common execution logic from LegacyCliWrapper and CliWrapper
  into a new BaseCliWrapper class to reduce code duplication.
- Introduce CliExecutionResult to encapsulate CLI execution results
  including stdout and exit codes.
- Implement CLI type inference to determine whether to use the
  legacy .NET CLI or the new Golang-based CLI.
- Update OctopusCliWrapperBuilder to utilize the new structure
  and improve maintainability.
- Remove redundant methods and streamline argument handling
  across CLI wrappers.

This change enhances the overall architecture of the CLI wrappers,
making it easier to maintain and extend in the future.
Introduce comprehensive unit tests for the CliWrapper class to ensure
correct execution of various commands such as pack, push, and deploy.
These tests validate argument structures and expected results, enhancing
the reliability of the integration with the Octopus CLI.
Add unit tests to verify the behavior of deployRelease and createRelease
methods in the CliWrapper class. The tests ensure that the correct
arguments are passed to the execute method and that the expected results
are returned, particularly when handling deployment scenarios with
waitForDeployment and environment parameters.
@ATGardner ATGardner self-assigned this Feb 8, 2026
@CLAassistant
Copy link

CLAassistant commented Feb 8, 2026

CLA assistant check
All committers have signed the CLA.

@@ -0,0 +1,15 @@
{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should i remove this file? add .vscode to .gitignore?

Copy link
Contributor

Choose a reason for hiding this comment

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

leave it, it won't hurt to have it, if someone else opens it up in vscode and they end up with diffs they can decide to clean it up and ignore from then forward.

* Get the default OctopusDeployServer from OctopusDeployPlugin configuration
* @return the default server
* */
protected static OctopusDeployServer getDefaultOctopusDeployServer() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i moved static methods that get the OctopusDeployPlugin descriptor into OctopusDeployPlugin

the golang cli doesn't handle utf-16 json files too well, while the .net legacy cli can now handle utf-8 without any issues.
simplified addCommonArguments
removed `--verbose` (which isn't available in golang cli)
Copy link
Contributor

@Jtango18 Jtango18 left a comment

Choose a reason for hiding this comment

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

Admittedly some of my Java is a little rusty, but this looks like a pretty solid PR to me,

zentron and others added 12 commits February 10, 2026 20:00
This change modifies the logging command in the workflow to eliminate
the redundant output of the last 20 lines of logs from the Octopus
server during the readiness check. This helps to streamline the
logs and focus on relevant information while waiting for the server
to be ready.
Enhance the logging output when waiting for the Octopus Deploy server
to be ready by redirecting error output to standard output. This
provides better visibility into the server's status during the
initialization process.
This change updates the Java version used in the setup step of the
GitHub Actions workflow from JDK 8 to JDK 11 to ensure compatibility
with the latest features and improvements in the Java ecosystem.
…sponse

Refactor the deployment method to retrieve the version from the JSON
response when the deployToEnvironment is blank. This ensures that the
correct version is used for deployment, improving the reliability of
the deployment process.
@Jtango18 Jtango18 merged commit 1351927 into main Feb 12, 2026
5 checks passed
@Jtango18 Jtango18 deleted the noamgal/sc-118140/update-jenkins-integration-to-use-the-latest branch February 12, 2026 05:25
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.

5 participants