Skip to content

Commit d4d9557

Browse files
feat(kinesis): add Kinesis Client (#4141)
* Add kinesis client * Add enable/disable toggle, flush concurrency guard, and FlushData.flushInProgress (#4144) * Add enable/disable toggle, flush concurrency guard, and FlushData.flushInProgress - Add isEnabled toggle using OSAllocatedUnfairLock; disabled state silently drops records - Add concurrent flush guard in RecordClient actor (isFlushing flag) - Add flushInProgress property to FlushData for callers to detect skipped flushes - Rename credentialIdentityResolver to credentialsProvider (pending V3 types) - Make RecordStorage conform to Actor protocol - Add public init to FlushData * Fix linter errors * Apply formatter * Improve error types and handling (#4145) * Add enable/disable toggle, flush concurrency guard, and FlushData.flushInProgress - Add isEnabled toggle using OSAllocatedUnfairLock; disabled state silently drops records - Add concurrent flush guard in RecordClient actor (isFlushing flag) - Add flushInProgress property to FlushData for callers to detect skipped flushes - Rename credentialIdentityResolver to credentialsProvider (pending V3 types) - Make RecordStorage conform to Actor protocol - Add public init to FlushData * Improve error types and handling * Fix linter issues * Fix linter errors * Use service error message as error message in amplify error * Add check to ensure cache db format is accurate * Minor cleanup * Jv/kinesis merge foundation (#4149) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * feat: add logging definitions * add tests and restructure code * Add enable/disable toggle, flush concurrency guard, and FlushData.flushInProgress - Add isEnabled toggle using OSAllocatedUnfairLock; disabled state silently drops records - Add concurrent flush guard in RecordClient actor (isFlushing flag) - Add flushInProgress property to FlushData for callers to detect skipped flushes - Rename credentialIdentityResolver to credentialsProvider (pending V3 types) - Make RecordStorage conform to Actor protocol - Add public init to FlushData * Improve error types and handling * Fix linter issues * Fix linter errors * feat: add definitions for foundational apis (#4135) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module (#4136) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * address review comments * Add foundation logger and credentials provider * feat: add logging definitions (#4139) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * feat: add logging definitions * add tests and restructure code * address review comments * Further fixes: rename kinesis client, remove maxCache, improved logging * feat: add smithy/crt credential providers extensions * Make logger sendable, make it creatable for a type, make extension functions public, make amplifykinesisclient credential provider non-optional, adapt kinesis client * Update type * Use service error message as error message in amplify error * Add check to ensure cache db format is accurate * Minor cleanup * feat: add smithy/crt credential providers extensions (#4147) * feat: add smithy/crt credential providers extensions * add adapters to crt/sdk credential providers * rename Error to FoundationBridgeError * chore: add foundation tests to github actions (#4148) * chore: add foundation tests to github actions * update AmplifyFoundationBridge scheme * Use foundation bridge adapter * Ensure kinesis client only depends on foundation libraries * Fix error and linter * Remove obsolete kinesisdatastreams.swift file * Apply reviewer comments --------- Co-authored-by: Abhash Kumar Singh <thisisabhash@gmail.com> * Jv/kinesis support ios 13 (#4152) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * feat: add logging definitions * add tests and restructure code * Add enable/disable toggle, flush concurrency guard, and FlushData.flushInProgress - Add isEnabled toggle using OSAllocatedUnfairLock; disabled state silently drops records - Add concurrent flush guard in RecordClient actor (isFlushing flag) - Add flushInProgress property to FlushData for callers to detect skipped flushes - Rename credentialIdentityResolver to credentialsProvider (pending V3 types) - Make RecordStorage conform to Actor protocol - Add public init to FlushData * Improve error types and handling * Fix linter issues * Fix linter errors * feat: add definitions for foundational apis (#4135) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module (#4136) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * address review comments * Add foundation logger and credentials provider * feat: add logging definitions (#4139) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * feat: add logging definitions * add tests and restructure code * address review comments * Further fixes: rename kinesis client, remove maxCache, improved logging * feat: add smithy/crt credential providers extensions * Make logger sendable, make it creatable for a type, make extension functions public, make amplifykinesisclient credential provider non-optional, adapt kinesis client * Update type * Use service error message as error message in amplify error * Add check to ensure cache db format is accurate * Minor cleanup * feat: add smithy/crt credential providers extensions (#4147) * feat: add smithy/crt credential providers extensions * add adapters to crt/sdk credential providers * rename Error to FoundationBridgeError * chore: add foundation tests to github actions (#4148) * chore: add foundation tests to github actions * update AmplifyFoundationBridge scheme * Use foundation bridge adapter * Ensure kinesis client only depends on foundation libraries * Fix error and linter * Remove obsolete kinesisdatastreams.swift file * Apply reviewer comments * Revert to support iOS 13 --------- Co-authored-by: Abhash Kumar Singh <thisisabhash@gmail.com> * Jv/kinesis add e2e test (#4151) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * feat: add logging definitions * add tests and restructure code * Add enable/disable toggle, flush concurrency guard, and FlushData.flushInProgress - Add isEnabled toggle using OSAllocatedUnfairLock; disabled state silently drops records - Add concurrent flush guard in RecordClient actor (isFlushing flag) - Add flushInProgress property to FlushData for callers to detect skipped flushes - Rename credentialIdentityResolver to credentialsProvider (pending V3 types) - Make RecordStorage conform to Actor protocol - Add public init to FlushData * Improve error types and handling * Fix linter issues * Fix linter errors * feat: add definitions for foundational apis (#4135) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module (#4136) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * address review comments * Add foundation logger and credentials provider * feat: add logging definitions (#4139) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * feat: add logging definitions * add tests and restructure code * address review comments * Further fixes: rename kinesis client, remove maxCache, improved logging * feat: add smithy/crt credential providers extensions * Make logger sendable, make it creatable for a type, make extension functions public, make amplifykinesisclient credential provider non-optional, adapt kinesis client * Update type * Use service error message as error message in amplify error * Add check to ensure cache db format is accurate * Minor cleanup * feat: add smithy/crt credential providers extensions (#4147) * feat: add smithy/crt credential providers extensions * add adapters to crt/sdk credential providers * rename Error to FoundationBridgeError * chore: add foundation tests to github actions (#4148) * chore: add foundation tests to github actions * update AmplifyFoundationBridge scheme * Use foundation bridge adapter * Ensure kinesis client only depends on foundation libraries * Add initial e2e test * Fix error and linter * Add e2e test readme * Add actions for kinesis e2e test * Add unit test and minor fix in kinesis client * Add xcscheme for kinesis tests * Fix build issues and bring back flush strategy none * Copy config folder as last build step * Add debug logs to buildstep that copies resources * Further add debug logs to resource resolution * Adapt testconfighelper error message * Make build copy step output warnings * Make sure client starts enabled and scheduler is started in async task * Add watchos and tvos targets * Enable tvos for app target, remove debug logs from config resolution * Remove watchOs from e2e tests --------- Co-authored-by: Abhash Kumar Singh <thisisabhash@gmail.com> * Jv/kinesis rename module (#4154) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * feat: add logging definitions * add tests and restructure code * Add enable/disable toggle, flush concurrency guard, and FlushData.flushInProgress - Add isEnabled toggle using OSAllocatedUnfairLock; disabled state silently drops records - Add concurrent flush guard in RecordClient actor (isFlushing flag) - Add flushInProgress property to FlushData for callers to detect skipped flushes - Rename credentialIdentityResolver to credentialsProvider (pending V3 types) - Make RecordStorage conform to Actor protocol - Add public init to FlushData * Improve error types and handling * Fix linter issues * Fix linter errors * feat: add definitions for foundational apis (#4135) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module (#4136) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * address review comments * Add foundation logger and credentials provider * feat: add logging definitions (#4139) * feat: add definitions for foundational apis * add AmplifyFoundation as library to Package manifest * update code * feat: add foundational bridge module * feat: add logging definitions * add tests and restructure code * address review comments * Further fixes: rename kinesis client, remove maxCache, improved logging * feat: add smithy/crt credential providers extensions * Make logger sendable, make it creatable for a type, make extension functions public, make amplifykinesisclient credential provider non-optional, adapt kinesis client * Update type * Use service error message as error message in amplify error * Add check to ensure cache db format is accurate * Minor cleanup * feat: add smithy/crt credential providers extensions (#4147) * feat: add smithy/crt credential providers extensions * add adapters to crt/sdk credential providers * rename Error to FoundationBridgeError * chore: add foundation tests to github actions (#4148) * chore: add foundation tests to github actions * update AmplifyFoundationBridge scheme * Use foundation bridge adapter * Ensure kinesis client only depends on foundation libraries * Add initial e2e test * Fix error and linter * Add e2e test readme * Add actions for kinesis e2e test * Add unit test and minor fix in kinesis client * Add xcscheme for kinesis tests * Fix build issues and bring back flush strategy none * Copy config folder as last build step * Add debug logs to buildstep that copies resources * Further add debug logs to resource resolution * Adapt testconfighelper error message * Make build copy step output warnings * Make sure client starts enabled and scheduler is started in async task * Add watchos and tvos targets * Enable tvos for app target, remove debug logs from config resolution * Add useragent for kinesis client * Change useragent string * Move useragent interceptor to foundation * Remove watchOs from e2e tests * Rename to amplify metadata and add entry to fastfile * Remove obsolete foundation version file * Rename module to AmplifyKinesisClient --------- Co-authored-by: Abhash Kumar Singh <thisisabhash@gmail.com> * Minor fixes (#4155) * Add client flush test to verify retry behavior works (#4157) * Minor fixes * Add client flush test to verify retry behavior works * Move AmplifyKinesisClient to AmplifyClients/ folder (#4158) * Minor fixes * Add client flush test to verify retry behavior works * Move AmplifyKinesisClient to AmplifyClients/ folder * Restructure kinesis test folder * Add record limits (#4160) * Minor fixes * Add client flush test to verify retry behavior works * Move AmplifyKinesisClient to AmplifyClients/ folder * Add record limits * Add further data validation tests * Restructure kinesis test folder * Request-level errors cause retries, network errors return failure, other errors are silently ignored (#4163) * Minor fixes * Add client flush test to verify retry behavior works * Move AmplifyKinesisClient to AmplifyClients/ folder * Add record limits * Add further data validation tests * Restructure kinesis test folder * Request-level errors cause retries, network errors return failure, other errors are silently ignored * Fix sdk error detction and test fixes * Add test for nonexistent stream * Apply auto-format, add further tests and remove redundant ones, fix log levels (#4165) * Remove obsolete dependency and update docstring for flush (#4166) --------- Co-authored-by: Abhash Kumar Singh <thisisabhash@gmail.com>
1 parent bfe7512 commit d4d9557

56 files changed

Lines changed: 4561 additions & 16 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/integ_test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ jobs:
1818
uses: ./.github/workflows/integ_test_analytics.yml
1919
secrets: inherit
2020

21+
kinesis-test:
22+
name: Kinesis Integration Tests
23+
uses: ./.github/workflows/integ_test_kinesis.yml
24+
secrets: inherit
25+
2126
push-notifications-test:
2227
name: Push Notifications Integration Tests
2328
uses: ./.github/workflows/integ_test_push_notifications.yml
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Integration Tests | Kinesis
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
ios:
6+
description: '📱 iOS'
7+
required: true
8+
default: true
9+
type: boolean
10+
tvos:
11+
description: '📺 tvOS'
12+
required: true
13+
default: true
14+
type: boolean
15+
workflow_call:
16+
17+
permissions:
18+
id-token: write
19+
contents: read
20+
21+
jobs:
22+
kinesis-integration-tests:
23+
name: Kinesis Integration Tests
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
platform: [iOS, tvOS]
28+
exclude:
29+
- platform: ${{ github.event.inputs.ios == 'false' && 'iOS' || 'None' }}
30+
- platform: ${{ github.event.inputs.tvos == 'false' && 'tvOS' || 'None' }}
31+
uses: ./.github/workflows/run_integration_tests.yml
32+
with:
33+
scheme: AmplifyKinesisClientIntegrationTests
34+
platform: ${{ matrix.platform }}
35+
project_path: ./AmplifyClients/AmplifyKinesisClient/Tests/IntegrationTests/KinesisHostApp
36+
resource_subfolder: kinesis
37+
timeout-minutes: 30
38+
secrets: inherit

.github/workflows/unit_test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
AWSCloudWatchLoggingPlugin,
7373
AWSCognitoAuthPlugin,
7474
AWSDataStorePlugin,
75+
AmplifyKinesisClient,
7576
AWSLocationGeoPlugin,
7677
AWSPredictionsPlugin,
7778
AWSPinpointAnalyticsPlugin,
@@ -99,6 +100,7 @@ jobs:
99100
{ scheme: AWSCloudWatchLoggingPlugin, flags: 'Logging_plugin_unit_test,unit_tests' },
100101
{ scheme: AWSCognitoAuthPlugin, flags: 'Auth_plugin_unit_test,unit_tests' },
101102
{ scheme: AWSDataStorePlugin, flags: 'DataStore_plugin_unit_test,unit_tests' },
103+
{ scheme: AmplifyKinesisClient, flags: 'Kinesis_plugin_unit_test,unit_tests' },
102104
{ scheme: AWSLocationGeoPlugin, flags: 'Geo_plugin_unit_test,unit_tests' },
103105
{ scheme: AWSPredictionsPlugin, flags: 'Predictions_plugin_unit_test,unit_tests' },
104106
{ scheme: AWSPinpointAnalyticsPlugin, flags: 'Analytics_plugin_unit_test,unit_tests' },
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1640"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "AmplifyKinesisClient"
18+
BuildableName = "AmplifyKinesisClient"
19+
BlueprintName = "AmplifyKinesisClient"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
codeCoverageEnabled = "YES"
31+
onlyGenerateCoverageForSpecifiedTargets = "YES">
32+
<CodeCoverageTargets>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "AmplifyKinesisClient"
36+
BuildableName = "AmplifyKinesisClient"
37+
BlueprintName = "AmplifyKinesisClient"
38+
ReferencedContainer = "container:">
39+
</BuildableReference>
40+
</CodeCoverageTargets>
41+
<Testables>
42+
<TestableReference
43+
skipped = "NO">
44+
<BuildableReference
45+
BuildableIdentifier = "primary"
46+
BlueprintIdentifier = "AmplifyKinesisClientTests"
47+
BuildableName = "AmplifyKinesisClientTests"
48+
BlueprintName = "AmplifyKinesisClientTests"
49+
ReferencedContainer = "container:">
50+
</BuildableReference>
51+
</TestableReference>
52+
</Testables>
53+
</TestAction>
54+
<LaunchAction
55+
buildConfiguration = "Debug"
56+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
57+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
launchStyle = "0"
59+
useCustomWorkingDirectory = "NO"
60+
ignoresPersistentStateOnLaunch = "NO"
61+
debugDocumentVersioning = "YES"
62+
debugServiceExtension = "internal"
63+
allowLocationSimulation = "YES">
64+
</LaunchAction>
65+
<ProfileAction
66+
buildConfiguration = "Release"
67+
shouldUseLaunchSchemeArgsEnv = "YES"
68+
savedToolIdentifier = ""
69+
useCustomWorkingDirectory = "NO"
70+
debugDocumentVersioning = "YES">
71+
<MacroExpansion>
72+
<BuildableReference
73+
BuildableIdentifier = "primary"
74+
BlueprintIdentifier = "AmplifyKinesisClient"
75+
BuildableName = "AmplifyKinesisClient"
76+
BlueprintName = "AmplifyKinesisClient"
77+
ReferencedContainer = "container:">
78+
</BuildableReference>
79+
</MacroExpansion>
80+
</ProfileAction>
81+
<AnalyzeAction
82+
buildConfiguration = "Debug">
83+
</AnalyzeAction>
84+
<ArchiveAction
85+
buildConfiguration = "Release"
86+
revealArchiveInOrganizer = "YES">
87+
</ArchiveAction>
88+
</Scheme>

0 commit comments

Comments
 (0)