Skip to content

Commit 4980131

Browse files
authored
chore: kickoff release
2 parents 90e7163 + 8011e2a commit 4980131

File tree

11 files changed

+74
-117
lines changed

11 files changed

+74
-117
lines changed

.github/workflows/deploy_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- name: Checkout repo
6262
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
6363
with:
64-
fetch-depth: 10
64+
fetch-depth: 100
6565
token: ${{steps.retrieve-token.outputs.token}}
6666

6767
- name: Setup Ruby

.github/workflows/nightly_repeated_unittest.yml

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,30 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
unit_test_ios:
16-
runs-on: macos-12
15+
unit_tests:
16+
name: ${{ matrix.scheme }} Repeated Unit Tests
1717
strategy:
18+
fail-fast: false
1819
matrix:
19-
scheme: [Amplify, AWSPluginsCore, AWSPinpointAnalyticsPlugin, AWSAPIPlugin, AWSCognitoAuthPlugin, AWSDataStorePlugin, AWSLocationGeoPlugin, AWSS3StoragePlugin]
20-
steps:
21-
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
22-
23-
- name: Run repeated unit test iOS
24-
uses: ./.github/composite_actions/run_xcodebuild_test
25-
with:
26-
project_path: .
27-
scheme: ${{ matrix.scheme }}
28-
other_flags: -test-iterations 100 -run-tests-until-failure
29-
30-
unit_test_macos:
31-
runs-on: macos-12
32-
strategy:
33-
matrix:
34-
scheme: [Amplify, AWSPluginsCore, AWSPinpointAnalyticsPlugin, AWSAPIPlugin, AWSCognitoAuthPlugin, AWSDataStorePlugin, AWSLocationGeoPlugin, AWSS3StoragePlugin]
35-
steps:
36-
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
37-
38-
- name: Run repeated unit test macOS
39-
uses: ./.github/composite_actions/run_xcodebuild_test
40-
with:
41-
project_path: .
42-
scheme: ${{ matrix.scheme }}
43-
sdk: macosx
44-
destination: platform=macOS,arch=x86_64
45-
other_flags: -test-iterations 100 -run-tests-until-failure
46-
20+
scheme: [
21+
Amplify,
22+
AWSPluginsCore,
23+
AWSAPIPlugin,
24+
AWSCloudWatchLoggingPlugin,
25+
AWSCognitoAuthPlugin,
26+
AWSDataStorePlugin,
27+
AWSLocationGeoPlugin,
28+
AWSPredictionsPlugin,
29+
AWSPinpointAnalyticsPlugin,
30+
AWSPinpointPushNotificationsPlugin,
31+
AWSS3StoragePlugin,
32+
CoreMLPredictionsPlugin,
33+
InternalAWSPinpointUnitTests
34+
]
35+
uses: ./.github/workflows/run_xcodebuild_test_platforms.yml
36+
with:
37+
scheme: ${{ matrix.scheme }}
38+
timeout-minutes: 50
39+
generate_coverage_report: false
40+
retry_on_error: false
41+
other_flags: -test-iterations 100 -run-tests-until-failure

.github/workflows/run_xcodebuild_test_platforms.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,19 @@ on:
1616
required: false
1717
type: boolean
1818
default: false
19+
retry_on_error:
20+
description: 'Whether to automatically retry if the tests fail'
21+
required: false
22+
type: boolean
23+
default: true
24+
other_flags:
25+
required: false
26+
type: string
27+
default: ''
1928

2029
env:
2130
SCHEME: ${{ inputs.scheme }}
31+
RETRY_ON_ERROR: ${{ inputs.retry_on_error }}
2232

