Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 53 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR updates devcontainers and CI, replaces Mint with Mise for tooling, adds swift-format/lint/OpenAPI generator configs and scripts, introduces Event.interactive and Plausible.userAgent (sent as User-Agent), tightens OpenAPI event schema/headers, and migrates tests/mocks to the Testing framework. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client (Plausible)
participant Transport as Transport (e.g., URLSessionTransport / MockTransport)
participant Server as Server (POST /event)
rect rgba(135,206,250,0.5)
Client->>Transport: prepare request (POST /event)\ninclude JSON payload (interactive, url, props, revenue)\nadd headers: User-Agent, X-Forwarded-For?, X-Debug-Request?
end
rect rgba(144,238,144,0.5)
Transport->>Server: send HTTP request\n(body as Data, headers set)
Server-->>Transport: respond (202 or 200 debug)
end
Transport-->>Client: deliver response (or none for fire-and-forget)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
===========================================
+ Coverage 75.17% 89.47% +14.29%
===========================================
Files 6 4 -2
Lines 141 76 -65
===========================================
- Hits 106 68 -38
+ Misses 35 8 -27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…flow updates, and openapi.yaml improvements - Add WASI emulation flags and conditional OpenAPIURLSession dependency for WASM builds - Migrate from Mint to Mise (spm: backend for swift-format and swift-openapi-generator) - Replace nicklockwood/SwiftFormat with apple/swift-format 602.0.0 - Rewrite GitHub Actions workflow: configure matrix job, WASM/Android/Windows builds, macOS 26/Xcode 26.4, Mise-based linting - Update .swiftlint.yml: add one_declaration_per_file, new disabled_rules, remove Mint exclusion - Add devcontainers for Swift 6.1, 6.2, 6.3; update VS Code extension to swiftlang.swift-vscode - Update openapi.yaml: add interactive field, request headers, url/props constraints, 200 debug response - Add userAgent property to Plausible; fix deprecated Servers.server1() → Servers.Server1.url() - Add Scripts/header.sh for MIT license header management - Fix Scripts/generate.sh package name and use mise exec - Refactor testPostEvent for shorter function body Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Apple platforms - Add full-matrix output to configure job to gate Windows/Android jobs - Expand Ubuntu Swift matrix to 6.1/6.2/6.3 on full runs (was only 6.3) - Exclude wasm/wasm-embedded for Swift 6.1 (unsupported) - Add download-platform: true to all iOS/watchOS/tvOS/visionOS matrix entries - Replace single-job build-android with matrix (Swift 6.2/6.3 × API 33-36) - Replace single-job build-windows with matrix (2022/2025 × Swift 6.1/6.2/6.3) - Fix lint job to use !cancelled() && !failure() so it runs past skipped jobs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
c52783d to
24da913
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mport Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6e070b6 to
f885a3f
Compare
- Update sersoft-gmbh/swift-coverage-action to v5, codecov-action to v6 - Comment out wasmtime-version in Ubuntu build - Use contains-code-coverage output from swift-build to gate coverage steps - Remove unused db identifier exclusion from swiftlint config - Delete Scripts/generate.sh Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
Tests/AviaryInsightsTests/AviaryInsightsTests.swift (1)
61-72:⚠️ Potential issue | 🟡 MinorDon't normalize the captured payload before asserting it.
Decoding
request.bodyback intojsonPayloadthrows away unknown keys and collapsesnulloptionals to the same state as omitted fields, so the test can pass with the wrong on-the-wire JSON. Compare canonicalized raw JSON instead of round-tripping through the generated type.🔎 Suggested assertion change
let data = try `#require`(request.body) - let actualJSONPayload = try decoder.decode( - Operations.post_sol_event.Input.Body.jsonPayload.self, - from: data - ) let expectedJSONPayload = Operations.post_sol_event.Input.Body.jsonPayload( event: event, defaultDomain: defaultDomain ) - let actualEncoded = try encoder.encode(actualJSONPayload) - let expectedEncoded = try encoder.encode(expectedJSONPayload) - `#expect`(actualEncoded == expectedEncoded) + let actualObject = try JSONSerialization.jsonObject(with: data) + let expectedData = try encoder.encode(expectedJSONPayload) + let expectedObject = try JSONSerialization.jsonObject(with: expectedData) + let actualCanonical = try JSONSerialization.data( + withJSONObject: actualObject, + options: [.sortedKeys] + ) + let expectedCanonical = try JSONSerialization.data( + withJSONObject: expectedObject, + options: [.sortedKeys] + ) + `#expect`(actualCanonical == expectedCanonical)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Tests/AviaryInsightsTests/AviaryInsightsTests.swift` around lines 61 - 72, The test currently decodes request.body into Operations.post_sol_event.Input.Body.jsonPayload which normalizes away unknown keys and null-vs-omitted differences; instead, canonicalize and compare the raw JSON bytes. Replace the round-trip decode of request.body (the use of decoder.decode into jsonPayload and creation of actualEncoded) with canonicalization of the raw request.body bytes (e.g., parse to a JSON object and re-serialize with a deterministic/canonical form) and compare that canonicalized data to the canonicalized encoding of the expected Operations.post_sol_event.Input.Body.jsonPayload; keep references to request.body, Operations.post_sol_event.Input.Body.jsonPayload, expectedJSONPayload, and the comparison (actual vs expected canonicalized bytes) to locate and update the assertion.openapi.yaml (1)
56-69:⚠️ Potential issue | 🟠 MajorMirror the new
url/propslimits in the publicEventAPI.These constraints are now part of the contract, but
Sources/AviaryInsights/Event.swift:35-89still accepts any URL length and any props count. That lets callers build requests the spec now rejects.Based on learnings: Use OpenAPI-first design approach: auto-generate Plausible API client from openapi.yaml using swift-openapi-generator.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@openapi.yaml` around lines 56 - 69, Event model currently accepts any URL length and any number of props while the OpenAPI contract limits url to maxLength 2000 and props to maxProperties 30; enforce these constraints in the Event model's initializer/validation (e.g., in Event.init or Event.validate) by rejecting or throwing when url.count > 2000 or props.count > 30, return/throw a descriptive error matching API validation, and add/update unit tests to cover the new validation; also consider regenerating the Swift client from openapi.yaml with swift-openapi-generator to keep models in sync.
🧹 Nitpick comments (1)
.devcontainer/swift-6.3/devcontainer.json (1)
1-39: Optional: reduce config drift across versioned devcontainers.Consider extracting shared settings into a common template/base generation step to avoid future divergence across
swift-6.1,swift-6.2, andswift-6.3.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.devcontainer/swift-6.3/devcontainer.json around lines 1 - 39, Summary: multiple devcontainer.json files for swift-6.1/6.2/6.3 are diverging; extract common bits into a shared base to reduce config drift. Fix: create a single base devcontainer template that contains shared keys (features, runArgs, customizations.vscode.settings, customizations.vscode.extensions, remoteUser) and update each variant (the files containing "image": "swift:6.3" / "swift:6.2" / "swift:6.1") to reference or be generated from that base while only overriding the "image" value and any variant-specific settings; ensure unique symbols in the diff such as "features", "runArgs", "customizations.vscode.settings", "extensions", and "remoteUser" are moved to the base and removed from per-version files so future changes are made once in the base.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@openapi-generator-config.yaml`:
- Around line 5-7: Remove the blanket additionalFileComments entries
("swift-format-ignore-file" and "swiftlint:disable all") from
openapi-generator-config.yaml and instead add a nested .swiftlint.yml file under
Sources/AviaryInsights/Generated/ that selectively disables only the
generator-violated rules (e.g., add disabled_rules list containing type_name,
identifier_name, file_length, line_length, nesting); keep repository-root
SwiftLint/format rules intact and let swift-format run normally on handwritten
code (or run swift-format as an explicit post-generation step if you need
generated files formatted).
In `@openapi.yaml`:
- Around line 94-97: The 200 response for the debug path currently lacks a
response body schema so generators treat it as Void; update the '200' response
block in openapi.yaml to include a content section (e.g., application/json) with
a schema describing the debug payload — an object with an "ip" property of type
string and a description indicating it's the IP used for visitor counting — so
tools like swift-openapi-generator will model the debug response payload
correctly.
In `@Package.swift`:
- Line 1: Add the repository-required MIT license header at the top of
Package.swift: insert the standard multi-line MIT header block before the
existing swift-tools-version line so the file begins with the license comment,
ensuring the header matches the project's required format for all .swift files.
In `@Scripts/lint.sh`:
- Around line 29-34: The CI guard in lint.sh prevents header.sh from running
when CI is set, so license headers aren't enforced in CI; update Scripts/lint.sh
to always run header.sh (or at least run it when CI=true and LINT_MODE=STRICT)
instead of only when CI is unset: remove or adjust the if [ -z "$CI" ]
conditional and ensure the calls to header.sh (referenced as bash
"$SCRIPT_DIR/header.sh" "$PACKAGE_DIR/Sources" and "$PACKAGE_DIR/Tests") execute
during CI runs so the MIT header check/enforcement runs in CI as well as
locally.
In `@Sources/AviaryInsights/Event.swift`:
- Around line 57-60: The public docs for the Event.interactive property claim
"Defaults to `true`" but the Event initializer parameter defaults to nil; update
them so they match: either change the Event initializer signature to provide
interactive: Bool = true (so new Event(...) yields interactive == true), or keep
the initializer as interactive: Bool? = nil and reword the doc comment above the
interactive property/initializer to state that the client omits the field by
default (nil) and Plausible's server will treat omitted/undefined as true for
bounce-rate calculations; update the doc near the "Whether the event affects
bounce rate" comment and the Event initializer parameter documentation
accordingly and ensure the symbol Event (initializer) and property interactive
are consistent.
In `@Sources/AviaryInsights/Plausible.swift`:
- Around line 143-154: The initializer `public
init(defaultDomain:userAgent:serverURL:configuration:)` documents
`configuration` as "Defaults to `nil`" but currently requires a non-optional
URLSessionTransport.Configuration; fix this by making the parameter optional
with a default of nil (change the signature to use `configuration:
URLSessionTransport.Configuration? = nil`) and update any uses inside the init
to handle the optional, or alternatively update the doc comment to remove the
"Defaults to `nil`" text if you intend to keep a required configuration; ensure
references to Self.defaultServerURL and URLSessionTransport.Configuration are
preserved.
- Around line 186-189: The Plausible.postEvent wrapper currently hardcodes only
the User-Agent header when calling client.post_sol_event, so add optional
parameters to Plausible.postEvent (e.g., xForwardedFor: String? and
xDebugRequest: String?) or a single optional headers struct, surface them in the
public API, and pass them into the generated client's headers initializer
alongside User_hyphen_Agent; update the Plausible.postEvent signature and call
to client.post_sol_event to include X-Forwarded-For and X-Debug-Request when
non-nil so callers can supply those new optional event headers.
In `@Tests/AviaryInsightsTests/AviaryInsightsTests.swift`:
- Line 60: The test currently iterates with for (event, request) in zip(events,
requests) which silently drops extras when lengths differ; before that loop (and
the similar loop around lines 85-86) assert that events.count == requests.count
(or use XCTAssertEqual) to ensure mismatched send counts fail the test, then
proceed with the zip-based iteration (identifying the variables events and
requests in the test function) so any dropped or extra requests are caught
explicitly.
---
Outside diff comments:
In `@openapi.yaml`:
- Around line 56-69: Event model currently accepts any URL length and any number
of props while the OpenAPI contract limits url to maxLength 2000 and props to
maxProperties 30; enforce these constraints in the Event model's
initializer/validation (e.g., in Event.init or Event.validate) by rejecting or
throwing when url.count > 2000 or props.count > 30, return/throw a descriptive
error matching API validation, and add/update unit tests to cover the new
validation; also consider regenerating the Swift client from openapi.yaml with
swift-openapi-generator to keep models in sync.
In `@Tests/AviaryInsightsTests/AviaryInsightsTests.swift`:
- Around line 61-72: The test currently decodes request.body into
Operations.post_sol_event.Input.Body.jsonPayload which normalizes away unknown
keys and null-vs-omitted differences; instead, canonicalize and compare the raw
JSON bytes. Replace the round-trip decode of request.body (the use of
decoder.decode into jsonPayload and creation of actualEncoded) with
canonicalization of the raw request.body bytes (e.g., parse to a JSON object and
re-serialize with a deterministic/canonical form) and compare that canonicalized
data to the canonicalized encoding of the expected
Operations.post_sol_event.Input.Body.jsonPayload; keep references to
request.body, Operations.post_sol_event.Input.Body.jsonPayload,
expectedJSONPayload, and the comparison (actual vs expected canonicalized bytes)
to locate and update the assertion.
---
Nitpick comments:
In @.devcontainer/swift-6.3/devcontainer.json:
- Around line 1-39: Summary: multiple devcontainer.json files for
swift-6.1/6.2/6.3 are diverging; extract common bits into a shared base to
reduce config drift. Fix: create a single base devcontainer template that
contains shared keys (features, runArgs, customizations.vscode.settings,
customizations.vscode.extensions, remoteUser) and update each variant (the files
containing "image": "swift:6.3" / "swift:6.2" / "swift:6.1") to reference or be
generated from that base while only overriding the "image" value and any
variant-specific settings; ensure unique symbols in the diff such as "features",
"runArgs", "customizations.vscode.settings", "extensions", and "remoteUser" are
moved to the base and removed from per-version files so future changes are made
once in the base.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 06d61742-ad5e-40b8-9065-79508f718634
⛔ Files ignored due to path filters (2)
Sources/AviaryInsights/Generated/Client.swiftis excluded by!**/generated/**Sources/AviaryInsights/Generated/Types.swiftis excluded by!**/generated/**
📒 Files selected for processing (26)
.devcontainer/devcontainer.json.devcontainer/swift-6.1/devcontainer.json.devcontainer/swift-6.2/devcontainer.json.devcontainer/swift-6.3/devcontainer.json.github/workflows/AviaryInsights.yml.mise.toml.swift-format.swiftformat.swiftlint.ymlCLAUDE.mdMintfilePackage.resolvedPackage.swiftScripts/generate.shScripts/gh-md-tocScripts/header.shScripts/lint.shSources/AviaryInsights/Event.swiftSources/AviaryInsights/Operations.swiftSources/AviaryInsights/Plausible.swiftTests/AviaryInsightsTests/AviaryInsightsTests.swiftTests/AviaryInsightsTests/Event.swiftTests/AviaryInsightsTests/MockTransport.swiftTests/AviaryInsightsTests/Revenue.swiftopenapi-generator-config.yamlopenapi.yaml
💤 Files with no reviewable changes (3)
- .swiftformat
- Scripts/gh-md-toc
- Mintfile
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.swiftlint.yml (1)
132-138: Consider documenting why each new rule is disabled.Disabling several style rules at once is fine, but brief inline rationale (per rule or grouped) will make lint policy intent clearer for contributors and reduce config drift.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.swiftlint.yml around lines 132 - 138, Add brief inline rationale comments for each disabled SwiftLint rule listed (switch_case_alignment, trailing_comma, strict_fileprivate, closure_parameter_position, opening_brace, optional_data_string_conversion, todo) so future contributors understand the intent; update the .swiftlint.yml by placing a short comment above or beside each rule explaining why it’s disabled (or group related rules and provide a grouped rationale), referencing the exact rule names so reviewers can see the tradeoffs and any temporary or long-term status.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.swiftlint.yml:
- Around line 132-138: Add brief inline rationale comments for each disabled
SwiftLint rule listed (switch_case_alignment, trailing_comma,
strict_fileprivate, closure_parameter_position, opening_brace,
optional_data_string_conversion, todo) so future contributors understand the
intent; update the .swiftlint.yml by placing a short comment above or beside
each rule explaining why it’s disabled (or group related rules and provide a
grouped rationale), referencing the exact rule names so reviewers can see the
tradeoffs and any temporary or long-term status.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e5eb48ba-4fb1-4f9f-a17f-10e6c87d3edf
📒 Files selected for processing (3)
.github/workflows/AviaryInsights.yml.swiftlint.ymlScripts/generate.sh
💤 Files with no reviewable changes (1)
- Scripts/generate.sh
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/AviaryInsights.yml
Added a step to install curl for Codecov when coverage is present.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/AviaryInsights.yml:
- Around line 20-22: The concurrency group can collide for PRs from different
forks using the same branch name; update the concurrency.group expression to use
the PR number when the event is a pull_request and fall back to the full ref for
other events—replace the current group value (${{ github.workflow }}-${{
github.head_ref || github.ref_name }}) with a conditional that includes
github.event.pull_request.number (e.g., use github.event.pull_request.number
when github.event_name == 'pull_request') and otherwise uses github.ref or
github.ref_name so each PR is globally unique while preserving uniqueness for
push/workflow_dispatch events.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5bfc9b1d-a830-44a5-875f-8401a7e018f7
📒 Files selected for processing (1)
.github/workflows/AviaryInsights.yml
…ostEvent Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
Scripts/lint.sh (1)
29-35:⚠️ Potential issue | 🟠 MajorCI still skips MIT header enforcement.
Line 29 keeps
header.shbehindif [ -z "$CI" ], so theCI=true LINT_MODE=STRICT ./Scripts/lint.shpath never validates headers. That leaves the compliance gap open in the exact mode the workflow now uses.Suggested adjustment
-if [ -z "$CI" ]; then - bash "$SCRIPT_DIR/header.sh" "$PACKAGE_DIR/Sources" - bash "$SCRIPT_DIR/header.sh" "$PACKAGE_DIR/Tests" +bash "$SCRIPT_DIR/header.sh" "$PACKAGE_DIR/Sources" +bash "$SCRIPT_DIR/header.sh" "$PACKAGE_DIR/Tests" + +if [ -z "$CI" ]; then mise exec -- swift-format format --in-place --recursive . mise exec -- swiftlint --fix mise exec -- periphery scan fi + +if [ -n "$CI" ]; then + git diff --exit-code -- Sources Tests +fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Scripts/lint.sh` around lines 29 - 35, The header enforcement is skipped when CI is set because the header.sh invocations are inside if [ -z "$CI" ]; move header.sh calls out of that CI-only guard or change the conditional to also run headers when LINT_MODE=STRICT (check the LINT_MODE env var) so that header.sh (invoked via SCRIPT_DIR/header.sh against PACKAGE_DIR/Sources and PACKAGE_DIR/Tests) executes in the CI=true LINT_MODE=STRICT path; update the conditional logic around the header.sh calls accordingly.
🧹 Nitpick comments (1)
Tests/AviaryInsightsTests/AviaryInsightsTests+Init.swift (1)
40-75: Consider extracting shared assertions to reduce repetition.The three tests duplicate the same
defaultDomain/userAgentexpectations; a tiny helper would keep these focused on constructor differences.Possible cleanup
extension AviaryInsightsTests { + private func expectClientValues(_ client: Plausible, domain: String, agent: String) { + `#expect`(client.defaultDomain == domain) + `#expect`(client.userAgent == agent) + } + `@Test` internal func initWithDefaultTransport() { let domain = UUID().uuidString let agent = UUID().uuidString let client = Plausible(defaultDomain: domain, userAgent: agent) - `#expect`(client.defaultDomain == domain) - `#expect`(client.userAgent == agent) + expectClientValues(client, domain: domain, agent: agent) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Tests/AviaryInsightsTests/AviaryInsightsTests`+Init.swift around lines 40 - 75, The three tests initWithDefaultTransport, initWithURLSessionConfiguration, and initWithURLSession duplicate the same assertions for Plausible.defaultDomain and Plausible.userAgent; extract a small helper like assertDefaultDomainAndUserAgent(client:defaultDomain:userAgent:) (or a test-scoped method) and call it from each test to assert client.defaultDomain == domain and client.userAgent == agent, leaving each test focused only on the constructor differences (keep the `#if` canImport(OpenAPIURLSession) guards intact).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Tests/AviaryInsightsTests/AviaryInsightsTests`+Init.swift:
- Around line 43-49: The tests currently call Issue.record(...) inside the `#else`
branch causing guaranteed failures when OpenAPIURLSession is unavailable; wrap
each entire `@Test` method with `#if` canImport(OpenAPIURLSession) ... `#endif` so the
test functions (the ones creating Plausible(defaultDomain:userAgent:) and
asserting client.defaultDomain / client.userAgent) are not registered on
unsupported platforms, and remove the internal `#else` Issue.record branches so no
test is recorded when the import check fails.
---
Duplicate comments:
In `@Scripts/lint.sh`:
- Around line 29-35: The header enforcement is skipped when CI is set because
the header.sh invocations are inside if [ -z "$CI" ]; move header.sh calls out
of that CI-only guard or change the conditional to also run headers when
LINT_MODE=STRICT (check the LINT_MODE env var) so that header.sh (invoked via
SCRIPT_DIR/header.sh against PACKAGE_DIR/Sources and PACKAGE_DIR/Tests) executes
in the CI=true LINT_MODE=STRICT path; update the conditional logic around the
header.sh calls accordingly.
---
Nitpick comments:
In `@Tests/AviaryInsightsTests/AviaryInsightsTests`+Init.swift:
- Around line 40-75: The three tests initWithDefaultTransport,
initWithURLSessionConfiguration, and initWithURLSession duplicate the same
assertions for Plausible.defaultDomain and Plausible.userAgent; extract a small
helper like assertDefaultDomainAndUserAgent(client:defaultDomain:userAgent:) (or
a test-scoped method) and call it from each test to assert client.defaultDomain
== domain and client.userAgent == agent, leaving each test focused only on the
constructor differences (keep the `#if` canImport(OpenAPIURLSession) guards
intact).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 29662608-f2be-4dd1-af8b-2061d2dc6b21
📒 Files selected for processing (5)
.mise.tomlScripts/lint.shTests/AviaryInsightsTests/AviaryInsightsTests+Init.swiftTests/AviaryInsightsTests/AviaryInsightsTests.swiftcodecov.yml
✅ Files skipped from review due to trivial changes (2)
- codecov.yml
- .mise.toml
🚧 Files skipped from review as they are similar to previous changes (1)
- Tests/AviaryInsightsTests/AviaryInsightsTests.swift
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…flow updates, and openapi.yaml improvements (#26)
…flow updates, and openapi.yaml improvements
Perform an AI-assisted review on
Summary by CodeRabbit
New Features
Breaking Changes
Improvements
Tests