Skip to content

Code documentation

Frédéric Jacques edited this page Jun 6, 2021 · 3 revisions

AzureDevOpsTeamMembersVelocity

DictionaireExtension JsonExtension
ListResponse\`1 Capacity
HrefObject IdentityRef
IdentityReference MemberVelocity
Sprint SprintAttributes
SprintLinks WorkItem
WorkItemLinks WorkItems
WorkItemUpdate ErrorModel
Program DevOpsProxy
DevOpsService VelocityService
Startup TeamMembersVelocitySettings
TeamProject

DictionaireExtension

Extension class to help work with the Fields property of Microsoft DevOps models

Get``1(System.Collections.Generic.IDictionary{System.String,System.Object},System.String)

TryGet the value of the corresponding key. If the value is present, a cast is applied, and the value is returned.

Type Parameters

  • T - Type of the corresponding value

System.ArgumentNullException:

System.InvalidCastException:

Get``1(System.Collections.Generic.IReadOnlyDictionary{System.String,System.Object},System.String)

TryGet the value of the corresponding key. If the value is present, a cast is applied, and the value is returned.

Type Parameters

  • T - Type of the corresponding value

System.ArgumentNullException:

System.InvalidCastException:

MaybeGet``1(System.Collections.Generic.IDictionary{System.String,System.Object},System.String)

Get the value of a corresponding key. If the value is present, ToString is called on the object and System.Json.Text deserialization will be executed on this value.

System.ArgumentNullException:

System.Text.Json.JsonException:

System.NotSupportedException:

MaybeGet``2(System.Collections.Generic.IDictionary{``0,``1},``0)

Get the value of a corresponding key or null of the dictionary does not contain the key.

System.ArgumentNullException:

JsonExtension

Extension to help to work with JSON data

FormatJson(System.String)

Transform a string a formatted JSON string

Newtonsoft.Json.JsonReaderException:

ListResponse`1

The object used to deserialize list response from the Azure DevOps REST API.

Type Parameters

  • T - Type of the resource

Count

The quantity of element

Value

The list of resource

Capacity

TeamMember

HrefObject

An object containing a link

Href

Href or link

System.UriFormatException:

UriInfo

Uri instance of the Href property

IdentityRef

Descriptor

IdentityReference

Descriptor

The descriptor field in the REST response

MemberVelocity

MemberVelocity is the model used to display stat about the velocity of a member.

CapacitySaved

The capacity saved. Normally based on the response of the Capacity REST API.

CompareTo(AzureDevOpsTeamMembersVelocity.Model.MemberVelocity)

Comparer MemberVelocity by HoursOfWorkDone

DisplayName

The name of the member

HoursOfWorkDone

The hours of work done. Normally calculated from the History according to the member.

RealCapacity

Estimated calculation of the real capacity of a member.

Updates

List of WorkItemUpdate associate to this member

Sprint

Representation of the sprint resource of the Azure DevOps API

Attributes

The attributes of the sprint. Such as Start Date, Finish Date, and TimeFrame

GetTotalDays

Calculate the number of total days between the Start Date and the FinishDate

Returns

GetTotalWorkingDays(workingDays, teamDaysOff)

Get total working days of a sprint.

Remarks

Ensure to pass non-null reference for each parameter. It will allow the function to do the right calculation. Since each parameter ar consider if they are not null.

Name Description
workingDays System.DayOfWeek[]
List of working days
teamDaysOff Microsoft.TeamFoundation.Work.WebApi.TeamSettingsDaysOff
TeamDaysOff information

Returns

GetTotalDays() - days off

Id

Id of the sprint

Links

Links related to the sprint

Name

Name of the sprint

Path

The Path of the sprint

Url

The Url of the sprint

SprintAttributes

The attributes of a sprint

FinishDate

Finish date

StartDate

Start date

TimeFrame

TimeFrame, current, past.

SprintLinks

Links related to a sprint

Capacity

Link to get capacity information of the sprint

ClassificationNode

The classification node of the sprint

