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

Add Azure DevOps integration #20202

Merged
merged 44 commits into from
Sep 27, 2024
Merged

Add Azure DevOps integration #20202

merged 44 commits into from
Sep 27, 2024

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Sep 11, 2024

Description

Related Issue(s)

Fixes ENT-552, ENT-780

How to test

It can setup an Azure DevOps integration
‼️ there should have only one DevOps integration in an installation because providers are uniq by host. There's only one org in Gitpod Enterprise, so it should be safe there. In preview env, it's working because of utils.ts changes

Test with Git Integration

  • Context are proper parsed on workspace creation page (not found? not authenticated?)
  • Workspaces are created with proper context
  • It can push to remote repository

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@mustard-mh mustard-mh changed the title WIP WIP WIP: Add Azure DevOps integration Sep 13, 2024
@geropl
Copy link
Member

geropl commented Sep 16, 2024

Awesome work @mustard-mh ! 🧡
Did not test (yet), but this looks really complete already. 🏁
Have a great week off, and see you next week 👋

Copy link

socket-security bot commented Sep 26, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] environment, filesystem Transitive: eval, network +3 6.86 MB edergachev

View full report↗︎

@mustard-mh mustard-mh changed the title WIP: Add Azure DevOps integration Add Azure DevOps integration Sep 27, 2024
@mustard-mh mustard-mh marked this pull request as ready for review September 27, 2024 07:50
@mustard-mh mustard-mh requested review from a team as code owners September 27, 2024 07:50
Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving some initial comments, will do another round before approving

components/server/src/dev/dev-data.ts Outdated Show resolved Hide resolved
Comment on lines 24 to 26
found = true;
isPrivateRepo = true;
writeAccessToRepo = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be useful to add a comment about why we can make these assumptions. I know that it has to be private, but am not for instance sure about the write access one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no API to check if user has write permission on a repo. We assume user has write permission so that we don't show git permission missing on user push.

If write permission is actually missed, user can find it out from git commands error output

}

async getUserRepos(user: User): Promise<RepositoryInfo[]> {
// FIXME(janx): Not implemented yet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: poor @jankeromnes!

Suggested change
// FIXME(janx): Not implemented yet
// todo(hw): Not implemented yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

return result
.slice(1)
.map((c) => c.commitId)
.filter((c) => !!c) as string[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we could get rid of the type assertion by upgrading typescript

components/server/src/azure-devops/README.md Show resolved Hide resolved
@filiptronicek
Copy link
Member

@mustard-mh I wonder if there's something easy we can do on the integrations page WRT the Azure DevOps endpoint: I am not sure if we are at all compatible with DevOps server, but depending on that it'd be great to either nudge / restrict the endpoint to dev.azure.com

- dashboard provider type update
- doc for checkWriteAccess
- Requirement.DEFAULT
This reverts commit 189c431.
Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this Friday evening shipped 🚀

Incredible work, Huiwen!

@mustard-mh
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 41f47c8 into main Sep 27, 2024
28 of 29 checks passed
@roboquat roboquat deleted the hw/tt-azure branch September 27, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants