Skip to content

fix ci permission issue #7

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

Merged
merged 3 commits into from
Aug 31, 2022
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
cancel_previous:

permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: styfle/cancel-workflow-action@0.9.1
Expand Down Expand Up @@ -43,4 +43,4 @@ jobs:
run: dotnet build

- name: Test
run: dotnet test
run: dotnet test
3 changes: 0 additions & 3 deletions Analytics-CSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ Global
{90B4FDEC-99F3-4DBE-969A-956363CDA17F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90B4FDEC-99F3-4DBE-969A-956363CDA17F}.Release|Any CPU.Build.0 = Release|Any CPU
{A50D6328-41E0-45F0-9287-A8E7D4C7F71E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A50D6328-41E0-45F0-9287-A8E7D4C7F71E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A50D6328-41E0-45F0-9287-A8E7D4C7F71E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A50D6328-41E0-45F0-9287-A8E7D4C7F71E}.Release|Any CPU.Build.0 = Release|Any CPU
{86FFFF37-9FB0-4632-8D44-E09202E158AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86FFFF37-9FB0-4632-8D44-E09202E158AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86FFFF37-9FB0-4632-8D44-E09202E158AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86FFFF37-9FB0-4632-8D44-E09202E158AF}.Release|Any CPU.Build.0 = Release|Any CPU
{39FCFC71-411C-419E-97BB-7C4281764B10}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
{39FCFC71-411C-419E-97BB-7C4281764B10}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
{39FCFC71-411C-419E-97BB-7C4281764B10}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{39FCFC71-411C-419E-97BB-7C4281764B10}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 0 additions & 2 deletions Analytics-CSharp/Analytics-CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<None Remove="Segment\Aanalytics\" />
<None Remove="Segment\Aanalytics\Plugins\" />
<None Remove="Segment\Aanalytics\Utilities\" />
<None Remove="Microsoft.Extensions.Logging" />
</ItemGroup>
<ItemGroup>
<Folder Include="Segment\" />
Expand All @@ -33,7 +32,6 @@
<PackageReference Include="Coroutine.NET" Version="0.5.0" />
<PackageReference Include="Serialization.NET" Version="0.1.0" />
<PackageReference Include="Sovran.NET" Version="0.4.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
Expand Down
10 changes: 7 additions & 3 deletions Analytics-CSharp/Segment/Analytics/Analytics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

using JsonUtility = Segment.Serialization.JsonUtility;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

namespace Segment.Analytics
{
Expand All @@ -25,12 +24,11 @@ public partial class Analytics : ISubscriber
internal IDispatcher networkIODispatcher { get;}
internal IDispatcher analyticsDispatcher { get;}

internal static Microsoft.Extensions.Logging.ILogger logger = null;
internal static ILogger logger = null;

public Analytics(Configuration configuration)
{
this.configuration = configuration;
Analytics.logger = this.configuration.logger;
analyticsScope = new Scope();
if (configuration.userSynchronizeDispatcher)
{
Expand Down Expand Up @@ -200,4 +198,10 @@ private void Startup(HTTPClient httpClient = null)
#endregion

}

internal interface ILogger
{
void LogError(Exception exception, string message);
void LogError(string message);
}
}
9 changes: 2 additions & 7 deletions Analytics-CSharp/Segment/Analytics/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;


namespace Segment.Analytics
{
public class Configuration
Expand All @@ -20,8 +19,6 @@ public class Configuration

public Settings defaultSettings { get; }

public Microsoft.Extensions.Logging.ILogger logger { get; }

public bool userSynchronizeDispatcher { get; }

public Configuration(string writeKey,
Expand All @@ -32,8 +29,7 @@ public Configuration(string writeKey,
bool autoAddSegmentDestination = true,
bool userSynchronizeDispatcher = false,
string apiHost = null,
string cdnHost = null,
Microsoft.Extensions.Logging.ILogger logger = null)
string cdnHost = null)
{
this.writeKey = writeKey;
this.persistentDataPath = persistentDataPath;
Expand All @@ -44,7 +40,6 @@ public Configuration(string writeKey,
this.userSynchronizeDispatcher = userSynchronizeDispatcher;
this.apiHost = apiHost;
this.cdnHost = cdnHost;
this.logger = logger;
}
}

Expand Down
1 change: 0 additions & 1 deletion Analytics-CSharp/Segment/Analytics/Events.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Runtime.Serialization;
using Microsoft.Extensions.Logging;
using Segment.Serialization;

namespace Segment.Analytics
Expand Down
1 change: 0 additions & 1 deletion Analytics-CSharp/Segment/Analytics/Plugins.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Segment.Serialization;

namespace Segment.Analytics
Expand Down
1 change: 0 additions & 1 deletion Analytics-CSharp/Segment/Analytics/State.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Microsoft.Extensions.Logging;
using Segment.Sovran;
using Segment.Serialization;
using Segment.Analytics.Utilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Segment.Concurrent;

namespace Segment.Analytics.Utilities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

namespace Segment.Analytics.Utilities
{
Expand Down
5 changes: 2 additions & 3 deletions Analytics-CSharp/Segment/Analytics/Utilities/HTTPClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Segment.Serialization;

namespace Segment.Analytics.Utilities
Expand Down Expand Up @@ -47,7 +46,7 @@ public string SegmentURL(string host, string path)

if (!response.IsSuccessStatusCode)
{
Analytics.logger?.LogError("Error {Status} getting from settings url", response.StatusCode);
Analytics.logger?.LogError("Error " + response.StatusCode + " getting from settings url");
}
else
{
Expand All @@ -66,7 +65,7 @@ public virtual async Task<bool> Upload(string file)

if (!response.IsSuccessStatusCode)
{
Analytics.logger?.LogError("Error {Status} uploading to url", response.StatusCode);
Analytics.logger?.LogError("Error " + response.StatusCode + " uploading to url");
var responseCode = (int)response.StatusCode;
response.Dispose();

Expand Down
1 change: 0 additions & 1 deletion Analytics-CSharp/Segment/Analytics/Utilities/UserPrefs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Runtime.Serialization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Segment.Concurrent;

namespace Segment.Analytics.Utilities
Expand Down