added search and delete + attempt CI#2
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ 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 adds search and delete operations to the SecretService API. It introduces helper utilities for data conversion, message decoding methods for parsing DBus responses, two new public methods ( ChangesSearch and Delete Operations for SecretService
Sequence Diagram(s)sequenceDiagram
participant Test
participant SecretService
participant DBus
participant Keyring as GNOME Keyring
Test->>SecretService: searchItems(attributes, collection)
SecretService->>DBus: SearchItems method call
DBus->>Keyring: search for items
Keyring-->>DBus: object paths
DBus-->>SecretService: method return [paths]
SecretService->>SecretService: decodeSearchItems()
SecretService-->>Test: [String] paths
sequenceDiagram
participant Test
participant SecretService
participant DBus
participant Keyring as GNOME Keyring
Test->>SecretService: deleteItem(item)
SecretService->>DBus: Delete method call
DBus->>Keyring: delete item
Keyring-->>DBus: prompt path or "/"
DBus-->>SecretService: method return
SecretService->>SecretService: decodeDeleteItem()
SecretService-->>Test: String? prompt
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 4
🤖 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 @.github/workflows/test.yml:
- Line 9: The workflow's runs-on label uses a Blacksmith-specific runner
(`runs-on: blacksmith-4vcpu-ubuntu-2404-arm`) which GitHub Actions can't
resolve; either replace that label with a standard GitHub-hosted runner (e.g.,
`runs-on: ubuntu-24.04` or `runs-on: ubuntu-latest`) so the job will be queued,
or if you intentionally need the Blacksmith runner keep the existing `runs-on`
value and add an `actionlint.yaml` suppression for the false-positive so
validators know the custom runner is expected.
In `@Sources/SecretService/Helper/MessageDecoding.swift`:
- Around line 92-104: The unexpected-response error in decodeDeleteItem()
currently reports the wrong operation name ("SearchItems"); update the thrown
.unexpectedResponse(...) call inside decodeDeleteItem to use the correct
operation identifier (e.g. "DeleteItem" or the canonical name used elsewhere for
delete replies) so the error message matches the function decodeDeleteItem() and
aids accurate debugging of delete responses (look for decodeDeleteItem(),
.unexpectedResponse(for: ...) and the surrounding messageType/body handling).
In `@Sources/SecretService/SecretService.swift`:
- Line 142: The bindings in searchItems and deleteItem call getSession() and
bind session even though it's unused, causing a compiler warning; replace the
explicit binding with an explicit discard of the return value (or remove the
call entirely if you decide the session precondition is unnecessary) so the call
still enforces connect() but does not bind an unused variable—update the
occurrences in the searchItems and deleteItem methods where getSession() is
called (affecting the current check before Collection.SearchItems and
Item.Delete DBus calls).
In
`@Tests/swift-secret-serviceTests/IntegrationTests/swift_secret_serviceTests.swift`:
- Around line 98-100: The loop creates an unused binding `prompt` from `try
await service.deleteItem(item: item)` which triggers a compiler warning; replace
the unused binding with an explicit discard by changing the call to `_ = try
await service.deleteItem(item: item)` (locate the loop over `items` in
swift_secret_serviceTests.swift and the call to `service.deleteItem`) so the
result is intentionally ignored.
🪄 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: e10ee0d1-1aa6-495e-8afa-d399b04a9664
📒 Files selected for processing (6)
.github/workflows/test.ymlSources/SecretService/Helper/Array.swiftSources/SecretService/Helper/Dictionary.swiftSources/SecretService/Helper/MessageDecoding.swiftSources/SecretService/SecretService.swiftTests/swift-secret-serviceTests/IntegrationTests/swift_secret_serviceTests.swift
Summary
This PR adds search and delete functionality to the Swift Secret Service library, along with a complete CI/CD integration test setup.
Core Features Added
Search Functionality (
searchItems(for:in:))decodeSearchItems()to parse DBus responsesDelete Functionality (
deleteItem(item:))nilif no prompt is required)decodeDeleteItem()to parse DBus responsesSupporting Changes
Helper Extensions
asObjectPathArrayproperty toArray<DBusValue>for converting to object pathsasStringToStringdictionary converter for string-to-string DBus value mappingIntegration Testing
test.yml) that sets up D-Bus and GNOME Keyring for running integration testsCode Quality
The implementation demonstrates excellent consistency with the existing codebase:
throws(SecSError)patternThe integration test teardown elegantly leverages the new functionality to validate both search and delete operations work correctly while cleaning up test artifacts.