Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add snapshot publish func #242

Merged
merged 2 commits into from
Mar 15, 2024
Merged

add snapshot publish func #242

merged 2 commits into from
Mar 15, 2024

Conversation

benPearce1
Copy link
Contributor

No description provided.

return nil, err
}

path = fmt.Sprintf("%s?publish=true", path)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is not "command" to publish a snapshot, this parameter is only available as a query parameter and setting it to any value causes it to publish https://github.com/OctopusDeploy/OctopusDeploy/blob/main/source/Octopus.Core/Features/RunbookSnapshots/CreateRunbookSnapshotCommandHandler.cs#L92

@@ -35,6 +45,10 @@ func (s *RunbookSnapshotService) Add(runbookSnapshot *RunbookSnapshot) (*Runbook
return nil, err
}

if publish {
path = fmt.Sprintf("%s?publish=true", path)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is not "command" to publish a snapshot, this parameter is only available as a query parameter and setting it to any value causes it to publish https://github.com/OctopusDeploy/OctopusDeploy/blob/main/source/Octopus.Core/Features/RunbookSnapshots/CreateRunbookSnapshotCommandHandler.cs#L92

Copy link
Contributor

Choose a reason for hiding this comment

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

Reading go always confuses me... Is it possible to have previous query parameters here? If so do we need to check the existing path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, spot on. The default path has no parameters on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not going to fix this now. It will probably never become a problem

@benPearce1 benPearce1 requested review from IsaacCalligeros95 and HuyPhanNguyen and removed request for domenicsim1 March 15, 2024 03:14
Copy link
Contributor

@IsaacCalligeros95 IsaacCalligeros95 left a comment

Choose a reason for hiding this comment

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

LGTM

@benPearce1 benPearce1 merged commit ef29d7d into main Mar 15, 2024
6 checks passed
@benPearce1 benPearce1 deleted the bp/runbook-snapshot-create branch March 15, 2024 05:30
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.

None yet

2 participants