Class BugFilerBase<TThis, TItem>
Inheritance
BugFilerBase<TThis, TItem>
Assembly: CrashCABN.BugFiler.Base.dll
Syntax
public abstract record BugFilerBase<TThis, TItem> : IBugFiler<TItem, TItem>, IBugFiler, IBugSearch, IEquatable<BugFilerBase<TThis, TItem>> where TItem : class
Type Parameters
Name |
Description |
TThis |
|
TItem |
|
Constructors
View Source
BugFilerBase(BugRepositoryDetails, ILogger<TThis>)
Declaration
protected BugFilerBase(BugRepositoryDetails BugRepository, ILogger<TThis> Logger)
Parameters
Properties
View Source
BucketByField
Declaration
protected string BucketByField { get; }
Property Value
View Source
BugRepository
Declaration
public BugRepositoryDetails BugRepository { get; init; }
Property Value
View Source
CrashIDField
Declaration
protected string? CrashIDField { get; }
Property Value
View Source
Logger
Declaration
public ILogger<TThis> Logger { get; init; }
Property Value
Methods
View Source
Create a BugItemType instance in the configured bug repository with the provided metadata.
Declaration
public virtual Task<(TItem Bug, int Id)> CreateBugAsync(IImmutableDictionary<string, MetadataItem> metadata, IEnumerable<int> duplicateBugIds)
Parameters
Returns
Type |
Description |
Task<(TItem Bug, int Id)> |
The bug instance created and its ID.
|
View Source
Declaration
public virtual Task<(TItem Crash, int Id)> CreateCrashInstanceAsync(TItem parentBug, IImmutableDictionary<string, MetadataItem> metadata, IAttachmentContainer? attachments, string appName, string appVersion)
Parameters
Returns
Type |
Description |
Task<(TItem Bug, int Id)> |
The crash instance created and its ID.
|
View Source
Declaration
protected abstract Task<(TItem Item, int Id)> CreateItemAsync(AppliesToEnum crashOrBug, IImmutableDictionary<string, MetadataItem> metadata, IAttachmentContainer? attachments, TItem? parentBug, string? appName, string? appVersion)
Parameters
Returns
View Source
CreateMissingBucketByFieldException(string)
Declaration
protected InvalidOperationException CreateMissingBucketByFieldException(string workItemTypeName)
Parameters
Type |
Name |
Description |
string |
workItemTypeName |
|
Returns
View Source
DeleteCrashAsync(int)
Declaration
public abstract Task DeleteCrashAsync(int id)
Parameters
Type |
Name |
Description |
int |
id |
The crash instance ID.
|
Returns
Type |
Description |
Task |
A task representing the asynchronous operation.
|
View Source
Finds a BugItemType item matches the failure bucket ID of the provided crash.
Declaration
public virtual Task<BugDetails> FindMatchingBugAsync(string appName, string appVersion, IImmutableDictionary<string, MetadataItem> metadata, KeyValuePair<string, IImmutableList<string>> parentBugFilter)
Parameters
Returns
Type |
Description |
Task<BugDetails> |
The matching bug instance with room for a new crash and its ID if found, otherwise null.
Also the count of matching crashes that were found for the same version. This includes being parented to the same bug
as well as any other matching bug.
|
View Source
FindMatchingBugAsync(string, string, string, KeyValuePair<string, IImmutableList<string>>?, CancellationToken)
Declaration
public abstract Task<BugDetails> FindMatchingBugAsync(string bucket, string appName, string appVersion, KeyValuePair<string, IImmutableList<string>>? parentBugFilter, CancellationToken cancellationToken)
Parameters
Returns
View Source
FindMatchingBugAsync(string, string, string, CancellationToken)
Finds a BugItemType item matches the failure bucket ID of the provided crash.
Declaration
public virtual Task<BugDetails> FindMatchingBugAsync(string bucket, string appName, string appVersion, CancellationToken cancellationToken)
Parameters
Returns
Type |
Description |
Task<BugDetails> |
The matching bug instance with room for a new crash and its ID if found, otherwise null.
Also the count of matching crashes that were found for the same version. This includes being parented to the same bug
as well as any other matching bug.
|
View Source
FindMatchingCrashAsync(string, CancellationToken)
Declaration
public virtual ValueTask<bool> FindMatchingCrashAsync(string crashId, CancellationToken cancellationToken)
Parameters
Returns
Type |
Description |
ValueTask<bool> |
True if a matching crash instance work item was found
|
View Source
FindMatchingCrashesAsync(string, CancellationToken)
Declaration
public virtual IAsyncEnumerable<int> FindMatchingCrashesAsync(string crashId, CancellationToken cancellationToken)
Parameters
Returns
View Source
GetCrashById(int)
Declaration
protected abstract Task<TItem?> GetCrashById(int id)
Parameters
Type |
Name |
Description |
int |
id |
|
Returns
Type |
Description |
Task<TItem> |
|
View Source
LogCrashIDFieldNotFound(string)
Declaration
protected void LogCrashIDFieldNotFound(string workItemTypeName)
Parameters
Type |
Name |
Description |
string |
workItemTypeName |
|
View Source
LogFieldNotFound(string, string)
Declaration
protected void LogFieldNotFound(string workItemTypeName, string missingField)
Parameters
Type |
Name |
Description |
string |
workItemTypeName |
|
string |
missingField |
|
View Source
QueryMatchingCrashes(string, string, bool, bool, CancellationToken)
Declaration
protected abstract IAsyncEnumerable<int> QueryMatchingCrashes(string comparisonFieldName, string comparisonFieldValue, bool returnFirstMatch = false, bool enableSearchFilter = true, CancellationToken cancellationToken = default)
Parameters
Returns
Implements