• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

samsmithnz / RepoGovernance / 6871646540

15 Nov 2023 01:19AM UTC coverage: 69.053% (+0.6%) from 68.496%
6871646540

Pull #660

github

web-flow
Merge f76d366d2 into 52b914122
Pull Request #660: Update to .NET 8

217 of 360 branches covered (0.0%)

Branch coverage included in aggregate %.

651 of 897 relevant lines covered (72.58%)

23.15 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.38
/src/RepoGovernance.Core/APIAccess/DevOpsMetricServiceApi.cs
1
using RepoGovernance.Core.Models;
2

3
namespace RepoGovernance.Core.APIAccess
4
{
5
    public class DevOpsMetricServiceApi
6
    {
7
        private readonly HttpClient Client;
8

9
        public DevOpsMetricServiceApi(string devOpsServiceURL)
5✔
10
        {
5✔
11
            Client = new HttpClient
5✔
12
            {
5✔
13
                BaseAddress = new Uri(devOpsServiceURL)
5✔
14
            };
5✔
15
        }
5✔
16

17
        public async Task<DORASummaryItem?> GetDORASummaryItems(string owner, string repo)
18
        {
5✔
19
            try
20
            {
5✔
21
                // api/DORASummary/GetDORASummaryItems?owner=samsmithnz&repository=DevOpsMetrics
22
                string url = $"/api/DORASummary/GetDORASummaryItem?owner={owner}&project=&repo={repo}";
5✔
23
                return await BaseApi.GetResponse<DORASummaryItem>(Client, url);
5✔
24
            }
25
            catch (Exception ex)
×
26
            {
×
27
                return new DORASummaryItem()
×
28
                {
×
29
                    Owner = owner,
×
30
                    Repo = repo,
×
31
                    DeploymentFrequency = 0,
×
32
                    DeploymentFrequencyBadgeURL = "https://img.shields.io/badge/Deployment%20frequency-None-lightgrey",
×
33
                    LeadTimeForChanges = 0,
×
34
                    LeadTimeForChangesBadgeURL = "https://img.shields.io/badge/Lead%20time%20for%20changes-None-lightgrey",
×
35
                    MeanTimeToRestore = 0,
×
36
                    MeanTimeToRestoreBadgeURL = "https://img.shields.io/badge/Meant%20time%20to%20restore-None-lightgrey",
×
37
                    ChangeFailureRate = -1, //This is -1 because the value is a percentage, and 0 means something
×
38
                    ChangeFailureRateBadgeURL = "https://img.shields.io/badge/Change%20failure%20rate-None-lightgrey",
×
39
                    LastUpdated = DateTime.Now,
×
40
                    LastUpdatedMessage = "Error getting DORA summary item: " + ex.ToString()
×
41
                };
×
42
            }
43
        }
5✔
44
    }
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc