Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
using Azure.Sdk.Tools.PipelineWitness.Configuration;
using Azure.Sdk.Tools.PipelineWitness.Services;
using Azure.Storage.Blobs;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Microsoft.TeamFoundation.Build.WebApi;
using Microsoft.VisualStudio.Services.Account;
using Microsoft.VisualStudio.Services.Common;
using Microsoft.VisualStudio.Services.TestResults.WebApi;
using Microsoft.VisualStudio.Services.WebApi;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace Azure.Sdk.Tools.PipelineWitness.Tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Azure.Sdk.Tools.PipelineWitness.Entities.AzurePipelines;
using Azure.Sdk.Tools.PipelineWitness.Services.FailureAnalysis;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

namespace Azure.Sdk.Tools.PipelineWitness.Tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Reflection;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;

namespace Azure.Sdk.Tools.PipelineWitness.ApplicationInsights
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.29.0" />
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.3.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="5.1.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.170.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="19.225.1" />
<PackageReference Include="Microsoft.VisualStudio.Services.InteractiveClient" Version="19.225.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public class BlobUploadProcessor
private readonly BlobContainerClient testResultsContainerClient;
private readonly BlobContainerClient buildDefinitionsContainerClient;
private readonly BlobContainerClient buildFailuresContainerClient;
private readonly BlobContainerClient pipelineOwnersContainerClient;
private readonly BlobContainerClient pipelineOwnersContainerClient;
private readonly IOptions<PipelineWitnessSettings> options;
private readonly Dictionary<string, int?> cachedDefinitionRevisions = new();
private readonly IFailureAnalyzer failureAnalyzer;
private readonly IFailureAnalyzer failureAnalyzer;

public BlobUploadProcessor(
ILogger<BlobUploadProcessor> logger,
Expand Down Expand Up @@ -186,7 +186,7 @@ public async Task UploadBuildBlobsAsync(string account, Guid projectId, int buil

if (build.Definition.Id == options.Value.PipelineOwnersDefinitionId)
{
await UploadPipelineOwnersBlobAsync(account, build, timeline);
await UploadPipelineOwnersBlobAsync(account, build, timeline);
}
}

Expand Down Expand Up @@ -342,7 +342,7 @@ private async Task UploadBuildFailureBlobAsync(string account, Build build, Time
stringBuilder.AppendLine(contentLine);
}

await blobClient.UploadAsync(new BinaryData(stringBuilder.ToString()));
await blobClient.UploadAsync(new BinaryData(stringBuilder.ToString()));
}
catch (RequestFailedException ex) when (ex.Status == (int)HttpStatusCode.Conflict)
{
Expand Down Expand Up @@ -531,7 +531,6 @@ private async Task UploadBuildBlobAsync(string account, Build build)
QueueTime = build.QueueTime,
StartTime = build.StartTime,
FinishTime = build.FinishTime,
KeepForever = build.KeepForever,
LastChangedDate = build.LastChangedDate,
LogsId = build.Logs?.Id,
LogsType = build.Logs?.Type,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System;

namespace Azure.Sdk.Tools.PipelineWitness.Configuration
{
Expand Down Expand Up @@ -72,38 +70,28 @@ public class PipelineWitnessSettings
public int BuildCompleteWorkerCount { get; set; } = 1;

/// <summary>
/// Gets or sets the artifact name used by the pipeline owners extraction build
/// Gets or sets the artifact name used by the pipeline owners extraction build
/// </summary>
public string PipelineOwnersArtifactName { get; set; }

/// <summary>
/// Gets or sets the file name used by the pipeline owners extraction build
/// Gets or sets the file name used by the pipeline owners extraction build
/// </summary>
public string PipelineOwnersFilePath { get; set; }

/// <summary>
/// Gets or sets the definition id of the pipeline owners extraction build
/// Gets or sets the definition id of the pipeline owners extraction build
/// </summary>
public int PipelineOwnersDefinitionId { get; set; }

/// <summary>
/// Gets or sets the database to use
/// Gets or sets the database to use
/// </summary>
public string CosmosDatabase { get; set; }

/// <summary>
/// Gets or sets the container to use for async locks
/// </summary>
public string CosmosAsyncLockContainer { get; set; }

/// <summary>
/// Gets or sets the authorization key for the Cosmos account
/// </summary>
public string CosmosAuthorizationKey { get; set; }

/// <summary>
/// Gets or sets the access token to use for Azure DevOps clients
/// </summary>
public string DevopsAccessToken { get; set; }
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.TeamFoundation.Build.WebApi;
using Microsoft.TeamFoundation.Build.WebApi;

#nullable disable

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;

namespace Azure.Sdk.Tools.PipelineWitness
Expand Down Expand Up @@ -28,4 +28,3 @@ public class BuildLogBundle
public List<BuildLogInfo> TimelineLogs { get; } = new List<BuildLogInfo>();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class BuildLogInfo

public Guid? RecordId { get; set; }

public Guid? ParentRecordId { get; set; }
public Guid? ParentRecordId { get; set; }
}
}

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -9,6 +10,10 @@ public class Program
{
public static async Task Main(params string[] args)
{
// per queue storage performance docs, set the default connection limit to >= 100
// https://learn.microsoft.com/en-us/azure/storage/queues/storage-performance-checklist#increase-default-connection-limit
ServicePointManager.DefaultConnectionLimit = 100;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.Services.WebApi;
using System.Diagnostics;
using Microsoft.Extensions.Options;
using Azure.Sdk.Tools.PipelineWitness.Services.WorkTokens;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public BuildCompleteQueueWorker(
TelemetryClient telemetryClient,
IOptionsMonitor<PipelineWitnessSettings> options)
: base(
logger,
logger,
telemetryClient,
queueServiceClient,
options.CurrentValue.BuildCompleteQueueName,
options.CurrentValue.BuildCompleteQueueName,
options)
{
this.logger = logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Azure.Sdk.Tools.PipelineWitness.Services.FailureAnalysis
{
public class AzurePipelinesPoolOutageClassifier : IFailureClassifier
{
public async Task ClassifyAsync(FailureAnalyzerContext context)
public Task ClassifyAsync(FailureAnalyzerContext context)
{
var jobs = from r in context.Timeline.Records
where r.RecordType == "Job"
Expand All @@ -22,6 +19,8 @@ where r.Issues.Any(i => i.Message.Contains("abandoned due to an infrastructure f
context.AddFailure(job, "Azure Pipelines Pool Outage");
}
}

return Task.CompletedTask;
}
}
}
Loading