ipatalas / vscode-sprint-planner

Plan your sprints in VSCode directly!
MIT License
37 stars 21 forks source link

Unable to retrieve US #9

Closed kkum closed 4 years ago

kkum commented 4 years ago

With Full Access token It seems that i cannot retrieve the user stories from any given sprints. Iteration retrieval works fine though. image Am i missing some configuration on Azure devops?

ipatalas commented 4 years ago

I assume organization, project and team settings are all filled?

Try turning Debug logging on: image

It should start logging all requests going to Azure DevOps API and when an error happens also the response. Unfortunately it's not written to the output channel but rather the "regular" console which you will find after you execute Toggle Developer tools command (Ctrl-Shift-I by default). Let me know if there's anything interesting there.

Update: probably there are some user stories retrieved because otherwise a text stating that nothing was found would be logged. There might be a different reason why it doesn't work so let's see more detailed logs.

kkum commented 4 years ago

Hello, Every setting was filled, US and their corresponding tasks seems to be properly retrieved. Below is the log with settings replaced like so [UPPERCASE]

console.ts:137 [Extension Host] Getting Iteration Id
console.ts:137 [Extension Host] rejected promise not handled within 1 second: TypeError: Cannot read property 'find' of undefined
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:580
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:580
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:200
addChunk @ _stream_readable.js:294
readableAddChunk @ _stream_readable.js:275
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
console.ts:137 [Extension Host] stack trace: TypeError: Cannot read property 'find' of undefined    at SessionStore.<anonymous> (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:35:60)  at Generator.next (<anonymous>) at c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:7:71  at new Promise (<anonymous>)    at __awaiter (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:3:12)  at SessionStore.setCustomIteration (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:25:16)   at SessionStore.<anonymous> (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:109:18) at Generator.next (<anonymous>) at c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:7:71  at new Promise (<anonymous>)    at __awaiter (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:3:12)  at SessionStore.determineIteration (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:108:16)  at SessionStore.<anonymous> (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:94:40)  at Generator.next (<anonymous>) at c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:7:71  at new Promise (<anonymous>)    at __awaiter (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:3:12)  at SessionStore.ensureHasUserStories (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:89:16) at UserStoryCompletionProvider.<anonymous> (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\providers\userStoryCompletionProvider.js:24:45)   at Generator.next (<anonymous>) at c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\providers\userStoryCompletionProvider.js:7:71  at new Promise (<anonymous>)    at __awaiter (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\providers\userStoryCompletionProvider.js:3:12)  at UserStoryCompletionProvider.provideCompletionItems (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\providers\userStoryCompletionProvider.js:20:16)    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:568:526   at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:52:363    at new Promise (<anonymous>)    at Object.t.asPromise (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:52:335)   at T.provideCompletionItems (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:568:497)    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:583:783   at H._withAdapter (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:576:901)  at H.$provideCompletionItems (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:583:761)   at f._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:646:285)  at f._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:645:999)    at f._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:644:613)   at f._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:643:477)    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:641:754   at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:47:207)   at _.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:187:274)  at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:798:104   at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:47:207)   at _.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:187:274)  at t.PersistentProtocol._receiveMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:191:629)    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:188:824   at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:47:207)   at f.acceptChunk (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:184:737)   at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:184:89    at Socket.t (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:193:68) at Socket.emit (events.js:200:13)   at addChunk (_stream_readable.js:294:12)    at readableAddChunk (_stream_readable.js:275:11)    at Socket.Readable.push (_stream_readable.js:210:10)    at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:580
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:580
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:200
addChunk @ _stream_readable.js:294
readableAddChunk @ _stream_readable.js:275
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
mainThreadExtensionService.ts:65 [[object Object]]Cannot read property 'find' of undefined
$onExtensionRuntimeError @ mainThreadExtensionService.ts:65
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:580
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:580
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:200
addChunk @ _stream_readable.js:294
readableAddChunk @ _stream_readable.js:275
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
mainThreadExtensionService.ts:66 TypeError: Cannot read property 'find' of undefined
    at SessionStore.<anonymous> (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:35:60)
    at Generator.next (<anonymous>)
    at c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:3:12)
    at SessionStore.setCustomIteration (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:25:16)
    at SessionStore.<anonymous> (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:109:18)
    at Generator.next (<anonymous>)
    at c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:3:12)
    at SessionStore.determineIteration (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:108:16)
    at SessionStore.<anonymous> (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:94:40)
    at Generator.next (<anonymous>)
    at c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:3:12)
    at SessionStore.ensureHasUserStories (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\store.js:89:16)
    at UserStoryCompletionProvider.<anonymous> (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\providers\userStoryCompletionProvider.js:24:45)
    at Generator.next (<anonymous>)
    at c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\providers\userStoryCompletionProvider.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\providers\userStoryCompletionProvider.js:3:12)
    at UserStoryCompletionProvider.provideCompletionItems (c:\Users\kkum\.vscode\extensions\ipatalas.vscode-sprint-planner-0.3.0\out\providers\userStoryCompletionProvider.js:20:16)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:568:526
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:52:363
    at new Promise (<anonymous>)
    at Object.t.asPromise (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:52:335)
    at T.provideCompletionItems (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:568:497)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:583:783
    at H._withAdapter (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:576:901)
    at H.$provideCompletionItems (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:583:761)
    at f._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:646:285)
    at f._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:645:999)
    at f._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:644:613)
    at f._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:643:477)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:641:754
    at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:47:207)
    at _.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:187:274)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:798:104
    at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:47:207)
    at _.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:187:274)
    at t.PersistentProtocol._receiveMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:191:629)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:188:824
    at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:47:207)
    at f.acceptChunk (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:184:737)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:184:89
    at Socket.t (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:193:68)
    at Socket.emit (events.js:200:13)
    at addChunk (_stream_readable.js:294:12)
    at readableAddChunk (_stream_readable.js:275:11)
    at Socket.Readable.push (_stream_readable.js:210:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)
