Closed msmitherdc closed 1 month ago
Hi @msmitherdc. Thanks for the report. What do you mean it's not working. Do you get any error message?
When I run this, I get The command for input 'git_issue' returned empty result.
, which at least for me is correct. If I manually run git rev-parse --abbrev-ref HEAD | awk -F'[/-]' '{print $2}'
it outputs nothing.
I checked out a branch with a /
, and it seems to work.
for the first one git rev-parse --abbrev-ref HEAD | awk -F'[/-]' '{print $2}'
, we have the issue number in the branch string. So it probably only returns something with a correctly structured branch name (our are set via code). The values are populated as pickStrings, but don't appear to pass to the process input. If I echo via shell vs process with hub i get (on latest)
echo pull-request -i -h crrel:
v1.11.0 works starting with v1.12.0 it breaks and no longer provides the input to the task using the ${input:xxx}
This looks like nothing was populated from either input:
echo pull-request -i -h crrel:
So to be clear you want to be able to have the input return an empty string?
If you explicitly want to allow empty values, you can put "defaultOptions": [""]
in your input's arguments.
well, no, it was that with the new post v1.11, its not populating the input values. At 1.11 is returns fine with no changes. So v.1.12 doesn't populate the variables
Sorry, I'm getting confused. Can you please tell me:
awk -F'[/-]'
exists1.11 returns the values to the task input variables. 1.12 doesn't return any values to task input variables for both changes there are no changes to the branch and issue values. Its unclear to me if its on the getting or passing to the task.
I'm sorry, it's still hard to follow.
Is this correct:
echo pull-request -i <branch up to /> -h crrel:<branch>
echo pull-request -i -h crrel:
Are you prompted to make any selections with the dropdown menu? If so, what are you asked and what do you select?
Please specify the output of git rev-parse --abbrev-ref HEAD
.
Yes, I am prompted with the selections so the population of the values is working, it seems to be in the passing to the task where the issue occurs.
And you are correct what output looks like for the two releases.
git rev-parse --abbrev-ref HEAD
issues/8450-Testing-hub-issue
Thanks for the answer. Unfortunately, I cannot reproduce it. I am using your same branch name and same tasks.json
.
If I create a branch with some additional logging, would you be willing to run it locally and show the output? You just have to clone the repo, open it in VSCode, and press "Run Extension" from the debug tab. This will open a new instance of VSCode with the locally built extension running. You can open your project and run your task. Then, please share the logs from the original VSCode window debug console.
sure, happy to provide any additional debugging as needed
Can you please try out the branch fix_112
?
actually, its not building
> tasks-shell-input@1.12.2 compile
> tsc -p ./
src/lib/CommandHandler.ts:290:25 - error TS2869: Right operand of ?? is unreachable because the left operand is never nullish.
290 picker?.selectedItems?.length === 0 ?? true;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in src/lib/CommandHandler.ts:290
I removed the ?? true
to compile it and now I have
Get defualt called for undefined: []
extensionHostProcess.js:155
Result of runCommand for undefined: {"stdout":"8453\nissues/8453-pointcloud-bare-earth-should-use-smrf\n","stderr":""}
extensionHostProcess.js:155
Result of parseResult for undefined: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
extensionHostProcess.js:155
Get defualt called for undefined: []
extensionHostProcess.js:155
onDidAccept for undefined:
extensionHostProcess.js:155
quickPick.then() for undefined returning
extensionHostProcess.js:155
quickPick.finally() for undefined disposing
extensionHostProcess.js:155
onDidHide for undefined: undefined
extensionHostProcess.js:155
Result of quickPick for undefined: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
extensionHostProcess.js:155
Returning from handle for undefined: ""
extensionHostProcess.js:155
Get defualt called for undefined: []
extensionHostProcess.js:155
Result of runCommand for undefined: {"stdout":"issues/8453-pointcloud-bare-earth-should-use-smrf\n","stderr":""}
extensionHostProcess.js:155
Result of parseResult for undefined: [{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
extensionHostProcess.js:155
Get defualt called for undefined: []
extensionHostProcess.js:155
onDidAccept for undefined:
extensionHostProcess.js:155
quickPick.then() for undefined returning
extensionHostProcess.js:155
quickPick.finally() for undefined disposing
extensionHostProcess.js:155
onDidHide for undefined: undefined
extensionHostProcess.js:155
Very interesting. Thanks for trying it. Could you please try the latest commit on that branch?
The ?? true
thing is interesting too. It compiles just fine for me, but it also does not complain if I remove the nullish coalescing and optional chaining. I did not do this part. I have to assume it's there for a reason. Maybe it's for compatibility for a different version of the VSCode API.
Debug logs
onDidAccept for undefined: {"x":{"id":"augustocdias.tasks-shell-input","identifier":{"value":"augustocdias.tasks-shell-input","_lower":"augustocdias.tasks-shell-input"},"isBuiltin":false,"isUserBuiltin":false,"isUnderDevelopment":true,"extensionLocation":{"$mid":1,"fsPath":"/Users/rdcrlmds/Documents/Development/vscode-shell-command","path":"/Users/rdcrlmds/Documents/Development/vscode-shell-command","scheme":"file"},"targetPlatform":"undefined","name":"tasks-shell-input","displayName":"Tasks Shell Input","description":"Use shell commands as input for your tasks","icon":"icon.png","version":"1.12.2","publisher":"augustocdias","repository":{"url":"https://github.com/augustocdias/vscode-shell-command"},"engines":{"vscode":"^1.37.0"},"categories":["Other"],"activationEvents":["onCommand:shellCommand.execute"],"main":"./out/extension.js","contributes":{"menus":{"commandPalette":[{"command":"shellCommand.execute","when":"false"}]},"commands":[{"command":"shellCommand.execute","title":"Execute shell command"}]},"scripts":{"vscode:prepublish":"npm run compile","compile":"tsc -p ./","watch":"tsc -watch -p ./","lintd":"eslint_d src --ext .ts","lint":"eslint src --ext .ts","lint:fix":"npm run lint -- --fix","lintd:fix":"npm run lintd -- --fix","test":"vitest run","test:watch":"vitest"},"devDependencies":{"@types/glob":"8.1.0","@types/node":"20.11.30","@types/vscode":"1.37.0","@typescript-eslint/eslint-plugin":"7.3.1","@typescript-eslint/parser":"7.3.1","eslint":"8.57.0","glob":"10.3.10","mocha":"10.3.0","typescript":"5.4.3","vitest":"1.4.0","vscode-test":"1.6.1"}},"_id":4,"e":true,"f":true,"g":true,"j":false,"k":true,"l":"","n":[],"o":{},"p":{"z":1,"u":{"id":1581}},"q":{"z":0},"r":{"z":0},"s":{"z":1,"u":{"id":1582}},"u":{"id":4},"v":false,"w":[{"z":0},{"z":1,"u":{"id":1582}},{"z":1,"u":{"id":1581}},{"z":0},{"z":0},{"z":0},{"z":0}],"B":[{"label":"8453","value":"8453"},{"label":"issues/8453-pointcloud-bare-earth-should-use-smrf","value":"issues/8453-pointcloud-bare-earth-should-use-smrf"}],"C":{},"D":{},"E":false,"F":true,"G":true,"H":true,"I":false,"J":[{"label":"issues/8453-pointcloud-bare-earth-should-use-smrf","value":"issues/8453-pointcloud-bare-earth-should-use-smrf"}],"K":{"z":0},"L":[{"label":"issues/8453-pointcloud-bare-earth-should-use-smrf","value":"issues/8453-pointcloud-bare-earth-should-use-smrf"}],"M":{"z":0},"N":{"z":0}}
extensionHostProcess.js:155
onDidHide for undefined: issues/8453-pointcloud-bare-earth-should-use-smrf
extensionHostProcess.js:155
quickPick.then() for undefined returning issues/8453-pointcloud-bare-earth-should-use-smrf
extensionHostProcess.js:155
quickPick.finally() for undefined disposing
extensionHostProcess.js:155
onDidHide for undefined: issues/8453-pointcloud-bare-earth-should-use-smrf
extensionHostProcess.js:155
Result of quickPick for undefined: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
extensionHostProcess.js:155
Returning from handle for undefined: "issues/8453-pointcloud-bare-earth-should-use-smrf"
extensionHostProcess.js:155
Get defualt called for undefined: []
extensionHostProcess.js:155
Result of runCommand for undefined: {"stdout":"issues/8453-pointcloud-bare-earth-should-use-smrf\n","stderr":""}
extensionHostProcess.js:155
Result of parseResult for undefined: [{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
extensionHostProcess.js:155
Get defualt called for undefined: []
It didn't actually take the input and submit but it did prompt with the values.
Thanks. Are you sure it's the complete log? It seems like something is missing.
Could you please try the latest commit? It might even work for you already
better in that hitting enter did advance it but it didn't populate to the task (but the input fields did show the correct values)
Executing task: hub pull-request -i -h crrel:
log:
[INFO] 2024-10-02T23:18:28.005Z - Translations initialized.
extensionHostProcess.js:155
[INFO] 2024-10-02T23:18:28.007Z - Extension activated!
extensionHostProcess.js:155
Congratulations, your extension "django-intellisense" is now active!
extensionHostProcess.js:155
Get defualt called for undefined: []
extensionHostProcess.js:155
Result of runCommand for undefined: {"stdout":"8453\nissues/8453-pointcloud-bare-earth-should-use-smrf\n","stderr":""}
extensionHostProcess.js:155
Result of parseResult for undefined: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
extensionHostProcess.js:155
onDidAccept for undefined: {"x":{"id":"augustocdias.tasks-shell-input","identifier":{"value":"augustocdias.tasks-shell-input","_lower":"augustocdias.tasks-shell-input"},"isBuiltin":false,"isUserBuiltin":false,"isUnderDevelopment":true,"extensionLocation":{"$mid":1,"fsPath":"/Users/rdcrlmds/Documents/Development/vscode-shell-command","path":"/Users/rdcrlmds/Documents/Development/vscode-shell-command","scheme":"file"},"targetPlatform":"undefined","name":"tasks-shell-input","displayName":"Tasks Shell Input","description":"Use shell commands as input for your tasks","icon":"icon.png","version":"1.12.2","publisher":"augustocdias","repository":{"url":"https://github.com/augustocdias/vscode-shell-command"},"engines":{"vscode":"^1.37.0"},"categories":["Other"],"activationEvents":["onCommand:shellCommand.execute"],"main":"./out/extension.js","contributes":{"menus":{"commandPalette":[{"command":"shellCommand.execute","when":"false"}]},"commands":[{"command":"shellCommand.execute","title":"Execute shell command"}]},"scripts":{"vscode:prepublish":"npm run compile","compile":"tsc -p ./","watch":"tsc -watch -p ./","lintd":"eslint_d src --ext .ts","lint":"eslint src --ext .ts","lint:fix":"npm run lint -- --fix","lintd:fix":"npm run lintd -- --fix","test":"vitest run","test:watch":"vitest"},"devDependencies":{"@types/glob":"8.1.0","@types/node":"20.11.30","@types/vscode":"1.37.0","@typescript-eslint/eslint-plugin":"7.3.1","@typescript-eslint/parser":"7.3.1","eslint":"8.57.0","glob":"10.3.10","mocha":"10.3.0","typescript":"5.4.3","vitest":"1.4.0","vscode-test":"1.6.1"}},"_id":2,"e":true,"f":true,"g":true,"j":false,"k":true,"l":"","n":[],"o":{},"p":{"z":1,"u":{"id":1663}},"q":{"z":0},"r":{"z":0},"s":{"z":1,"u":{"id":1664}},"u":{"id":2},"v":false,"w":[{"z":0},{"z":1,"u":{"id":1664}},{"z":1,"u":{"id":1663}},{"z":0},{"z":0},{"z":0},{"z":0}],"B":[{"label":"issues/8453-pointcloud-bare-earth-should-use-smrf","value":"issues/8453-pointcloud-bare-earth-should-use-smrf"}],"C":{},"D":{},"E":false,"F":true,"G":true,"H":true,"I":false,"J":[],"K":{"z":0},"L":[],"M":{"z":0},"N":{"z":0}}
extensionHostProcess.js:155
onDidAccept for undefined:
extensionHostProcess.js:155
quickPick.finally() for undefined disposing
extensionHostProcess.js:155
onDidHide for undefined: undefined
extensionHostProcess.js:155
Result of quickPick for undefined: [{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
extensionHostProcess.js:155
Returning from handle for undefined: ""
This seems like something weird with vscode.
Can you please try with only 1 input in your command? Can you also please give a different taskId to each input?
only one input and I added taskId: 1 to the input value
Get defualt called for 1: []
extensionHostProcess.js:155
onDidAccept for 1: {"x":{"id":"augustocdias.tasks-shell-input","identifier":{"value":"augustocdias.tasks-shell-input","_lower":"augustocdias.tasks-shell-input"},"isBuiltin":false,"isUserBuiltin":false,"isUnderDevelopment":true,"extensionLocation":{"$mid":1,"fsPath":"/Users/rdcrlmds/Documents/Development/vscode-shell-command","path":"/Users/rdcrlmds/Documents/Development/vscode-shell-command","scheme":"file"},"targetPlatform":"undefined","name":"tasks-shell-input","displayName":"Tasks Shell Input","description":"Use shell commands as input for your tasks","icon":"icon.png","version":"1.12.2","publisher":"augustocdias","repository":{"url":"https://github.com/augustocdias/vscode-shell-command"},"engines":{"vscode":"^1.37.0"},"categories":["Other"],"activationEvents":["onCommand:shellCommand.execute"],"main":"./out/extension.js","contributes":{"menus":{"commandPalette":[{"command":"shellCommand.execute","when":"false"}]},"commands":[{"command":"shellCommand.execute","title":"Execute shell command"}]},"scripts":{"vscode:prepublish":"npm run compile","compile":"tsc -p ./","watch":"tsc -watch -p ./","lintd":"eslint_d src --ext .ts","lint":"eslint src --ext .ts","lint:fix":"npm run lint -- --fix","lintd:fix":"npm run lintd -- --fix","test":"vitest run","test:watch":"vitest"},"devDependencies":{"@types/glob":"8.1.0","@types/node":"20.11.30","@types/vscode":"1.37.0","@typescript-eslint/eslint-plugin":"7.3.1","@typescript-eslint/parser":"7.3.1","eslint":"8.57.0","glob":"10.3.10","mocha":"10.3.0","typescript":"5.4.3","vitest":"1.4.0","vscode-test":"1.6.1"}},"_id":1,"e":true,"f":true,"g":true,"j":false,"k":true,"l":"","n":[],"o":{},"p":{"z":1,"u":{"id":1804}},"q":{"z":0},"r":{"z":0},"s":{"z":1,"u":{"id":1805}},"u":{"id":1},"v":false,"w":[{"z":0},{"z":1,"u":{"id":1805}},{"z":1,"u":{"id":1804}},{"z":0},{"z":0},{"z":0},{"z":0}],"B":[{"label":"8453","value":"8453"},{"label":"issues/8453-pointcloud-bare-earth-should-use-smrf","value":"issues/8453-pointcloud-bare-earth-should-use-smrf"}],"C":{},"D":{},"E":false,"F":true,"G":true,"H":true,"I":false,"J":[],"K":{"z":0},"L":[],"M":{"z":0},"N":{"z":0}}
extensionHostProcess.js:155
onDidAccept for 1:
extensionHostProcess.js:155
quickPick.finally() for 1 disposing
extensionHostProcess.js:155
onDidHide for 1: undefined
extensionHostProcess.js:155
Result of quickPick for 1: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
extensionHostProcess.js:155
Returning from handle for 1: ""
extensionHostProcess.js:155
VSCode
Version: 1.93.1 (Universal)
Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
Date: 2024-09-11T17:20:05.685Z
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0
Since you say 1.11 is working and 1.12 is not, could you use git bisect to find the bad commit?
first bad commit is
0b4663c661cbd7feb3b2adeedd47ef57416a1faa is the first bad commit
commit 0b4663c661cbd7feb3b2adeedd47ef57416a1faa
Author: Marcel Robitaille <mail@marcelrobitaille.me>
Date: Mon Sep 30 21:46:54 2024 +0200
I don't really see anything in that commit that should cause this.
Could you please try 1.12.3? I just released it and I implemented some stuff from the fix_112 branch.
If that doesn't work, we can bisect this commit to find the bad part.
just tried 1.12.3, no luck. It does prompt and shows the values but then its not passed through to the task.
Please try the latest commit on fix_112
. Warning: I rebased on master and force-pushed.
latest fix on fix_112
does indeed work!
Really weird. Definitely seems like a bug in VSCode. If I set picker.activeItems
to set the default highlighted items, then when you select something, picker.selectedItems
is undefined. It seems to depend on the VSCode version too.
Can you please try the latest commit?
latest commit fails
Too bad. Can you try 14225921afbbf3bd6538e462fa494eb4b207111b please?
What about 9c43c81c6d75db58ba089fc65cd32e6436bd3bba?
I think https://github.com/augustocdias/vscode-shell-command/commit/14225921afbbf3bd6538e462fa494eb4b207111b works for you because you have no default items (rememberPrevious = true
). I think 9c43c81c6d75db58ba089fc65cd32e6436bd3bba will work for you, but maybe not if you enable rememberPrevious.
I'm really confused. I have the same version of VSCode.
That works too
Great. Can you please check the logs? I expect one line Active items: []
.
Can you please try with rememberPrevious = true
? You might have to run through twice; once to save the value and once to trigger the error.
with rememberPrevious (which it does remember)
Extension "openapi-lint" activated. 11
openapi-lint: Installed save handler
[INFO] 2024-10-03T17:13:44.314Z - Translations initialized.
[INFO] 2024-10-03T17:13:44.316Z - Extension activated!
Get defualt called for 1:
Result of runCommand for 1: {"stdout":"8453\nissues/8453-pointcloud-bare-earth-should-use-smrf\n","stderr":""}
Result of parseResult for 1: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
Get defualt called for 1:
Active items:
onDidAccept for 1: resolving
quickPick.finally() for 1 disposing
onDidHide for 1: resolving
Result of quickPick for 1: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
Returning from handle for 1: "8453"
Get defualt called for 2:
Result of runCommand for 2: {"stdout":"issues/8453-pointcloud-bare-earth-should-use-smrf\n","stderr":""}
Result of parseResult for 2: [{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
Get defualt called for 2:
Active items:
onDidAccept for 2: resolving
quickPick.finally() for 2 disposing
onDidHide for 2: resolving
Result of quickPick for 2: [{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
Returning from handle for 2: "issues/8453-pointcloud-bare-earth-should-use-smrf"
Get defualt called for 1: 8453
Result of runCommand for 1: {"stdout":"8453\nissues/8453-pointcloud-bare-earth-should-use-smrf\n","stderr":""}
Result of parseResult for 1: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
Get defualt called for 1: 8453
Active items: [object Object]
onDidAccept for 1: resolving
quickPick.finally() for 1 disposing
onDidHide for 1: resolving
Result of quickPick for 1: [{"value":"8453","label":"8453"},{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
Returning from handle for 1: "8453"
Get defualt called for 2: issues/8453-pointcloud-bare-earth-should-use-smrf
Result of runCommand for 2: {"stdout":"issues/8453-pointcloud-bare-earth-should-use-smrf\n","stderr":""}
Result of parseResult for 2: [{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
Get defualt called for 2: issues/8453-pointcloud-bare-earth-should-use-smrf
Active items: [object Object]
onDidAccept for 2: resolving
quickPick.finally() for 2 disposing
onDidHide for 2: resolving
Result of quickPick for 2: [{"value":"issues/8453-pointcloud-bare-earth-should-use-smrf","label":"issues/8453-pointcloud-bare-earth-should-use-smrf"}]
Returning from handle for 2: "issues/8453-pointcloud-bare-earth-should-use-smrf"
So it's working even with remember previous? Awesome
@msmitherdc Please try 1.12.4.
Thanks!
This all works at v1.9.2 and doesn't at v1.12.2.
Not sure what changed such that this no longer works.