Skip to content

Commit 75ac320

Browse files
committed
docs: correct stale versions, paths, links, and API signatures
Audited the markdown against the actual repo contents and fixed the claims that contradict it. Each item below was verified against Package.swift, the source, or by resolving the URL. Version and tooling facts: - CONTRIBUTING.md said Xcode 13.4 minimum; README.md and AGENTS.md say 16.0, and 13.4 cannot even parse `swift-tools-version:5.9`. - CONTRIBUTING.md specified a 100-character line limit; SwiftLint enforces 160. - CONTRIBUTING.md's Tools section listed only Xcode, omitting the SwiftFormat 0.60.1 / SwiftLint 0.54.0 pins and Fastlane that CI actually requires. - AGENTS.md said 19 test targets (there are 23) and "60+" workflows (70). Wrong or dead references: - AWS SDK for Swift linked to github.com/aws-amplify/aws-sdk-swift; the correct org is awslabs, per Package.swift. - Six dead CONTRIBUTING.md TOC anchors (off-by-one step links, a "Running Cocoapods Locally" entry with no target section). - Four legacy docs.amplify.aws /lib/...q/platform/ios URLs updated to the paths they now redirect to. - bug_report.yaml pointed at the old amplify-ios repo and asked Swift users for an Amplify CLI log; LogsGuidance.md is about Xcode console output. - ETHOS.md named a nonexistent AWSStoragePlugin (it is AWSS3StoragePlugin). - AmplifyTests/CoreTests/README.md described an amplifyconfiguration.json sample that is not in that directory, and predated amplify_outputs.json. Corrected code and structure claims: - AmplifyClients/AGENTS.md: KinesisError.unknown has three associated values, not two; the initializer is `throws`; `record` is `@discardableResult`; the User-Agent example double-stamped the version, which UserAgentClientEngine already injects as lib/amplify-swift#<version>. - AmplifyClients/AGENTS.md: added the missing AmplifyRecordCache layer (used by Kinesis and Firehose) and corrected the integration-test layout, which is not co-located per client. - AmplifyPlugins/AGENTS.md: unit-test directory names vary by plugin, so the single stated pattern was wrong for most of them. Also removed `@visibleForTesting`, which is not a Swift attribute and has zero occurrences in this codebase. - Amplify/AGENTS.md: named the two actual DefaultPlugins and resolved the contradiction about Hub needing no plugin. - Documented that api-dump/ covers only four modules, and distinguished api-breaking-changes-detection.yml from api_digester_check.yml. - Documented that SwiftLint's `included:` scope excludes AmplifyClients/, AmplifyFoundation/, and AmplifyFoundationBridge/, and that the lint workflows do not run on pull_request. - Added the footnote the README's visionOS "Preview*" marker was missing, and noted visionOS is not declared in Package.swift but inherited from iOS. - Surfaced the Amazon Pinpoint retirement notice (Oct 30, 2026) in README.md and AmplifyPlugins/AGENTS.md; previously only the migration guide carried it while the README still listed Analytics as GA with no caveat. - Fixed a syntax error in both README-combine-support.md samples (`search(for "coffee")` was missing its colon) and two LogsGuidance.md typos.
1 parent 58cbbbd commit 75ac320

12 files changed