$onExtensionRuntimeError @ mainThreadExtensionService.ts:66
_doInvokeHandler @ rpcProtocol.ts:398
_invokeHandler @ rpcProtocol.ts:383
_receiveRequest @ rpcProtocol.ts:299
_receiveOneMessage @ rpcProtocol.ts:226
(anonymous) @ rpcProtocol.ts:101
fire @ event.ts:580
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:580
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:200
addChunk @ _stream_readable.js:294
readableAddChunk @ _stream_readable.js:275
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166
console.ts:137 [Extension Host] [DEBUG] GET /[ORGANISATION]/[PROJECT]/[TEAM]/_apis/work/teamsettings/iterations/[SOME-GUID]/workitems?api-version=5.0-preview.1
console.ts:137 [Extension Host] [DEBUG] GET /[ORGANISATION]/[PROJECT]/_apis/wit/workitems?ids=[A LIST OF IDs]&$expand=Relations
ipatalas commented 4 years ago

Oh... That looks like a bug then 😉 I'll analyze the stack trace later.

ipatalas commented 4 years ago

All right. This stack trace looks like it's been triggered when you had an iteration picked up explicitly, is that right?

Does it work when you specify iteration explicitly?

Seems like the logging is not verbose enough to figure out what's the problem. I've seen you've forked the project. Have you tried running it from sources? If not I can assist and give you some insight about where to put breakpoints and what to look for. That would be probably easier than adding lots of verbose logging now and then publishing a new 'debug' version. Is that ok?

kkum commented 4 years ago

I tried to run it from sources and no errors, Iterations are retrieved properly ( this is why I had it specified) retrieving US did not give any errors ... create a new US and then publish it and i Have the following error

[DEBUG] Response: {"$id":"1","innerException":null,"message":"VS402323: Work item type User Story does not exist in project [PROJECT-GUID] or you do not have permission to access it.","typeName":"Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.WorkItemTypeNotFoundException, Microsoft.TeamFoundation.WorkItemTracking.Server","typeKey":"WorkItemTypeNotFoundException","errorCode":0,"eventId":3200} (at AzureClient.logRequest (c:\Projects\vscode-sprint-planner\out\utils\azure-client.js:63:21))

I'll investigate on that side and let you know.

ipatalas commented 4 years ago

That's very useful information. It's getting work items of type User Story which it cannot find, hence empty list. That's why it doesn't give any error because the code is working properly - just no data is found. Perhaps you have it changed in your project and the types are not default. I didn't even know it can be changed. I have a playground account so I'll try to break it the same way :) If that's the case then the type has to be configurable which should be easy to do.

What you can also check on your side is to show Work Item Type column and see what are the values: image

Update:

that's what's probably filtering out your user stories: https://github.com/ipatalas/vscode-sprint-planner/blob/a3109df7c1944df1d9fc673e8c4a388eb40b43b8/src/utils/azure-client.ts#L161-L163

ipatalas commented 4 years ago

Reopening for now - easier to keep track of that and it's a possible feature enhancement

kkum commented 4 years ago

My US are "Product Backlog Item", changing the filter give me some results !! thanks for the hint, I'll check later if i can add this as a config setting, but first i need to take some time to read vscode addon documentions.... i'll also check how to add the story points to the US

ipatalas commented 4 years ago

https://docs.microsoft.com/en-us/azure/devops/boards/work-items/guidance/choose-process?view=azure-devops&tabs=basic-process#basic-agile-scrum-and-cmmi

In my whole Azure DevOps experience I've been always in projects with Agile process type. Seems like yours is set to Scrum, hence the difference in naming. That should be pretty easy to fix. I'll put it on the list. Can't promise a release date though. One evening is more than I need but these are hard to find these days 😉

ipatalas commented 4 years ago

Released a new version, check it out to see if that helps. Go to settings and change Process type from Agile to Scrum.