дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
feat(run): debug Python on Docker and Compose run targets (#1757)
Refs #1083 (step A2). Debug now works on Python configurations whose run target is a Docker image or Compose service: the run starts the program in a new container under debugpy (the image's own, else the IDE's managed copy mounted read-only), publishes the debug port on 127.0.0.1 only, and the debugger attaches like a Python Remote Debug configuration with the project folder mapped. Console scripts (pytest) run as modules and `uv run` keeps the manager in front; shell command lines are refused. Container debug startup is bounded (error when the container exits early or debugpy isn't ready in 120 s) and stopping the debugger stops the container. Co-authored-by: andreabasile <[email protected]>
Цей коміт міститься в:
1 джерело
c3671d782c
коміт
daad91777f
23 files changed
+904
-34
No files matched your search
@@ -190,6 +190,11 @@
|
||||
"Cannot choose a directory": "Cannot choose a directory",
|
||||
"Open in HTTP Client": "Open in HTTP Client",
|
||||
"Cannot generate the HTTP request": "Cannot generate the HTTP request",
|
||||
"Cannot start container debugging": "Cannot start container debugging",
|
||||
"The container exited before debugpy was ready. Check the Run console for errors.": "The container exited before debugpy was ready. Check the Run console for errors.",
|
||||
"debugpy did not become ready within 120 seconds. Check the Run console and the container's Python interpreter.": "debugpy did not become ready within 120 seconds. Check the Run console and the container's Python interpreter.",
|
||||
"Only Python can be debugged in containers": "Only Python can be debugged in containers",
|
||||
"Docker connections come from the Services tool window. Each run gets a new container, removed when it ends. Python configurations can be debugged there; coverage and profiling stay on this machine.": "Docker connections come from the Services tool window. Each run gets a new container, removed when it ends. Python configurations can be debugged there; coverage and profiling stay on this machine.",
|
||||
"Use Project JDK": "Use Project JDK",
|
||||
"JDK used for Maven sync, builds, goals and tests. An explicit JAVA_HOME in a run configuration takes precedence.": "JDK used for Maven sync, builds, goals and tests. An explicit JAVA_HOME in a run configuration takes precedence."
|
||||
}
|
||||
@@ -6296,6 +6296,5 @@
|
||||
"Empty: where the service mounts the project.": "비워 두면 서비스가 프로젝트를 마운트하는 위치를 사용합니다.",
|
||||
"The project is mounted here; paths and the working directory are mapped into it.": "프로젝트가 여기에 마운트되며, 경로와 작업 디렉터리가 이 위치로 매핑됩니다.",
|
||||
"Published ports": "게시된 포트",
|
||||
"Run as the image's user, not the project folder's owner (Linux)": "프로젝트 폴더 소유자가 아닌 이미지의 사용자로 실행(Linux)",
|
||||
"Docker connections come from the Services tool window. Each run gets a new container, removed when it ends; debugging, coverage and profiling stay on this machine.": "Docker 연결은 서비스 도구 창에서 가져옵니다. 실행할 때마다 새 컨테이너가 만들어지고 실행이 끝나면 제거됩니다. 디버깅, 커버리지 및 프로파일링은 이 컴퓨터에서 실행됩니다."
|
||||
"Run as the image's user, not the project folder's owner (Linux)": "프로젝트 폴더 소유자가 아닌 이미지의 사용자로 실행(Linux)"
|
||||
}
|
||||
@@ -6470,7 +6470,8 @@
|
||||
"The project is mounted here; paths and the working directory are mapped into it.": "项目挂载在此处;路径和工作目录会映射到其中。",
|
||||
"Published ports": "发布的端口",
|
||||
"Run as the image's user, not the project folder's owner (Linux)": "以镜像的用户运行,而不是项目文件夹的所有者(Linux)",
|
||||
"Docker connections come from the Services tool window. Each run gets a new container, removed when it ends; debugging, coverage and profiling stay on this machine.": "Docker 连接来自“服务”工具窗口。每次运行都会使用一个新容器,运行结束后删除;调试、覆盖率和性能分析仍在本机进行。",
|
||||
"Docker connections come from the Services tool window. Each run gets a new container, removed when it ends. Python configurations can be debugged there; coverage and profiling stay on this machine.": "Docker 连接来自“服务”工具窗口。每次运行都会使用一个新容器,运行结束后删除。Python 配置可以在容器中调试;覆盖率和性能分析仍在本机进行。",
|
||||
"Only Python can be debugged in containers": "容器中只能调试 Python",
|
||||
"Service name, e.g. ORCLPDB1": "服务名,例如 ORCLPDB1",
|
||||
"Current schema:": "当前模式:",
|
||||
"HR (ALTER SESSION SET CURRENT_SCHEMA)": "HR(ALTER SESSION SET CURRENT_SCHEMA)",
|
||||
@@ -6567,6 +6568,9 @@
|
||||
"Java compiler output must be inside its module: {output}": "Java 编译输出必须位于所属模块目录内:{output}",
|
||||
"Cannot choose a directory": "无法选择目录",
|
||||
"Open in HTTP Client": "在 HTTP 客户端中打开",
|
||||
"Cannot start container debugging": "无法启动容器调试",
|
||||
"The container exited before debugpy was ready. Check the Run console for errors.": "容器在 debugpy 就绪前已退出。请检查运行控制台中的错误。",
|
||||
"debugpy did not become ready within 120 seconds. Check the Run console and the container's Python interpreter.": "debugpy 未在 120 秒内就绪。请检查运行控制台和容器的 Python 解释器。",
|
||||
"Use Project JDK": "使用项目 SDK",
|
||||
"JDK used for Maven sync, builds, goals and tests. An explicit JAVA_HOME in a run configuration takes precedence.": "用于 Maven 同步、构建、目标和测试的 JDK。运行配置中显式设置的 JAVA_HOME 优先。"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* The HTTP port of a running Spring Boot application, from the embedded web
|
||||
* server's startup line: "Tomcat started on port 8080 (http) with context path '/'",
|
||||
* "Netty started on port 8080", "Undertow started on port(s) 8080 (http)",
|
||||
* "Jetty started on port(s) 8080 (http/1.1)".
|
||||
*/
|
||||
const STARTED = /\b(?:Tomcat|Netty|Undertow|Jetty)\b.*?\bstarted on port(?:\(s\))?:?\s*(\d{1,5})/i;
|
||||
|
||||
export function startedPort(line: string): number | null {
|
||||
if (!line.includes("tarted on port")) return null;
|
||||
const m = STARTED.exec(line);
|
||||
if (!m) return null;
|
||||
const port = Number(m[1]);
|
||||
return port > 0 && port < 65536 ? port : null;
|
||||
}
|
||||
Reference in new issue
Заблокувати користувача