Skip to content

Feature/add azure dev ops#125

Open
RalfvandenBurg wants to merge 12 commits into
elsa-workflows:release/3.6.0from
RalfvandenBurg:feature/AddAzureDevOps
Open

Feature/add azure dev ops#125
RalfvandenBurg wants to merge 12 commits into
elsa-workflows:release/3.6.0from
RalfvandenBurg:feature/AddAzureDevOps

Conversation

@RalfvandenBurg
Copy link
Copy Markdown

Adds the Elsa.DevOps.AzureDevOps module to integrate Azure DevOps with Elsa Workflows. The implementation mirrors the structure and patterns of Elsa.DevOps.GitHub so workflows can call Azure DevOps Git, pull requests, work items, and builds from activities.
Closes #124

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 20, 2026

Greptile Summary

Adds comprehensive Azure DevOps integration module mirroring the existing GitHub integration structure. Implements 15 activities across four categories: Git repositories/branches, pull requests, work items, and builds.

Key Changes:

  • Added AzureDevOpsConnectionFactory for managing reusable VssConnection instances
  • Created base AzureDevOpsActivity class with built-in validation and authentication
  • Implemented activities for repositories (GetBranch, GetRepository, ListBranches)
  • Implemented activities for pull requests (CreatePullRequest, GetPullRequest, ListPullRequests)
  • Implemented activities for work items (CreateWorkItem, GetWorkItem, QueryWorkItems, UpdateWorkItem)
  • Implemented activities for builds (GetBuild, ListBuilds, QueueBuild)
  • Added comprehensive input validation helpers in ActivityInputValidation
  • Registered feature with proper dependency injection

Issues Found:

  • Connection factory stores PAT tokens in plain text as dictionary keys
  • VssConnection instances are cached indefinitely without disposal mechanism
  • Minor inefficiency in UpdateWorkItem when no fields are updated

Confidence Score: 3/5

  • Safe to merge with resource management concerns that should be addressed
  • The implementation is well-structured and follows existing patterns, but has resource management issues in the connection factory including storing credentials in memory and not disposing connections
  • Pay close attention to AzureDevOpsConnectionFactory.cs due to credential storage and resource disposal concerns

Important Files Changed

Filename Overview
src/modules/devops/Elsa.DevOps.AzureDevOps/Services/AzureDevOpsConnectionFactory.cs Connection factory with PAT token storage in dictionary key and no connection disposal
src/modules/devops/Elsa.DevOps.AzureDevOps/Activities/AzureDevOpsActivity.cs Base activity class with proper validation in CanExecuteAsync
src/modules/devops/Elsa.DevOps.AzureDevOps/Activities/PullRequests/CreatePullRequest.cs Creates pull requests with proper validation and ref normalization
src/modules/devops/Elsa.DevOps.AzureDevOps/Activities/WorkItems/UpdateWorkItem.cs Updates work items, creates connection twice when no changes provided
src/modules/devops/Elsa.DevOps.AzureDevOps/Features/AzureDevOpsFeature.cs Feature registration that adds activities and registers connection factory

Class Diagram

%%{init: {'theme': 'neutral'}}%%
classDiagram
    class AzureDevOpsActivity {
        +Input~string~ OrganizationUrl
        +Input~string~ Token
        #CanExecuteAsync() ValueTask~bool~
        #GetConnection() VssConnection
    }
    
    class AzureDevOpsConnectionFactory {
        -Dictionary~string,VssConnection~ _connections
        -SemaphoreSlim _semaphore
        +GetConnection(string organizationUrl, string token) VssConnection
    }
    
    class AzureDevOpsFeature {
        +Apply() void
    }
    
    class CreatePullRequest {
        +Input~string~ Project
        +Input~string~ RepositoryName
        +Input~string~ SourceBranch
        +Input~string~ TargetBranch
        +Output~GitPullRequest~ CreatedPullRequest
    }
    
    class CreateWorkItem {
        +Input~string~ Project
        +Input~string~ WorkItemType
        +Input~string~ Title
        +Output~WorkItem~ CreatedWorkItem
    }
    
    class QueueBuild {
        +Input~string~ Project
        +Input~int~ DefinitionId
        +Output~Build~ QueuedBuild
    }
    
    class GetBranch {
        +Input~string~ Project
        +Input~string~ RepositoryName
        +Input~string~ BranchName
        +Output~GitBranchStats~ Branch
    }
    
    AzureDevOpsActivity <|-- CreatePullRequest
    AzureDevOpsActivity <|-- CreateWorkItem
    AzureDevOpsActivity <|-- QueueBuild
    AzureDevOpsActivity <|-- GetBranch
    AzureDevOpsActivity ..> AzureDevOpsConnectionFactory : uses
    AzureDevOpsFeature ..> AzureDevOpsConnectionFactory : registers
    AzureDevOpsFeature ..> AzureDevOpsActivity : discovers activities
Loading

Last reviewed commit: 2bc247e

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

25 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread src/modules/devops/Elsa.DevOps.AzureDevOps/Activities/WorkItems/UpdateWorkItem.cs Outdated
Copy link
Copy Markdown

@Namoshek Namoshek left a comment

Choose a reason for hiding this comment

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

I've a bit of experience with the Azure DevOps client libraries and the PR looks good to me. The only thing I miss is a few blank lines to make the code more readable, but I guess that's personal preference. 😉

Comment thread src/modules/devops/Elsa.DevOps.AzureDevOps/Activities/Builds/ListBuilds.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants