-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(core): update vscode detection #32721
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
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
View your CI Pipeline Execution ↗ for commit 31d6b5c
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud is proposing a fix for your failed CI:
These test updates ensure that the IDE detection tests work correctly with the new VSCODE_GIT_ASKPASS environment variable instead of the old VSCODE_GIT_ASKPASS_NODE variable, which was changed in the main detection logic.
We verified this fix by re-running nx:test-native
.
Suggested Fix changes
diff --git a/packages/nx/src/native/ide/detection.rs b/packages/nx/src/native/ide/detection.rs
index d3e7b8ba45..38da2f921d 100644
--- a/packages/nx/src/native/ide/detection.rs
+++ b/packages/nx/src/native/ide/detection.rs
@@ -90,7 +90,7 @@ mod tests {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "vscode".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/vscode/in/it".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::VSCode);
@@ -102,7 +102,7 @@ mod tests {
test_env.insert("TERM_PROGRAM".to_string(), "vscode".to_string());
test_env.insert("TERM_PROGRAM_VERSION".to_string(), "1.104.0".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/vscode-insiders/in/it".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::VSCode);
@@ -117,7 +117,7 @@ mod tests {
"1.104.0-insider".to_string(),
);
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/vscode/in/it".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::VSCodeInsiders);
@@ -128,7 +128,7 @@ mod tests {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "vscode".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/cursor/in/it".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::Cursor);
@@ -139,7 +139,7 @@ mod tests {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "vscode".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/windsurf/in/it".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::Windsurf);
@@ -167,10 +167,10 @@ mod tests {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "vscode".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/vscode/in/it".to_string(),
);
- // No VSCODE_GIT_ASKPASS_NODE set or doesn't contain "vscode"
+ // No VSCODE_GIT_ASKPASS set or doesn't contain "vscode"
assert_eq!(detect_editor(test_env), SupportedEditor::VSCode);
}
@@ -179,7 +179,7 @@ mod tests {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "vscode".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/no/matching/editor".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::VSCode);
@@ -190,7 +190,7 @@ mod tests {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "VSCode".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/VSCODE/in/it".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::VSCode);
@@ -211,7 +211,7 @@ mod tests {
fn test_cursor_without_askpass_confirmation() {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "cursor".to_string());
- // No VSCODE_GIT_ASKPASS_NODE set
+ // No VSCODE_GIT_ASKPASS set
assert_eq!(detect_editor(test_env), SupportedEditor::Unknown);
}
@@ -220,7 +220,7 @@ mod tests {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "cursor".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/no/matching/editor".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::Unknown);
@@ -230,7 +230,7 @@ mod tests {
fn test_windsurf_without_askpass_confirmation() {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "windsurf".to_string());
- // No VSCODE_GIT_ASKPASS_NODE set
+ // No VSCODE_GIT_ASKPASS set
assert_eq!(detect_editor(test_env), SupportedEditor::Unknown);
}
@@ -239,7 +239,7 @@ mod tests {
let mut test_env = HashMap::new();
test_env.insert("TERM_PROGRAM".to_string(), "windsurf".to_string());
test_env.insert(
- "VSCODE_GIT_ASKPASS_NODE".to_string(),
+ "VSCODE_GIT_ASKPASS".to_string(),
"some/path/with/no/matching/editor".to_string(),
);
assert_eq!(detect_editor(test_env), SupportedEditor::Unknown);
⚙️ An Nx Cloud workspace admin can disable these reviews in workspace settings.
Current Behavior
We use VSCODE_GIT_ASKPASS_NODE to detect vscode instances
Expected Behavior
We now use VSCODE_GIT_ASKPASS instead.
Related Issue(s)
Fixes #