sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.12k stars 1.29k forks source link

Azure DevOps Testing Tracking Issue #48732

Open varsanojidan opened 1 year ago

varsanojidan commented 1 year ago

Note to testers

Suggested approach:

Setting up Azure DevOps + Sourcegraph

1) Add this codehost config, ~the credentials can be found in our password manager (under Azure DevOps temporary test credentials)~ (it is encouraged to try creating your own test credentials as that is also part of the site admin workflow)

{
"AZUREDEVOPS": [
    {
      "url": "https://dev.azure.com",
      "username": "<username>",
      "token": "<token>",
      "projects": ["sgtestazure/sgtestazure"]
    }
  ]
}

Additionally add the following to your site config

"experimentalFeatures": {
    "azureDevOps": "enabled"
  },

2) Setup ngrok

Azure DevOps Repository syncing

Azure DevOps OAuth provider testing scenarios

Azure DevOps permissions syncing testing scenarios

Azure DevOps Batch Changes

Setup:

  1. Create an Azure DevOps Personal Access Token with the following scopes:
    • Organization:All accessible organizations
    • Code:Full
    • Code:Status
    • Pull Request Thread:Read & Write
    • User Profile:Read
  2. Run sg start batches in your local dev env.
  3. On the sourcegraph UI, go to Settings -> Batch Changes, and add your credentials for ADO (same as above)
  4. Create a new Batch Change
  5. Use the example Hello World Batch Spec, hit Preview Workspaces, then Run Batch Spec
  6. Setup BC webhooks for ADO following this guide.
  7. Hit Preview, Apply, Select All, Publish Changesets, and enjoy playing around with some Batch Changes šŸ˜„

Scenarios:

mrnugget commented 1 year ago

I just noticed that ADO doesn't show up in the list of code hosts for the new setup wizard:

screenshot_2023-03-08_14 10 24@2x

Not a big problem, but you should talk to @vovakulikov to make sure this will work with the new setup experience flow if the feature flag is on.

mrnugget commented 1 year ago

Feedback on the new code host connection screen

image

Feedback on setting up auth provider

It's really confusing that it's called clientID in our schema but App ID on their end. I left a comment here https://github.com/sourcegraph/sourcegraph/pull/48822/files#r1129480449 saying the same thing.

indradhanush commented 1 year ago

Starting to test on Dogfood. Let's see how far I can get.

Azure DevOps Repository syncing

Azure DevOps OAuth provider testing scenarios

Azure DevOps permissions syncing testing scenarios

Azure DevOps Batch Changes

Setup:

  1. Create an Azure DevOps Personal Access Token with the following scopes:
    • Organization:All accessible organizations
    • Code:Full
    • Code:Status
    • Pull Request Thread:Read & Write
    • User Profile:Read
  2. Run sg start batches in your local dev env.
  3. On the sourcegraph UI, go to Settings -> Batch Changes, and add your credentials for ADO (same as above)
  4. Create a new Batch Change
  5. Use the example Hello World Batch Spec, hit Preview Workspaces, then Run Batch Spec
  6. Setup BC webhooks for ADO following this guide.
  7. Hit Preview, Apply, Select All, Publish Changesets, and enjoy playing around with some Batch Changes šŸ˜„

Scenarios:

List of bugs

indradhanush commented 1 year ago

Bugs with exclude

  1. Exclude org/project/repo not working
image

Edit: Using pattern worked

image

Edit2: This is working locally for me on latest main but not on dogfood. Maybe it's not on the latest change then. But the config editor still complains about the string not matching the pattern.

  1. Exclude repo from the repository settings page does not work.

    image
  2. No helpful example from exclude key unlike the projects key

CleanShot 2023-03-10 at 16 28 48

The same behaviour is also missing for the orgs key (not captured in GIF).

sashaostrikov commented 1 year ago

I did test setting a code host, everything works as expected šŸ‘šŸ» I also did a batch changes run without any problems. Good stuff @varsanojidan @indradhanush!