From 0d03a42d442d64610d073e4906198387b782fd9d Mon Sep 17 00:00:00 2001 From: Mihail Buryakov Date: Fri, 30 May 2025 01:10:09 +0300 Subject: [PATCH] [eel-vcs] using eel external cli api: update implementation classes to use the new constructor GitOrigin-RevId: c1b3bc2499c74cf21724170cb19bb29a3046f407 --- platform/external-process-auth-helper/api-dump.txt | 2 +- .../externalProcessAuthHelper/NativeSshAuthService.kt | 10 ++++++++-- .../src/git4idea/commands/GitHttpAuthService.kt | 8 ++++++-- .../src/git4idea/commands/GitHttpAuthServiceImpl.java | 4 ++++ .../src/git4idea/rebase/GitRebaseEditorService.kt | 10 ++++++++-- .../tests/git4idea/test/GitHttpAuthTestService.java | 4 ++++ 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/platform/external-process-auth-helper/api-dump.txt b/platform/external-process-auth-helper/api-dump.txt index 33546ae5beb0..a5264fc38a49 100644 --- a/platform/external-process-auth-helper/api-dump.txt +++ b/platform/external-process-auth-helper/api-dump.txt @@ -32,7 +32,7 @@ a:com.intellij.externalProcessAuthHelper.ExternalProcessRest f:com.intellij.externalProcessAuthHelper.NativeSshAuthService - com.intellij.externalProcessAuthHelper.ExternalProcessHandlerService - sf:Companion:com.intellij.externalProcessAuthHelper.NativeSshAuthService$Companion -- ():V +- (kotlinx.coroutines.CoroutineScope):V - sf:getInstance():com.intellij.externalProcessAuthHelper.NativeSshAuthService f:com.intellij.externalProcessAuthHelper.NativeSshAuthService$Companion - f:getInstance():com.intellij.externalProcessAuthHelper.NativeSshAuthService diff --git a/platform/external-process-auth-helper/src/externalProcessAuthHelper/NativeSshAuthService.kt b/platform/external-process-auth-helper/src/externalProcessAuthHelper/NativeSshAuthService.kt index b50006727a1a..3256e3992d5a 100644 --- a/platform/external-process-auth-helper/src/externalProcessAuthHelper/NativeSshAuthService.kt +++ b/platform/external-process-auth-helper/src/externalProcessAuthHelper/NativeSshAuthService.kt @@ -5,11 +5,17 @@ import com.intellij.openapi.components.Service import com.intellij.openapi.components.service import externalApp.nativessh.NativeSshAskPassApp import externalApp.nativessh.NativeSshAskPassAppHandler +import kotlinx.coroutines.CoroutineScope @Service(Service.Level.APP) -class NativeSshAuthService : ExternalProcessHandlerService( +class NativeSshAuthService( + coroutineScope: CoroutineScope +) : ExternalProcessHandlerService( "intellij-ssh-askpass", - NativeSshAskPassApp::class.java + NativeSshAskPassApp::class.java, + null, + listOf(NativeSshAskPassAppHandler.IJ_SSH_ASK_PASS_HANDLER_ENV, NativeSshAskPassAppHandler.IJ_SSH_ASK_PASS_PORT_ENV), + coroutineScope ) { companion object { @JvmStatic diff --git a/plugins/git4idea/src/git4idea/commands/GitHttpAuthService.kt b/plugins/git4idea/src/git4idea/commands/GitHttpAuthService.kt index 3f1a6e09be59..b5482a183fe7 100644 --- a/plugins/git4idea/src/git4idea/commands/GitHttpAuthService.kt +++ b/plugins/git4idea/src/git4idea/commands/GitHttpAuthService.kt @@ -12,15 +12,19 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.util.text.StringUtilRt import git4idea.http.GitAskPassApp import git4idea.http.GitAskPassAppHandler +import kotlinx.coroutines.CoroutineScope import java.io.File import java.util.* /** * Provides the authentication mechanism for Git HTTP connections. */ -abstract class GitHttpAuthService : ExternalProcessHandlerService( +abstract class GitHttpAuthService(coroutineScope: CoroutineScope) : ExternalProcessHandlerService( "intellij-git-askpass", - GitAskPassApp::class.java + GitAskPassApp::class.java, + GitAskPassApp(), + listOf(GitAskPassAppHandler.IJ_ASK_PASS_HANDLER_ENV, GitAskPassAppHandler.IJ_ASK_PASS_PORT_ENV), + coroutineScope ) { /** * Creates new [GitHttpAuthenticator] that will be requested to handle username and password requests from Git. diff --git a/plugins/git4idea/src/git4idea/commands/GitHttpAuthServiceImpl.java b/plugins/git4idea/src/git4idea/commands/GitHttpAuthServiceImpl.java index 868afcc38c50..418614d87406 100644 --- a/plugins/git4idea/src/git4idea/commands/GitHttpAuthServiceImpl.java +++ b/plugins/git4idea/src/git4idea/commands/GitHttpAuthServiceImpl.java @@ -4,12 +4,16 @@ package git4idea.commands; import com.intellij.externalProcessAuthHelper.AuthenticationGate; import com.intellij.externalProcessAuthHelper.AuthenticationMode; import com.intellij.openapi.project.Project; +import kotlinx.coroutines.CoroutineScope; import org.jetbrains.annotations.NotNull; import java.io.File; import java.util.Collection; class GitHttpAuthServiceImpl extends GitHttpAuthService { + GitHttpAuthServiceImpl(CoroutineScope coroutineScope) { + super(coroutineScope); + } @Override public @NotNull GitHttpGuiAuthenticator createAuthenticator(@NotNull Project project, diff --git a/plugins/git4idea/src/git4idea/rebase/GitRebaseEditorService.kt b/plugins/git4idea/src/git4idea/rebase/GitRebaseEditorService.kt index a8fc0b4c5f67..1937e2ad8f90 100644 --- a/plugins/git4idea/src/git4idea/rebase/GitRebaseEditorService.kt +++ b/plugins/git4idea/src/git4idea/rebase/GitRebaseEditorService.kt @@ -9,13 +9,19 @@ import com.intellij.openapi.components.service import git4idea.config.GitExecutable import git4idea.editor.GitRebaseEditorApp import git4idea.editor.GitRebaseEditorAppHandler +import kotlinx.coroutines.CoroutineScope import java.util.* import kotlin.io.path.Path @Service(Service.Level.APP) -internal class GitRebaseEditorService : ExternalProcessHandlerService( +internal class GitRebaseEditorService( + coroutineScope: CoroutineScope +) : ExternalProcessHandlerService( "intellij-git-editor", - GitRebaseEditorApp::class.java + GitRebaseEditorApp::class.java, + GitRebaseEditorApp(), + listOf(GitRebaseEditorAppHandler.IJ_EDITOR_HANDLER_ENV, GitRebaseEditorAppHandler.IJ_EDITOR_PORT_ENV), + coroutineScope ) { companion object { @JvmStatic diff --git a/plugins/git4idea/tests/git4idea/test/GitHttpAuthTestService.java b/plugins/git4idea/tests/git4idea/test/GitHttpAuthTestService.java index 9473419bf177..19d1a234e526 100644 --- a/plugins/git4idea/tests/git4idea/test/GitHttpAuthTestService.java +++ b/plugins/git4idea/tests/git4idea/test/GitHttpAuthTestService.java @@ -20,12 +20,16 @@ import com.intellij.externalProcessAuthHelper.AuthenticationMode; import com.intellij.openapi.project.Project; import git4idea.commands.GitHttpAuthService; import git4idea.commands.GitHttpAuthenticator; +import kotlinx.coroutines.CoroutineScope; import org.jetbrains.annotations.NotNull; import java.io.File; import java.util.Collection; public class GitHttpAuthTestService extends GitHttpAuthService { + GitHttpAuthTestService(CoroutineScope coroutineScope) { + super(coroutineScope); + } @NotNull private GitHttpAuthenticator myAuthenticator = STUB_AUTHENTICATOR;