Project

Link of the project of the sprint

Self

Link of the sprint itself

Team

Link of the team

TeamDaysOff

Link to get days off of the sprint

TeamIterations

The link of the iterations

TeamSettings

The team settings link

Workitems

Link to get related work item

WorkItem

Links

WorkItemLinks

Work item links object

Fields

The work item Fields URL

Html

The work item Html URL

Self

The work item URL

WorkItemComments

The work comments URL

WorkItemRevisions

The work item revisions URL

WorkItemType

The work item Type URL

WorkItemUpdates

The work item updates URL

WorkItems

A work item graph

Url

Work item URL

WorkItemRelations

List of related work item

WorkItemUpdate

CompareTo(AzureDevOpsTeamMembersVelocity.Model.WorkItemUpdate)

Compare a WorkItemUpdate base on the RelatedTaskTitle and if the save the RevisedDate

RelatedTaskTitle

The title of the associate WorkItem.

Remarks

Must be managed by the program logic. This data is not in the response of Azure DevOps REST API.

RevisedBy

ErrorModel

ErrorModel code generated by the dotnet new command

OnGet

The OnGet Method of the page

RequestId

ResquestId associate with the error

ShowRequestId

Indicated if RequestId can be shown. (If not NullOrEmpty)

Program

The entry point of the program. It also contains settings to use for System.Text.Json serialization.

CreateHostBuilder(args)

Create the host builder with some default settings

Name Description
args System.String[]
Main method args

Returns

A new HostBuilder

Main(args)

The entry point of the program

Name Description
args System.String[]

SerializerOptions

System.Text.Json SerializerOptions to use in serialization in the app.

DevOpsProxy

DevOpsProxy class is used to call Azure DevOps REST API. Implement rate-limiting and ensure URL validation.

Constructor(client, appSettings, logger)

Constructor with dependencies

Name Description
client System.Net.Http.HttpClient
HttpClient to used
appSettings AzureDevOpsTeamMembersVelocity.TeamMembersVelocitySettings
App settings, to acces AuthenticationHeader
logger Microsoft.Extensions.Logging.ILogger{AzureDevOpsTeamMembersVelocity.Proxy.DevOpsProxy}
Logger to log information and critical error

GetAsync(fullUrl)

Get the body content of a response according to a fullUrl

Name Description
fullUrl System.String
Complete URL of the resource to fetch. Must start with https://dev.azure.com/

Returns

The response body as a string

GetAsync``1(fullUrl)

Get the body content of a response according to a fullUrl

Type Parameters

  • T - Type used in deserialization
Name Description
fullUrl System.String
Complete URL of the resource to fetch. Must start with https://dev.azure.com/

Returns

The response body Deserialized as T

DevOpsService

Classed used to call and deserialize resource from the Azure DevOps REST API

Constructor(proxy)

Constructor with dependencies

Name Description
proxy AzureDevOpsTeamMembersVelocity.Proxy.DevOpsProxy
The proxy used to call the REST API

Capacities(capacityUrl)

Get the capacity of a sprint given a full URL

Remarks

api-version 6.0 is used

Name Description
capacityUrl System.String
The full URL of the capacity information.

Returns

The list of capacities

Projects(organization)

Get the list of projects list of an organization.

Name Description
organization System.String
Name of the organization. https://dev.azure.com/{organization}

Returns

List of TeamProject

Sprint(sprintUrl)

Get the sprint given a full URL

Remarks

api-version 6.0 is used

Name Description
sprintUrl System.String
The full URL of the sprint.

Returns

The instance of the sprint

Sprints(organization, project, team)

Get the list of sprints of a team.

Name Description
organization System.String
Name of the organisation. https://dev.azure.com/{organisation}
project System.String
team System.String

Returns

TeamDaysOff(teamIterationDaysOffUrl)

Get team days off from the teamIterationDaysOffUrl passed and deserialize the response.

Remarks

The api-version used is 6.0, and the caller is not expected to specify the version in the URL.

