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

refactor: Remove TelemetryManager from sdk #224

Merged
merged 2 commits into from
Oct 29, 2024
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/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* @mohitpubnub @xavrax @marcin-cebo
README.md @techwritermat @kazydek @mohitpubnub @xavrax
* @mohitpubnub @xavrax @marcin-cebo @jakub-grzesiowski
README.md @techwritermat @kazydek @mohitpubnub @xavrax @jakub-grzesiowski
2 changes: 1 addition & 1 deletion .github/workflows/commands-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Process command
if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true
runs-on:
group: Default
group: organization/Default
steps:
- name: Check referred user
id: user-check
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Check release required
if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true
runs-on:
group: Default
group: organization/Default
outputs:
release: ${{ steps.check.outputs.ready }}
steps:
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
name: Publish package
needs: publish-nuget
runs-on:
group: Default
group: organization/Default
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
tests:
name: Integration and Unit tests
runs-on:
group: windows-gh
group: organization/windows-gh
defaults:
run:
shell: powershell
Expand All @@ -31,27 +31,29 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.x
5.0.x
6.0.x
7.0.x
- name: Build packages
env:
WORKSPACE_PATH: ${{ github.workspace }}
run: .\\.github\\workflows\\release\\build-packages.ps1
# - name: Run unit tests
# env:
# PN_PUB_KEY: ${{ secrets.PN_PUB_KEY }}
# PN_SUB_KEY: ${{ secrets.PN_SUB_KEY }}
# PN_SEC_KEY: ${{ secrets.PN_SEC_KEY }}
# run: dotnet test .\\src\\UnitTests\\PubnubApiPCL.Tests\\PubnubApiPCL.Tests.csproj --verbosity normal --logger trx
- name: Run unit tests
env:
PN_PUB_KEY: ${{ secrets.SDK_PUB_KEY }}
PN_SUB_KEY: ${{ secrets.SDK_SUB_KEY }}
PN_SEC_KEY: ${{ secrets.SDK_SEC_KEY }}
PN_PAM_PUB_KEY: ${{ secrets.SDK_PAM_PUB_KEY }}
PN_PAM_SUB_KEY: ${{ secrets.SDK_PAM_SUB_KEY }}
PN_PAM_SEC_KEY: ${{ secrets.SDK_PAM_SEC_KEY }}
run: dotnet test .\\src\\UnitTests\\PubnubApiPCL.Tests\\PubnubApiPCL.Tests.csproj --verbosity normal --logger "console;verbosity=detailed"
- name: Cancel workflow runs for commit on error
if: failure()
uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
acceptance-tests:
name: Acceptance tests
runs-on:
group: windows-gh
group: organization/windows-gh
defaults:
run:
shell: powershell
Expand Down Expand Up @@ -91,7 +93,7 @@ jobs:
run: |
Copy-Item -Path "${{ github.workspace }}/sdk-specifications/features/access/*" -Destination "${{ github.workspace }}/src/UnitTests/AcceptanceTests/Features" -Recurse
cd ./UnitTests/AcceptanceTests
dotnet test --no-build --verbosity normal --logger trx --results-directory ./results
dotnet test --no-build --verbosity normal --logger "console;verbosity=detailed" --results-directory ./results
- name: Upload acceptance tests reports
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -107,7 +109,7 @@ jobs:
name: Tests
needs: [tests, acceptance-tests]
runs-on:
group: Default
group: organization/Default
steps:
- name: Tests summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"
4 changes: 2 additions & 2 deletions .github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
pubnub-yml:
name: "Validate .pubnub.yml"
runs-on:
group: Default
group: organization/Default
steps:
- name: Checkout project
uses: actions/checkout@v4
Expand All @@ -33,7 +33,7 @@ jobs:
name: Validations
needs: [pubnub-yml]
runs-on:
group: Default
group: organization/Default
steps:
- name: Validations summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed"
47 changes: 24 additions & 23 deletions .pubnub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ supported-platforms:
- .Net Framework 4.0
- .Net Framework 4.5
- .Net Framework 4.6.1+
- .Net Framework 6.0
-
version: PubnubPCL 'C#' 6.20.1
platforms:
Expand Down Expand Up @@ -892,9 +893,9 @@ sdks:
target-architecture:
- x86-64
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET 4.x
- .NET 6.x
minimum-os-version:
- Windows 10 Home
- Windows 10 Pro
Expand Down Expand Up @@ -1031,9 +1032,9 @@ sdks:
target-architecture:
- x86-64
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET 4.x
- .NET 6.x
minimum-os-version:
- Windows 10 Home
- Windows 10 Pro
Expand Down Expand Up @@ -1152,10 +1153,10 @@ sdks:
supported-operating-systems:
Android:
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
- .NET 4.x
- .NET 6.x
target-api-level:
- 11
minimum-api-level:
Expand All @@ -1172,10 +1173,10 @@ sdks:
- ARMv7 (Cortex) CPU with NEON support
iOS:
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
- .NET 4.x
- .NET 6.x
minimum-os-version:
- iOS 9.0
maximum-os-version:
Expand All @@ -1189,10 +1190,10 @@ sdks:
target-architecture:
- x86-64
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
- .NET 4.x
- .NET 6.x
minimum-os-version:
- Windows 10 Home
- Windows 10 Pro
Expand Down Expand Up @@ -1269,7 +1270,7 @@ sdks:
target-architecture:
- x86-64
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
maximum-os-version:
Expand All @@ -1280,10 +1281,10 @@ sdks:
target-architecture:
- x86-64
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
- .NET 4.x
- .NET 6.x
minimum-os-version:
- Mac OS X 10.8
maximum-os-version:
Expand Down Expand Up @@ -1330,7 +1331,7 @@ sdks:
supported-operating-systems:
Android:
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
target-api-level:
Expand All @@ -1349,10 +1350,10 @@ sdks:
- ARMv7 (Cortex) CPU with NEON support
iOS:
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
- .NET 4.x
- .NET 6.x
minimum-os-version:
- iOS 9.0
maximum-os-version:
Expand All @@ -1366,10 +1367,10 @@ sdks:
target-architecture:
- x86-64
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
- .NET 4.x
- .NET 6.x
minimum-os-version:
- Windows 10 Home
- Windows 10 Pro
Expand Down Expand Up @@ -1446,10 +1447,10 @@ sdks:
target-architecture:
- x86-64
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
- .NET 4.x
- .NET 6.x
maximum-os-version:
- Ubuntu 20.04 LTS
minimum-os-version:
Expand All @@ -1458,10 +1459,10 @@ sdks:
target-architecture:
- x86-64
runtime-version:
- .NET 4.x Equivalent
- .NET 6.x Equivalent
api-compatibility:
- .NET Core 2
- .NET 4.x
- .NET 6.x
minimum-os-version:
- Mac OS X 10.8
maximum-os-version:
Expand Down Expand Up @@ -1643,4 +1644,4 @@ sdks:
- Windows Server 2012 R2 Foundation
- Windows Server 2012 R2 Essentials
- Windows Server 2012 R2 Standard
- Windows Server 2012 R2 Datacenter
- Windows Server 2012 R2 Datacenter
13 changes: 5 additions & 8 deletions src/Api/PubnubApi/Builder/ResponseBuilder.cs
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.Collections.Generic;

