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

fix: add implementation for compose update #9402

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

dgolovin
Copy link
Contributor

What does this PR do?

Implements update support for compose CLI

Screenshot / video of UI

What issues does this PR fix or reference?

Fix #8838.

How to test this PR?

  • Tests are covering the bug fix or the new feature

Signed-off-by: Denis Golovin <dgolovin@redhat.com>
@dgolovin dgolovin requested review from benoitf and a team as code owners October 16, 2024 04:26
@dgolovin dgolovin requested review from cdrage, feloy and axel7083 and removed request for a team October 16, 2024 04:26
@@ -44,7 +44,7 @@ export function getSystemBinaryPath(binaryName: string): string {
}

// Takes a binary path (e.g. /tmp/docker-compose) and installs it to the system. Renames it based on binaryName
export async function installBinaryToSystem(binaryPath: string, binaryName: string): Promise<void> {
export async function installBinaryToSystem(binaryPath: string, binaryName: string): Promise<string | undefined> {
Copy link
Contributor

Choose a reason for hiding this comment

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

should not be Promise<string | undefined> the signature should always return a string, if the function was not able to install system-wide (user cancel, or refuse to give admin privilege) it should throw an error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@axel7083 I'll open follow up on this, because I don't want add too much new functionality to the fix.

await composeDownload.download(releaseToUpdateTo);
// get the binary in the extension folder
const storagePath = await detect.getStoragePath();
binaryPath = await installBinaryToSystem(storagePath, composeCliName);
Copy link
Contributor

Choose a reason for hiding this comment

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

try {
// try to install system wide
} catch {
// log the error
} finally {
// update the composeCliTool with either the path from the extension folder or the system wide if install success
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as previous comment.

@dgolovin dgolovin merged commit 5851a39 into podman-desktop:main Oct 16, 2024
15 checks passed
@podman-desktop-bot podman-desktop-bot added this to the 1.14.0 milestone Oct 16, 2024
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.

better distinction between upgrade and change version in CLI Tools
5 participants