2333
permissions:
2434
contents: read
@@ -50,7 +60,7 @@ jobs:
5060
key: ${{ env.SCHEME }}-iOS-build-${{ github.sha }}
5161
- name: Run iOS Test Suite
5262
id: run-tests
53-
continue-on-error: true
63+
continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }}
5464
uses: ./.github/composite_actions/run_xcodebuild_test
5565
with:
5666
scheme: ${{ env.SCHEME }}
@@ -61,8 +71,9 @@ jobs:
6171
derived_data_path: ${{ github.workspace }}/Build
6272
disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }}
6373
test_without_building: ${{ steps.restore-build.outputs.cache-hit }}
74+
other_flags: ${{ inputs.other_flags }}
6475
- name: Retry iOS Test Suite if needed
65-
if: steps.run-tests.outcome=='failure'
76+
if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure'
6677
id: retry-tests
6778
uses: ./.github/composite_actions/run_xcodebuild_test
6879
with:
@@ -74,6 +85,7 @@ jobs:
7485
derived_data_path: ${{ github.workspace }}/Build
7586
disable_package_resolution: true
7687
test_without_building: true
88+
other_flags: ${{ inputs.other_flags }}
7789
- name: Save the build cache for re-runs
7890
if: failure() && steps.retry-tests.outcome=='failure'
7991
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
@@ -116,7 +128,7 @@ jobs:
116128
key: ${{ env.SCHEME }}-macOS-build-${{ github.sha }}
117129
- name: Run macOS Test Suite
118130
id: run-tests
119-
continue-on-error: true
131+
continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }}
120132
uses: ./.github/composite_actions/run_xcodebuild_test
121133
with:
122134
scheme: ${{ env.SCHEME }}
@@ -127,8 +139,9 @@ jobs:
127139
derived_data_path: ${{ github.workspace }}/Build
128140
disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }}
129141
test_without_building: ${{ steps.restore-build.outputs.cache-hit }}
142+
other_flags: ${{ inputs.other_flags }}
130143
- name: Retry macOS Test Suite if needed
131-
if: steps.run-tests.outcome=='failure'
144+
if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure'
132145
id: retry-tests
133146
uses: ./.github/composite_actions/run_xcodebuild_test
134147
with:
@@ -140,6 +153,7 @@ jobs:
140153
derived_data_path: ${{ github.workspace }}/Build
141154
disable_package_resolution: true
142155
test_without_building: true
156+
other_flags: ${{ inputs.other_flags }}
143157
- name: Save the build cache for re-runs
144158
if: failure() && steps.retry-tests.outcome=='failure'
145159
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
@@ -173,7 +187,7 @@ jobs:
173187
key: ${{ env.SCHEME }}-tvOS-build-${{ github.sha }}
174188
- name: Run tvOS Test Suite
175189
id: run-tests
176-
continue-on-error: true
190+
continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }}
177191
uses: ./.github/composite_actions/run_xcodebuild_test
178192
with:
179193
scheme: ${{ env.SCHEME }}
@@ -184,8 +198,9 @@ jobs:
184198
derived_data_path: ${{ github.workspace }}/Build
185199
disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }}
186200
test_without_building: ${{ steps.restore-build.outputs.cache-hit }}
201+
other_flags: ${{ inputs.other_flags }}
187202
- name: Retry tvOS Test Suite if needed
188-
if: steps.run-tests.outcome=='failure'
203+
if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure'
189204
id: retry-tests
190205
uses: ./.github/composite_actions/run_xcodebuild_test
191206
with:
@@ -197,6 +212,7 @@ jobs:
197212
derived_data_path: ${{ github.workspace }}/Build
198213
disable_package_resolution: true
199214
test_without_building: true
215+
other_flags: ${{ inputs.other_flags }}
200216
- name: Save the build cache for re-runs
201217
if: failure() && steps.retry-tests.outcome=='failure'
202218
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
@@ -230,7 +246,7 @@ jobs:
230246
key: ${{ env.SCHEME }}-watchOS-build-${{ github.sha }}
231247
- name: Run watchOS Test Suite
232248
id: run-tests
233-
continue-on-error: true
249+
continue-on-error: ${{ env.RETRY_ON_ERROR == 'true' }}
234250
uses: ./.github/composite_actions/run_xcodebuild_test
235251
with:
236252
scheme: ${{ env.SCHEME }}
@@ -241,8 +257,9 @@ jobs:
241257
derived_data_path: ${{ github.workspace }}/Build
242258
disable_package_resolution: ${{ steps.cache-packages.outputs.cache-hit }}
243259
test_without_building: ${{ steps.restore-build.outputs.cache-hit }}
260+
other_flags: ${{ inputs.other_flags }}
244261
- name: Retry watchOS Test Suite if needed
245-
if: steps.run-tests.outcome=='failure'
262+
if: inputs.retry_on_error == true && steps.run-tests.outcome=='failure'
246263
id: retry-tests
247264
uses: ./.github/composite_actions/run_xcodebuild_test
248265
with:
@@ -254,6 +271,7 @@ jobs:
254271
derived_data_path: ${{ github.workspace }}/Build
255272
disable_package_resolution: true
256273
test_without_building: true
274+
other_flags: ${{ inputs.other_flags }}
257275
- name: Save the build cache for re-runs
258276
if: failure() && steps.retry-tests.outcome=='failure'
259277
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1

