try android CI again#22
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR extends persistent model storage with serialization conversion methods, adds model lookup by ULID via ManagedObjectContext, tightens platform-specific key-storage branching for AppKit/UIKit, KeyringAccess, and unsupported platforms, and introduces Android test CI coverage. ChangesPersistent Model Storage & Retrieval
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Sources/Vein/Model/Protocols/PersistentModel.swift`:
- Around line 174-176: The init?(fromPersistent:) initializer must be added to
the PersistentModel protocol itself (not only in its extension) because the
current default implementation in the extension (returning nil) is statically
dispatched and shadows real conforming-type implementations; modify the
PersistentModel protocol to declare init?(fromPersistent:
PersistentRepresentation) as a requirement, remove the nil-returning default
implementation from the protocol extension, and ensure conforming types
implement their own init?(fromPersistent:) (update any conformances that relied
on the extension) so generic code constrained to PersistentModel will call the
concrete initializers.
In
`@Sources/Vein/ModelContext/ManagedObjectContext/ManagedObjectContext`+Relationship.swift:
- Line 8: The getModel implementation currently swallows fetch failures by using
`try?` on `self.fetchAll(PredicateBuilder<T>().addCheck(.isEqualTo, "id",
id)).first`; change the API to propagate errors: update `getModel` to be
`throws` (or return a throwing result) and replace `try?` with `try` so any
fetch error from `fetchAll` surfaces to the caller; keep using
`PredicateBuilder<T>().addCheck(.isEqualTo, "id", id)` and return the `.first`
result after the `try` so not-found remains `nil` but real errors are not
hidden.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bbca3f69-2b4d-4c33-929c-ea4e488d226d
📒 Files selected for processing (4)
.github/workflows/swift-test-android.ymlSources/Vein/Model/Protocols/PersistentModel.swiftSources/Vein/ModelContext/ManagedObjectContext/ManagedObjectContext+Relationship.swiftSources/Vein/ModelContext/ManagedObjectContext/ManagedObjectContext.swift
|
Android CI still doesn’t work. sadly. |
Overview
This PR adds Android CI/CD support and extends the persistence model layer with new methods for model retrieval and representation conversion.
Changes
GitHub Actions - Android Testing Workflow
Added a new GitHub Actions workflow (
swift-test-android.yml) that runs Swift package tests on Android. The workflow triggers on:Executes using the
skiptools/swift-android-action@v2with optimized disk space settings.PersistentModel Protocol Extensions
Added two new public APIs to the
PersistentModelextension:asPersistentRepresentation- Computed property that returns the model'sidas aPersistentRepresentationinit?(fromPersistent:)- Failable initializer for constructing models fromPersistentRepresentation(currently a stub returningnil)Model Context Relationship Fetching
Added
getModel(id:type:)method toManagedObjectContextthat retrieves models by ULID, checking an in-memory identity map first before performing a database fetch. This provides efficient model resolution with proper error handling.Platform-Specific Improvements
Improved platform-specific key-storage selection in
ManagedObjectContext.getKeyForDatabase(at:appID:)by:#elseif os(Linux))nilfor unsupported platforms instead of falling back to generic handlingThis tightened approach improves type safety and platform support clarity.
Highlights
The explicit platform-specific handling in the key-storage selection represents good defensive programming that makes platform requirements clearer and prevents unexpected fallback behavior.