Skip to content
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

Select Azure DevOps organization associated with repository hangs #538

Open
VanessaRussell opened this issue Jul 28, 2023 · 11 comments · May be fixed by #595
Open

Select Azure DevOps organization associated with repository hangs #538

VanessaRussell opened this issue Jul 28, 2023 · 11 comments · May be fixed by #595
Labels
Area: VsCodeExtension bug Something isn't working

Comments

@VanessaRussell
Copy link

Whenever I open a yml file that I've associated with the Azure Pipelines extension, I will receive this popup asking me to select the Azure DevOps organization that is associated with my repository for better IntelliSense:
image

Clicking on the Select organization button will open the command palette; however, nothing seems to happen no matter how long I leave it spinning. I've also tried directly typing in the name of the organization and pressing Enter; but, it had no effect. This leads me to believe that the feature is bugged.
image

image
image

@50Wliu
Copy link
Member

50Wliu commented Aug 17, 2023

Is this an ADO repo or a repo from some other Git provider (GitHub, etc.)?

Can you also go to the Output pane (Ctrl+Shift+U), select the "Azure Pipelines" log, and paste its contents here?

@VanessaRussell
Copy link
Author

It is indeed an internal MS ADO repo.

That said, it seems something has changed in the background as I no longer get the Select Azure DevOps Organization prompt when opening an yml pipeline file. Without the prompt popping up, I don't know how to attempt to select an ADO Organization to get you the requested output logs as the option does not seem to be within the command palette.

The extension still seems to be the same version:
image

Whereas, VS Code is a newer version:
image

@50Wliu
Copy link
Member

50Wliu commented Aug 17, 2023

Interesting, if you're in an ADO repo, the detection should happen silently :) (because it can figure out what organization it needs from the Git URL!).

Since you're not seeing this anymore, that's a good sign it was able to perform the schema detection properly this time. You can test this out by seeing if internal tasks have warning squigglies (bad) or descriptions on hover (good).

I don't think we can investigate this further at the moment, so I'm going to close this - but if you start seeing the prompt again, or the squigglies are showing up, we can re-open :).

@50Wliu 50Wliu closed this as completed Aug 17, 2023
@VanessaRussell
Copy link
Author

VanessaRussell commented Aug 17, 2023

Since you're not seeing this anymore, that's a good sign it was able to perform the schema detection properly this time. You can test this out by seeing if internal tasks have warning squigglies (bad) or descriptions on hover (good).

@50Wliu , clarifying question about this statement:

Are you saying that I would not be seeing these yellow squiggles if the extension had correctly determined the ADO organization? Both of these pipelines work as intended when ran as the tasks are currently available within the organization.

image
image

EDIT:
I left the first yml file open, closed VS Code, and reopened VS Code which caused the following to be outputted:
image

@50Wliu 50Wliu reopened this Aug 17, 2023
@VanessaRussell
Copy link
Author

I got the popup notification again today. Nothing seems to be in the Azure Pipelines output log though:

image

Still same VSCode and extension versions as noted here: #538 (comment)

@50Wliu
Copy link
Member

50Wliu commented Sep 21, 2023

@VanessaRussell, we released a new version this week that should have much-improved logging; would you mind trying again? Sorry for the hassle 😅.

@VanessaRussell
Copy link
Author

From the Azure Pipelines output:

(9/21/2023, 2:38:00 PM) [SchemaDetection] Detecting schema for workspace folder NotificationSystem
(9/21/2023, 2:38:06 PM) [SchemaDetection] Found remote URL for NotificationSystem: ScrubbedByVanessa
(9/21/2023, 2:38:06 PM) [SchemaDetection] NotificationSystem is an Azure repo
(9/21/2023, 2:38:07 PM) [SchemaDetection] Error auto-detecting schema for workspace folder NotificationSystem: TypeError: Cannot read properties of undefined (reading 'authenticatedUser')
(9/21/2023, 2:38:07 PM) [SchemaDetection] Using hardcoded schema for workspace folder NotificationSystem: /c:/Users/VanessaAlias/.vscode/extensions/ms-azure-devops.azure-pipelines-1.228.0/service-schema.json
(9/21/2023, 2:38:07 PM) [ExtensionActivated] Extension has been activated!
(9/21/2023, 2:38:10 PM) [SchemaDetection] Detecting schema for workspace folder NotificationSystem
(9/21/2023, 2:38:11 PM) [SchemaDetection] Found remote URL for NotificationSystem: ScrubbedByVanessa
(9/21/2023, 2:38:11 PM) [SchemaDetection] NotificationSystem is an Azure repo
(9/21/2023, 2:38:11 PM) [SchemaDetection] Error auto-detecting schema for workspace folder NotificationSystem: TypeError: Cannot read properties of undefined (reading 'authenticatedUser')
(9/21/2023, 2:38:11 PM) [SchemaDetection] Using hardcoded schema for workspace folder NotificationSystem: /c:/Users/VanessaAlias/.vscode/extensions/ms-azure-devops.azure-pipelines-1.228.0/service-schema.json