namespace PubnubApi
{
Expand All @@ -13,9 +10,9 @@ internal class ResponseBuilder

public ResponseBuilder(PNConfiguration pubnubConfig, IJsonPluggableLibrary jsonPluggableLibrary, IPubnubLog log)
{
this.config = pubnubConfig;
this.jsonLib = jsonPluggableLibrary;
this.pubnubLog = log;
config = pubnubConfig;
jsonLib = jsonPluggableLibrary;
pubnubLog = log;
}

public T JsonToObject<T>(List<object> result, bool internalObject)
Expand All @@ -28,7 +25,7 @@ public T JsonToObject<T>(List<object> result, bool internalObject)
}
else
{
NewtonsoftJsonDotNet jsonNewtonLib = new NewtonsoftJsonDotNet(this.config, this.pubnubLog);
NewtonsoftJsonDotNet jsonNewtonLib = new NewtonsoftJsonDotNet(config, pubnubLog);
ret = jsonNewtonLib.DeserializeToObject<T>(result);
}

Expand Down
10 changes: 4 additions & 6 deletions src/Api/PubnubApi/Builder/StatusBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;

namespace PubnubApi
{
public class StatusBuilder
public class StatusBuilder
{
private readonly PNConfiguration config;
private readonly IJsonPluggableLibrary jsonLibrary;
Expand Down Expand Up @@ -98,11 +96,11 @@ public PNStatus CreateStatusResponse<T>(PNOperationType type, PNStatusCategory c

if (asyncRequestState != null)
{
if (asyncRequestState.Request != null)
if (asyncRequestState.RequestCancellationTokenSource != null)
{
status.ClientRequest = asyncRequestState.Request;
status.ClientRequest = asyncRequestState.RequestCancellationTokenSource;

HttpValueCollection restUriQueryCollection = HttpUtility.ParseQueryString(asyncRequestState.Request.RequestUri.Query);
HttpValueCollection restUriQueryCollection = HttpUtility.ParseQueryString(new Uri(asyncRequestState.Response.RequestUrl).Query);
if (restUriQueryCollection.ContainsKey("auth"))
{
string auth = restUriQueryCollection["auth"];
Expand Down
Loading
Loading