Skip to content

Commit

Permalink
Ensures runbook run commands inspect for server version >= 2020.3.1 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewabest authored Jun 26, 2020
1 parent 92ba6a1 commit ba2cb79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions source/Octopus.Client/Repositories/Async/RunbookRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public RunbookRepository(IOctopusAsyncRepository repository)
: base(repository, "Runbooks")
{
integrationTestVersion = SemanticVersion.Parse("0.0.0-local");
versionAfterWhichRunbookRunParametersAreAvailable = SemanticVersion.Parse("2020.2.99999");
versionAfterWhichRunbookRunParametersAreAvailable = SemanticVersion.Parse("2020.3.1");
}

public Task<RunbookResource> FindByName(ProjectResource project, string name)
Expand Down Expand Up @@ -58,7 +58,11 @@ private bool ServerSupportsRunbookRunParameters(string version)
{
var serverVersion = SemanticVersion.Parse(version);

return serverVersion >= versionAfterWhichRunbookRunParametersAreAvailable ||
// Note: We want to ensure the server version is >= *any* 2020.3.1, including all pre-releases to consider what may be rolled out to Octopus Cloud.
var preReleaseAgnosticServerVersion =
new SemanticVersion(serverVersion.Major, serverVersion.Minor, serverVersion.Patch);

return preReleaseAgnosticServerVersion >= versionAfterWhichRunbookRunParametersAreAvailable ||
serverVersion == integrationTestVersion;
}

Expand Down
8 changes: 6 additions & 2 deletions source/Octopus.Client/Repositories/RunbookRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public RunbookRepository(IOctopusRepository repository)
: base(repository, "Runbooks")
{
integrationTestVersion = SemanticVersion.Parse("0.0.0-local");
versionAfterWhichRunbookRunParametersAreAvailable = SemanticVersion.Parse("2020.2.99999");
versionAfterWhichRunbookRunParametersAreAvailable = SemanticVersion.Parse("2020.3.1");
}

public RunbookResource FindByName(ProjectResource project, string name)
Expand Down Expand Up @@ -57,7 +57,11 @@ private bool ServerSupportsRunbookRunParameters(string version)
{
var serverVersion = SemanticVersion.Parse(version);

return serverVersion >= versionAfterWhichRunbookRunParametersAreAvailable ||
// Note: We want to ensure the server version is >= *any* 2020.3.1, including all pre-releases to consider what may be rolled out to Octopus Cloud.
var preReleaseAgnosticServerVersion =
new SemanticVersion(serverVersion.Major, serverVersion.Minor, serverVersion.Patch);

return preReleaseAgnosticServerVersion >= versionAfterWhichRunbookRunParametersAreAvailable ||
serverVersion == integrationTestVersion;
}

Expand Down

0 comments on commit ba2cb79

Please sign in to comment.