From the Azure Pipelines Language output:

getSchemaForResource
resource: file:///c%3A/Repos/NotificationSystem/.pipelines/templates/pipelines/BuildProjectTemplate.yml
this.customSchemaProvider: yes
getSchemaForResource
resource: file:///c%3A/Repos/NotificationSystem/.pipelines/templates/pipelines/BuildProjectTemplate.yml
this.customSchemaProvider: yes
loadSchema
getSchemaForResource
resource: file:///c%3A/Repos/NotificationSystem/.pipelines/templates/pipelines/BuildProjectTemplate.yml
this.customSchemaProvider: yes
loadSchema
getSchemaForResource
resource: file:///c%3A/Repos/NotificationSystem/.pipelines/templates/pipelines/BuildProjectTemplate.yml
this.customSchemaProvider: yes
loadSchema

The yellow squiggles:
image

image
image

I tried open/close VS Code a few times and didn't get the popup asking to select the ADO Repo which makes sense since the logs indicate that it is identifying it correctly.

@50Wliu
Copy link
Member

50Wliu commented Sep 21, 2023

(9/21/2023, 2:38:07 PM) [SchemaDetection] Error auto-detecting schema for workspace folder NotificationSystem: TypeError: Cannot read properties of undefined (reading 'authenticatedUser')
Woo, something to go off of! Thanks, I'll see if I can make any progress on why you're hitting an error.

On a hunch...what happens if you navigate to https://app.vssps.visualstudio.com/_apis/connectiondata in your browser? You should get a JSON blob back with - crucially - an authenticatedUser object.

@50Wliu 50Wliu added the bug Something isn't working label Sep 22, 2023
@VanessaRussell
Copy link
Author

I get this JSON blob. I've removed the values to post publicly. Feel free to reach out on Teams if the values matter 🙂

{
    "authenticatedUser": {
        "id": "",
        "descriptor": "",
        "subjectDescriptor": "",
        "providerDisplayName": "",
        "isActive": true,
        "properties": {
            "Account": {
                "$type": "",
                "$value": ""
            }
        },
        "resourceVersion": 0,
        "metaTypeId": 0
    },
    "authorizedUser": {
        "id": "",
        "descriptor": "",
        "subjectDescriptor": "",
        "providerDisplayName": "",
        "isActive": true,
        "properties": {
            "Account": {
                "$type": "",
                "$value": ""
            }
        },
        "resourceVersion": 0,
        "metaTypeId": 0
    },
    "instanceId": "",
    "deploymentId": "",
    "deploymentType": "",
    "locationServiceData": {
        "serviceOwner": "",
        "defaultAccessMappingMoniker": "",
        "lastChangeId": 0,
        "lastChangeId64": 0
    }
}

@systobe
Copy link

systobe commented Sep 29, 2023

I have the same issue. I'm also able to retrieve the authenticatedUser object.

(9/29/2023, 11:57:17 AM) [SchemaDetection] Detecting schema for workspace folder myRepo
(9/29/2023, 11:57:18 AM) [SchemaDetection] Found remote URL for myRepo: https://myADOurl/org/project/_git/myRepo
(9/29/2023, 11:57:18 AM) [SchemaDetection] myRepo has no remote URL or is not an Azure repo
(9/29/2023, 11:57:18 AM) [SchemaDetection] Prompting for organization for myRepo
(9/29/2023, 11:57:18 AM) [SchemaDetection] Using hardcoded schema for workspace folder myRepo: /c:/Users/myUser/.vscode/extensions/ms-azure-devops.azure-pipelines-1.228.0/service-schema.json
Version: 1.82.2 (user setup)
Commit: abd2f3db4bdb28f9e95536dfa84d8479f1eb312d
Date: 2023-09-14T05:55:25.390Z
Electron: 25.8.1
ElectronBuildId: 23779380
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22000

Extension version v1.228.0

@revolutionair
Copy link

Same issue here, same extension version as user systobe above (v1.228.0)

VSCode version:

Version: 1.91.1 (system setup)
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:06:49.809Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Windows_NT x64 10.0.19045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: VsCodeExtension bug Something isn't working
Projects
None yet
5 participants