Lines changed: 78 additions & 47 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ body:
8787
attributes:
8888
label: Relevant log output
8989
description: >-
90-
Include any relevant log output under
91-
`~/.amplify/logs/amplify-cli-<issue-date>.log` (See: [Logs Guidance](https://github.com/aws-amplify/amplify-ios/blob/main/LogsGuidance.md))
90+
Include any relevant log output from the Xcode console
91+
(See: [Logs Guidance](https://github.com/aws-amplify/amplify-swift/blob/main/LogsGuidance.md))
9292
value: |
9393
<details>
9494
<summary>Log Messages</summary>

AGENTS.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ Detailed conventions and patterns live closer to the code. Read the relevant gui
1313

1414
- [`Amplify/AGENTS.md`](Amplify/AGENTS.md) — Core framework: categories, plugin protocols, error handling, configuration, Hub
1515
- [`AmplifyPlugins/AGENTS.md`](AmplifyPlugins/AGENTS.md) — Plugin implementations: Auth, API, Storage, DataStore, etc.
16-
- [`AmplifyClients/AGENTS.md`](AmplifyClients/AGENTS.md) — Standalone clients: Foundation, Bridge, Kinesis (new pattern)
16+
- [`AmplifyClients/AGENTS.md`](AmplifyClients/AGENTS.md) — Standalone clients: Kinesis, Firehose, Connect, EventEnrichment, plus shared RecordCache (new pattern)
1717

1818
## Linting & Formatting (MUST pass)
1919

20-
**Always run `swiftformat` on changed files before every commit.** CI enforces both formatting and linting — PRs will fail if files are not formatted. See `.swiftlint.yml` and `.swiftformat` for full rules.
20+
**Always run `swiftformat` on changed files before every commit.** The SwiftFormat and SwiftLint workflows run on pushes to non-default branches (not on `pull_request`), so format locally rather than relying on a PR check to catch it. See `.swiftlint.yml` and `.swiftformat` for full rules.
21+
22+
Note that `.swiftlint.yml` only lints `Amplify/` and `AmplifyPlugins/``AmplifyClients/`, `AmplifyFoundation/`, and `AmplifyFoundationBridge/` are outside SwiftLint's `included:` scope, though SwiftFormat covers the whole repo.
2123

2224
```bash
2325
swiftformat <changed-files> # Format changed files before committing
@@ -42,7 +44,7 @@ swiftlint --fix # Then lint
4244
amplify-swift/
4345
├── Amplify/ # Core framework (categories, protocols, errors, config)
4446
├── AmplifyPlugins/ # AWS service plugins (Auth, API, Storage, DataStore, etc.)
45-
├── AmplifyClients/ # Standalone AWS clients (Kinesis) — new pattern
47+
├── AmplifyClients/ # Standalone AWS clients (Kinesis, Firehose, Connect, EventEnrichment) — new pattern
4648
├── AmplifyFoundation/ # Shared protocols (credentials, logging, errors) — no deps
4749
├── AmplifyFoundationBridge/ # Foundation ↔ AWS SDK adapters
4850
├── AmplifyTests/ # Core unit tests
@@ -84,7 +86,7 @@ chore: update aws-swift-sdk dependency
8486
```
8587

8688
**Types**: `feat`, `fix`, `chore`, `refactor`, `test`, `docs`, `perf`, `ci`
87-
**Scopes**: `auth`, `api`, `storage`, `datastore`, `geo`, `analytics`, `logging`, `predictions`, `push`, `kinesis`, `core`, `foundation`
89+
**Scopes**: `auth`, `api`, `storage`, `datastore`, `geo`, `analytics`, `logging`, `predictions`, `push`, `kinesis`, `firehose`, `connect`, `core`, `foundation`
8890

8991
No period at end. One feature/bugfix per PR. Reference issues: `fixes #<issue>`.
9092

@@ -95,7 +97,7 @@ swift test # All unit tests
9597
swift test --filter AWSCognitoAuthPluginUnitTests # Specific target
9698
```
9799

98-
- **Unit tests**: XCTest, defined in Package.swift (19 test targets)
100+
- **Unit tests**: XCTest, defined in Package.swift (23 test targets)
99101
- **Integration tests**: Xcode host app projects under `AmplifyPlugins/<Category>/Tests/<Category>HostApp/`
100102
- **Conventions**: Mock via behavior protocols, use `AmplifyTestCommon` for shared utilities, `AmplifyAsyncTesting` for async helpers
101103
- **Test documentation**: Use Given/When/Then doc comments on all test methods:
@@ -114,11 +116,11 @@ swift test --filter AWSCognitoAuthPluginUnitTests # Specific target
114116

115117
## Semver
116118

117-
New enum cases = **minor** bump. Breaking API changes = **major** (rare, needs approval). API surface tracked via `api-dump/` JSON snapshots and CI checks.
119+
New enum cases = **minor** bump. Breaking API changes = **major** (rare, needs approval). API surface tracked via `api-dump/` JSON snapshots and CI checks, currently covering four modules only: `Amplify`, `AWSPluginsCore`, `AWSDataStorePlugin`, and `CoreMLPredictionsPlugin`.
118120

119121
## CI/CD
120122

121-
60+ GitHub Actions workflows in `.github/workflows/`: per-category unit tests (`unit_test_*.yml`), integration tests (`integ_test_*.yml`), platform builds, SwiftLint/SwiftFormat checks, API digester, CodeQL, Fortify. Releases via Fastlane.
123+
70 GitHub Actions workflows in `.github/workflows/`: per-category unit tests (`unit_test_*.yml`), integration tests (`integ_test_*.yml`), platform builds, SwiftLint/SwiftFormat checks, API digester, CodeQL, Fortify. Releases via Fastlane.
122124

123125
## Common Agent Tasks
124126

Amplify/AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Amplify/
3434
│ ├── Auth/ # AuthCategoryBehavior (sign-in, sign-up, session, MFA)
3535
│ ├── DataStore/ # DataStoreCategoryBehavior (sync, query, observe)
3636
│ ├── Geo/ # GeoCategoryBehavior (search, maps)
37-
│ ├── Hub/ # Built-in pub/sub event system (no plugin needed)
37+
│ ├── Hub/ # Pub/sub event system (no user setup needed — backed by the built-in AWSHubPlugin)
3838
│ ├── Logging/ # LoggingCategoryBehavior
3939
│ ├── Notifications/ # Push notification behavior
4040
│ ├── Predictions/ # ML prediction behavior (text, vision, speech)
@@ -47,7 +47,7 @@ Amplify/
4747
│ ├── Model/ # Model, Schema, Field definitions (DataStore)
4848
│ ├── Plugin/ # Plugin protocol, PluginKey, Resettable
4949
│ └── Support/ # AmplifyError protocol, utilities
50-
├── DefaultPlugins/ # Built-in default plugin implementations
50+
├── DefaultPlugins/ # AWSHubPlugin and AWSUnifiedLoggingPlugin (registered automatically)
5151
└── DevMenu/ # Developer debug menu
5252
```
5353

@@ -107,7 +107,7 @@ let token = Amplify.Hub.listen(to: .auth) { payload in ... }
107107

108108
## API Surface Stability
109109

110-
API dumps in `api-dump/*.json` track the public surface. Breaking changes detected by CI (`api_digester_check.yml`). New enum cases = minor bump; removing/renaming public APIs = major bump (needs approval).
110+
API dumps in `api-dump/*.json` track the public surface of four modules (`Amplify`, `AWSPluginsCore`, `AWSDataStorePlugin`, `CoreMLPredictionsPlugin`). Breaking changes detected by CI (`api-breaking-changes-detection.yml`; `api_digester_check.yml` separately verifies the digester tool itself against the `api-dump-test/` fixtures). New enum cases = minor bump; removing/renaming public APIs = major bump (needs approval).
111111

112112
## Adding a New API to a Category
113113

AmplifyClients/AGENTS.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ Amplify Clients are **standalone AWS service clients** independent of the core `
99
```
1010
┌─────────────────────────────────────────────────────────┐
1111
│ Amplify Clients (e.g., AmplifyKinesisClient) │
12-
│ High-level APIs, actor-based, local caching, retry │
12+
│ High-level APIs, actor-based, retry │
13+
├─────────────────────────────────────────────────────────┤
14+
│ AmplifyRecordCache (Shared Caching Layer) │
15+
│ SQLite-backed record buffering, used by Kinesis and │
16+
│ Firehose │
1317
├─────────────────────────────────────────────────────────┤
1418
│ AmplifyFoundation (Protocol Layer) │
1519
│ Pure Swift protocols — zero external deps │
@@ -60,8 +64,8 @@ Deps: `AmplifyFoundation`, `AmplifyFoundationBridge`, `SQLite.swift`, `AWSKinesi
6064

6165
```swift
6266
public class AmplifyKinesisClient {
63-
init(region: String, credentialsProvider: AWSCredentialsProvider, options: Options)
64-
func record(data: Data, partitionKey: String, streamName: String) async throws -> RecordData
67+
init(region: String, credentialsProvider: any AmplifyFoundation.AWSCredentialsProvider, options: Options = Options()) throws
68+
@discardableResult func record(data: Data, partitionKey: String, streamName: String) async throws -> RecordData
6569
func flush() async throws -> FlushData
6670
func enable() async / func disable() async
6771
func clearCache() async throws -> ClearCacheData
@@ -76,7 +80,7 @@ public enum KinesisError: AmplifyError {
7680
case cache(ErrorDescription, RecoverySuggestion, Error?)
7781
case cacheLimitExceeded(ErrorDescription, RecoverySuggestion, Error?)
7882
case validation(ErrorDescription, RecoverySuggestion, Error?)
79-
case unknown(ErrorDescription, Error?)
83+
case unknown(ErrorDescription, RecoverySuggestion, Error?)
8084
}
8185
```
8286

@@ -90,18 +94,22 @@ AmplifyClients/Amplify<Service>Client/
9094
│ ├── Amplify<Service>Client.swift # Public facade
9195
│ └── Support/ # Error type, actors, protocols, impls
9296
├── Tests/
93-
│ ├── UnitTests/
94-
│ └── IntegrationTests/
97+
│ └── UnitTests/
9598
```
9699

100+
Integration tests are not co-located per client. `AmplifyConnectClient` has its own host app under `Tests/ConnectClientHostApp/`, Kinesis and Firehose share `AmplifyClients/Tests/IntegrationTests/KinesisFirehoseClientHostApp/`, and `AmplifyEventEnrichmentClient` has unit tests only.
101+
97102
### Package.swift target
98103

99104
```swift
100105
.target(
101106
name: "Amplify<Service>Client",
102107
dependencies: ["AmplifyFoundation", "AmplifyFoundationBridge",
108+
// Add "AmplifyRecordCache" (+ the SQLite product) only if the
109+
// client buffers records locally, as Kinesis and Firehose do.
103110
.product(name: "AWS<Service>", package: "aws-sdk-swift")],
104111
path: "AmplifyClients/Amplify<Service>Client/Sources",
112+
resources: [.copy("Resources/PrivacyInfo.xcprivacy")],
105113
swiftSettings: [.enableUpcomingFeature("StrictConcurrency")]
106114
)
107115
```
@@ -130,6 +138,8 @@ var config = try AWS<Service>.<Service>Client.<Service>ClientConfiguration(
130138
)
131139
config.httpClientEngine = UserAgentClientEngine(
132140
target: config.httpClientEngine,
133-
additionalMetadata: ["md/amplify-<service>#\(AmplifyMetadata.version)"]
141+
additionalMetadata: ["md/amplify-<service>"]
134142
)
135143
```
144+
145+
Do not append the version here — `UserAgentClientEngine` already injects `lib/amplify-swift#<version>`, so adding `AmplifyMetadata.version` to the `md/` segment stamps it twice.

AmplifyPlugins/AGENTS.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
| `Predictions/` | `AWSPredictionsPlugin` | Comprehend, Polly, Rekognition, Textract, Translate, Transcribe | Predictions |
2020
| `Predictions/` | `CoreMLPredictionsPlugin` | On-device CoreML | Predictions |
2121
| `Storage/` | `AWSS3StoragePlugin` | Amazon S3 | Storage |
22-
| `Core/` | `AWSPluginsCore`, `InternalAmplifyCredentials` | Shared plugin infra | Core |
22+
| `Core/` | `AWSPluginsCore`, `InternalAmplifyCredentials`, `AWSPluginsTestCommon` | Shared plugin infra (and shared test utilities) | Core |
23+
24+
> **Amazon Pinpoint retirement** — Pinpoint is scheduled to be retired on October 30, 2026. This affects `AWSPinpointAnalyticsPlugin`, `AWSPinpointPushNotificationsPlugin`, and `InternalAWSPinpoint`.
2325
2426
## Plugin File Organization
2527

@@ -46,7 +48,7 @@ Every plugin follows an extension-based pattern:
4648
- Constructor-based with optional parameters and defaults
4749
- Services injected during `configure(using:)` phase
4850
- Behavior protocols abstract AWS service calls (e.g., `AWSAuthCredentialsProviderBehavior`)
49-
- `@visibleForTesting` for test-only injection points
51+
- Test-only injection points are exposed via `internal` access plus `@testable import` — there is no `@visibleForTesting` attribute in Swift
5052

5153
## Logging
5254

@@ -63,7 +65,7 @@ extension AWSAPIPlugin {
6365

6466
## Testing
6567

66-
**Unit tests**: `AmplifyPlugins/<Category>/Tests/<PluginName>UnitTests/` (SPM test targets)
68+
**Unit tests**: SPM test targets under `AmplifyPlugins/<Category>/Tests/`. Naming varies — most are `<PluginName>Tests` (e.g. `AWSAPIPluginTests`, `AWSS3StoragePluginTests`), Auth/Analytics/Predictions/Push use a `UnitTests` suffix (e.g. `AWSCognitoAuthPluginUnitTests`), and DataStore is `AWSDataStoreCategoryPluginTests`. Core's live at `AmplifyPlugins/Core/AWSPluginsCoreTests` and `AmplifyPlugins/Core/AmplifyCredentialsTests`. Check `Package.swift` for the exact target name.
6769

6870
**Integration tests**: `AmplifyPlugins/<Category>/Tests/<Category>HostApp/` (Xcode projects) — require AWS credentials and provisioned backends. Multiple test plan variants per category (Gen1, Gen2, auth modes, etc.).
6971

AmplifyTests/CoreTests/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Amplify Configuration Tests
22

3-
Amplify allows for configuration from either an in-memory `AmplifyConfiguration` object, or from an `amplifyconfiguration.json` file (which simply deserializes
4-
into an `AmplifyConfiguration` object.
3+
Amplify supports configuration from an in-memory `AmplifyConfiguration` object, from an
4+
`amplifyconfiguration.json` file (Gen1, which deserializes into an `AmplifyConfiguration`),
5+
or from an `amplify_outputs.json` file (Gen2, which deserializes into `AmplifyOutputsData`).
56

6-
As we add new categories, we will add new stanzas to the sample `amplifyconfiguration.json` file in this directory, to ensure compatibility.
7+
Test fixtures live alongside the tests rather than in this directory — see
8+
`AmplifyConfigurationInitializationTests.swift` and `AmplifyOutputsInitializationTests.swift`.
9+
As we add new categories, extend the fixtures in those tests to ensure compatibility.

0 commit comments

Comments
 (0)