AmplifyPlugins/API/Sources/AWSAPIPlugin/AWSAPIPluginsCore.swift

Lines changed: 0 additions & 63 deletions
This file was deleted.

AmplifyPlugins/API/Sources/AWSAPIPlugin/Interceptor/RequestInterceptor/APIKeyURLRequestInterceptor.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Foundation
1111

1212
struct APIKeyURLRequestInterceptor: URLRequestInterceptor {
1313

14+
private let userAgent = AmplifyAWSServiceConfiguration.frameworkMetaData().description
1415
let apiKeyProvider: APIKeyProvider
1516

1617
init(apiKeyProvider: APIKeyProvider) {
@@ -20,10 +21,8 @@ struct APIKeyURLRequestInterceptor: URLRequestInterceptor {
2021
func intercept(_ request: URLRequest) -> URLRequest {
2122
var modifiedRequest = request
2223
let apiKey = apiKeyProvider.getAPIKey()
23-
modifiedRequest.addValue(apiKey,
24-
forHTTPHeaderField: URLRequestConstants.Header.xApiKey)
25-
modifiedRequest.setValue(AWSAPIPluginsCore.baseUserAgent(),
26-
forHTTPHeaderField: URLRequestConstants.Header.userAgent)
24+
modifiedRequest.addValue(apiKey, forHTTPHeaderField: URLRequestConstants.Header.xApiKey)
25+
modifiedRequest.setValue(userAgent, forHTTPHeaderField: URLRequestConstants.Header.userAgent)
2726

2827
return modifiedRequest
2928
}

AmplifyPlugins/API/Sources/AWSAPIPlugin/Interceptor/RequestInterceptor/AuthTokenURLRequestInterceptor.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import AWSPluginsCore
1010
import Foundation
1111

1212
struct AuthTokenURLRequestInterceptor: URLRequestInterceptor {
13-
13+
14+
static let AWSDateISO8601DateFormat2 = "yyyyMMdd'T'HHmmss'Z'"
15+
16+
private let userAgent = AmplifyAWSServiceConfiguration.frameworkMetaData().description
1417
let authTokenProvider: AuthTokenProvider
1518

1619
init(authTokenProvider: AuthTokenProvider) {
@@ -24,14 +27,14 @@ struct AuthTokenURLRequestInterceptor: URLRequestInterceptor {
2427
}
2528
let date = Date()
2629
let dateFormatter = DateFormatter()
27-
dateFormatter.dateFormat = AWSAPIPluginsCore.AWSDateISO8601DateFormat2
30+
dateFormatter.dateFormat = Self.AWSDateISO8601DateFormat2
2831
let amzDate = dateFormatter.string(from: date)
2932

3033
mutableRequest.setValue(amzDate,
3134
forHTTPHeaderField: URLRequestConstants.Header.xAmzDate)
3235
mutableRequest.setValue(URLRequestConstants.ContentType.applicationJson,
3336
forHTTPHeaderField: URLRequestConstants.Header.contentType)
34-
mutableRequest.setValue(AWSAPIPluginsCore.baseUserAgent(),
37+
mutableRequest.setValue(userAgent,
3538
forHTTPHeaderField: URLRequestConstants.Header.userAgent)
3639

3740
let token: String

AmplifyPlugins/API/Sources/AWSAPIPlugin/Interceptor/RequestInterceptor/IAMURLRequestInterceptor.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ struct IAMURLRequestInterceptor: URLRequestInterceptor {
1616
let iamCredentialsProvider: IAMCredentialsProvider
1717
let region: AWSRegionType
1818
let endpointType: AWSAPICategoryPluginEndpointType
19-
19+
private let userAgent = AmplifyAWSServiceConfiguration.frameworkMetaData().description
20+
2021
init(iamCredentialsProvider: IAMCredentialsProvider,
2122
region: AWSRegionType,
2223
endpointType: AWSAPICategoryPluginEndpointType) {
@@ -37,7 +38,7 @@ struct IAMURLRequestInterceptor: URLRequestInterceptor {
3738

3839
request.setValue(URLRequestConstants.ContentType.applicationJson, forHTTPHeaderField: URLRequestConstants.Header.contentType)
3940
request.setValue(host, forHTTPHeaderField: "host")
40-
request.setValue(AWSAPIPluginsCore.baseUserAgent(), forHTTPHeaderField: URLRequestConstants.Header.userAgent)
41+
request.setValue(userAgent, forHTTPHeaderField: URLRequestConstants.Header.userAgent)
4142

4243
let httpMethod = (request.httpMethod?.uppercased())
4344
.flatMap(HttpMethodType.init(rawValue:)) ?? .get

AmplifyPlugins/API/Sources/AWSAPIPlugin/Operation/AWSGraphQLSubscriptionTaskRunner.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class AWSGraphQLSubscriptionTaskRunner<R: Decodable>: InternalTaskRunner,
2121
let subscriptionConnectionFactory: SubscriptionConnectionFactory
2222
let authService: AWSAuthServiceBehavior
2323
var apiAuthProviderFactory: APIAuthProviderFactory
24+
private let userAgent = AmplifyAWSServiceConfiguration.frameworkMetaData().description
2425

2526
var subscriptionConnection: SubscriptionConnection?
2627
var subscriptionItem: SubscriptionItem?
@@ -112,7 +113,7 @@ public class AWSGraphQLSubscriptionTaskRunner<R: Decodable>: InternalTaskRunner,
112113
from endpointConfig: AWSAPICategoryPluginConfiguration.EndpointConfig
113114
) -> URLRequest {
114115
var urlRequest = URLRequest(url: endpointConfig.baseURL)
115-
urlRequest.setValue(AWSAPIPluginsCore.baseUserAgent(), forHTTPHeaderField: URLRequestConstants.Header.userAgent)
116+
urlRequest.setValue(userAgent, forHTTPHeaderField: URLRequestConstants.Header.userAgent)
116117
return urlRequest
117118
}
118119

@@ -202,7 +203,8 @@ final public class AWSGraphQLSubscriptionOperation<R: Decodable>: GraphQLSubscri
202203
let pluginConfig: AWSAPICategoryPluginConfiguration
203204
let subscriptionConnectionFactory: SubscriptionConnectionFactory
204205
let authService: AWSAuthServiceBehavior
205-
206+
private let userAgent = AmplifyAWSServiceConfiguration.frameworkMetaData().description
207+
206208
var subscriptionConnection: SubscriptionConnection?
207209
var subscriptionItem: SubscriptionItem?
208210
var apiAuthProviderFactory: APIAuthProviderFactory
@@ -311,7 +313,7 @@ final public class AWSGraphQLSubscriptionOperation<R: Decodable>: GraphQLSubscri
311313
from endpointConfig: AWSAPICategoryPluginConfiguration.EndpointConfig
312314
) -> URLRequest {
313315
var urlRequest = URLRequest(url: endpointConfig.baseURL)
314-
urlRequest.setValue(AWSAPIPluginsCore.baseUserAgent(), forHTTPHeaderField: URLRequestConstants.Header.userAgent)
316+
urlRequest.setValue(userAgent, forHTTPHeaderField: URLRequestConstants.Header.userAgent)
315317
return urlRequest
316318
}
317319

AmplifyPlugins/Geo/Sources/AWSLocationGeoPlugin/AWSLocationGeoPlugin+Configure.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ extension AWSLocationGeoPlugin {
3232
let region = configuration.regionName
3333
let serviceConfiguration = try LocationClient.LocationClientConfiguration(
3434
credentialsProvider: credentialsProvider,
35+
frameworkMetadata: AmplifyAWSServiceConfiguration.frameworkMetaData(),
3536
region: region)
3637

3738
let location = LocationClient(config: serviceConfiguration)

AmplifyPlugins/Logging/Sources/AWSCloudWatchLoggingPlugin/AWSCloudWatchLoggingSessionController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ final class AWSCloudWatchLoggingSessionController {
104104
if self.client == nil {
105105
let configuration = try CloudWatchLogsClient.CloudWatchLogsClientConfiguration(
106106
credentialsProvider: credentialsProvider,
107+
frameworkMetadata: AmplifyAWSServiceConfiguration.frameworkMetaData(),
107108
region: region
108109
)
109110
self.client = CloudWatchLogsClient(config: configuration)

0 commit comments

Comments
 (0)