Name Description
teamIterationDaysOffUrl System.String
URL of team days off to fetch

Teams(organization, teamProjectId)

Return the list of Teams of an organization TeamProject

Name Description
organization System.String
Name of the organization. https://dev.azure.com/{organization}
teamProjectId System.Guid
Id of the organization team project selected

Returns

List of teams

TeamSettings(teamSettingsUrl)

Get Team Settings given a team settings URL

Remarks

api-version 6.0 is used

Name Description
teamSettingsUrl System.String
The teamSettings full URL without the api-version

Returns

The teamSetting instance

Updates(updatesUrl)

Get the list of updates from the updatesUrl passed and deserialize the response.

Remarks

The api-version used is 6.0, and the caller is not expected to specify the version in the URL.

Name Description
updatesUrl System.String
URL of updates to fetch

WorkItem(workItemUrl)

Get a workItem given a workItemUrl

Name Description
workItemUrl System.String
workItem fullUrl

Returns

The WorkItem deserialized

WorkItems(sprintUrl)

Get the list of work item links given the URL of the sprint.

Name Description
sprintUrl System.String
The URL of the sprint has returned by the DevOpsService.Sprints(System.String,System.String,System.String) method/>

Returns

A work item with details

VelocityService

Service use to aggregate and group history of a sprint

Constructor(devOpsService)

Constructor with dependencies

Name Description
devOpsService AzureDevOpsTeamMembersVelocity.Services.DevOpsService
Instance of DevOpsService use to fetch data needed

GroupByPerson(groupByPerson, workItem, workItemUpdates)

Group the list of updates into the MemberVelocity object associate with the person name

Name Description
groupByPerson System.Collections.Generic.Dictionary{System.String,AzureDevOpsTeamMembersVelocity.Model.MemberVelocity}
Dictionary used to to the group by, can be pre-populated
workItem AzureDevOpsTeamMembersVelocity.Model.WorkItem
Work item
workItemUpdates System.Collections.Generic.List{AzureDevOpsTeamMembersVelocity.Model.WorkItemUpdate}
List of updates to group

MemberVelocities(sprintUrl, capacities, sprint, teamDaysOff, teamSettings)

Asynchronously enumerate each member's velocity. Previously return member also updates if needed at each iteration.

Name Description
sprintUrl System.String
Sprint to analyse
capacities System.Collections.Generic.List{AzureDevOpsTeamMembersVelocity.Model.Capacity}
Capacities informations to enhance result
sprint AzureDevOpsTeamMembersVelocity.Model.Sprint
Sprint information is use to enhance result
teamDaysOff Microsoft.TeamFoundation.Work.WebApi.TeamSettingsDaysOff
Team days off is use to enhance result and do the right calculation
teamSettings Microsoft.TeamFoundation.Work.WebApi.TeamSetting
Team settings is use to enhance result and do the right calculation

Returns

Startup

The startup class uses to build the application.

Configure(Microsoft.AspNetCore.Builder.IApplicationBuilder,Microsoft.AspNetCore.Hosting.IWebHostEnvironment)

This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

ConfigureServices(services)

This method gets called by the runtime. Use this method to add services to the container. For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940

Name Description
services Microsoft.Extensions.DependencyInjection.IServiceCollection

TeamMembersVelocitySettings

This is the main configuration of the app. Those settings can be saved on disk using the persist button on the index.html page.

ApiKey

The ApiKey of the user

AuthenticationHeader

Return the Authentication header object that can be used by assigned this property to the Authorization property of System.Net.Http.HttpClient.DefaultRequestHeaders the Azure DevOps REST API

Organisation

Organization selected

Team

Team selected

TeamProject

Team project selected

TeamProject

Team project resource of the Azure DevOps REST API

Id

Id of the TeamProject

LastUpdateTime

Last time updated

Name

Name of the team project

Revision

Revision of the TeamProject

State

State of the TeamProject

Url

Url of the TeamProject

Visibility

Visibility of the team project

Clone this wiki locally