Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post Windows minidumps directly to S3 #49

Merged
merged 1 commit into from
Nov 27, 2021
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
Binary file removed Runtime/BugSplatDotNetStandard.dll
Binary file not shown.
27 changes: 2 additions & 25 deletions Runtime/Client/DotNetStandardClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using BugSplatDotNetStandard;
using System;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;

Expand Down Expand Up @@ -33,20 +32,9 @@ public Task<HttpResponseMessage> Post(FileInfo minidumpFileInfo, IReportPostOpti

private ExceptionPostOptions CreateExceptionPostOptions(IReportPostOptions options)
{
// TODO BG move IFormDataParam to BugSplatDotNetStandard
// https://github.com/BugSplat-Git/bugsplat-net-standard/issues/31
var formDataParams = options.AdditionalFormDataParams.Select(param =>
{
return new BugSplatDotNetStandard.FormDataParam()
{
Content = param.Content,
FileName = param.FileName,
Name = param.Name
};
}).ToList();
var exceptionPostOptions = new ExceptionPostOptions();
exceptionPostOptions.AdditionalAttachments.AddRange(options.AdditionalAttachments);
exceptionPostOptions.AdditionalFormDataParams.AddRange(formDataParams);
exceptionPostOptions.AdditionalFormDataParams.AddRange(options.AdditionalFormDataParams);
exceptionPostOptions.Description = options.Description;
exceptionPostOptions.Email = options.Email;
exceptionPostOptions.Key = options.Key;
Expand All @@ -57,20 +45,9 @@ private ExceptionPostOptions CreateExceptionPostOptions(IReportPostOptions optio

private MinidumpPostOptions CreateMinidumpPostOptions(IReportPostOptions options)
{
// TODO BG move IFormDataParam to BugSplatDotNetStandard
// https://github.com/BugSplat-Git/bugsplat-net-standard/issues/31
var formDataParams = options.AdditionalFormDataParams.Select(param =>
{
return new BugSplatDotNetStandard.FormDataParam()
{
Content = param.Content,
FileName = param.FileName,
Name = param.Name
};
}).ToList();
var minidumpPostOptions = new MinidumpPostOptions();
minidumpPostOptions.AdditionalAttachments.AddRange(options.AdditionalAttachments);
minidumpPostOptions.AdditionalFormDataParams.AddRange(formDataParams);
minidumpPostOptions.AdditionalFormDataParams.AddRange(options.AdditionalFormDataParams);
minidumpPostOptions.Description = options.Description;
minidumpPostOptions.Email = options.Email;
minidumpPostOptions.Key = options.Key;
Expand Down
8 changes: 8 additions & 0 deletions Runtime/Plugins.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
"BugSplatDotNetStandard/2.0.6": {
"BugSplatDotNetStandard/2.1.2": {
"dependencies": {
"NETStandard.Library": "2.0.3"
},
Expand All @@ -24,7 +24,7 @@
}
},
"libraries": {
"BugSplatDotNetStandard/2.0.6": {
"BugSplatDotNetStandard/2.1.2": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Runtime/Plugins/BugSplatDotNetStandard.dll
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions Runtime/ReportPostOptions.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
using System.Collections.Generic;
using BugSplatDotNetStandard;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;

namespace BugSplatUnity
{
public interface IFormDataParam
{
public string Name { get; set; }
public HttpContent Content { get; set; }
public string FileName { get; set; }
}

public interface IReportPostOptions
{
public List<FileInfo> AdditionalAttachments { get; }
public List<IFormDataParam> AdditionalFormDataParams { get; }
public List<FormDataParam> AdditionalFormDataParams { get; }
public string Description { get; set; }
public string Email { get; set; }
public string Key { get; set; }
Expand All @@ -32,7 +26,7 @@ public class FormDataParam : IFormDataParam
public class ReportPostOptions : IReportPostOptions
{
public List<FileInfo> AdditionalAttachments { get; } = new List<FileInfo>();
public List<IFormDataParam> AdditionalFormDataParams { get; } = new List<IFormDataParam>();
public List<FormDataParam> AdditionalFormDataParams { get; } = new List<FormDataParam>();
public string Description { get; set; }
public string Email { get; set; }
public string Key { get; set; }
Expand Down
3 changes: 1 addition & 2 deletions Runtime/Util/ReportPostOptionsExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BugSplatUnity.Runtime.Client;
using BugSplatUnity.Runtime.Settings;
using BugSplatUnity.Runtime.Settings;

namespace BugSplatUnity.Runtime.Util
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Runtime/Client/Fakes/FakeUnityWebClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public FakeDownloadHandler(string txt)
class FakeExceptionPostOptions : IReportPostOptions
{
public List<FileInfo> AdditionalAttachments { get; }
public List<IFormDataParam> AdditionalFormDataParams { get; }
public List<FormDataParam> AdditionalFormDataParams { get; }
public string Description { get; set; }
public string Email { get; set; }
public string Key { get; set; }
Expand Down