Add Sharkey (Misskey-family) interoperability smoke tests#659
Add Sharkey (Misskey-family) interoperability smoke tests#659sij411 wants to merge 1 commit intofedify-dev:mainfrom
Conversation
Adds interoperability smoke tests for Sharkey, a Misskey fork. Sharkey
requires HTTPS for all ActivityPub federation lookups (hard-coded in
checkHttps() and WebFingerService), so the setup uses Caddy TLS proxies
with self-signed certificates.
Key changes:
- New GitHub Actions workflow (smoke-sharkey) that boots a Sharkey
stack with Caddy TLS proxies, provisions users, and runs E2E
scenarios via the shared orchestrator
- Test harness backdoor now resolves recipients via WebFinger + actor
document fetch instead of hardcoding Mastodon URL patterns, with a
cache that is cleared on /_test/reset
- Orchestrator account lookup falls back through Mastodon-compat
search, lookup, and Misskey-native /api/users/show endpoints
- res.ok checks before JSON parsing in inbox poll helpers
- poll() catches transient errors from callbacks and retries until
timeout
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces smoke tests for Sharkey, including a Docker Compose environment with Caddy for TLS termination, provisioning scripts, and configuration files. The test harness has been updated to support WebFinger resolution with caching and improved account lookup logic that falls back to Sharkey-specific endpoints. Additionally, error handling was added to harness inbox fetches, and the unfollow test assertion order was refined. Feedback was provided regarding the lack of timeouts in the new fetch calls within the WebFinger resolution logic, which could cause tests to hang.
| try { | ||
| const wfUrl = `${scheme}://${domain}/.well-known/webfinger?resource=${ | ||
| encodeURIComponent(`acct:${handle}`) | ||
| }`; | ||
| const wfRes = await fetch(wfUrl, { | ||
| headers: { Accept: "application/jrd+json" }, | ||
| }); | ||
| if (wfRes.ok) { | ||
| const wf = await wfRes.json() as { | ||
| links?: { rel: string; type?: string; href?: string }[]; | ||
| }; | ||
| const self = wf.links?.find( | ||
| (l) => l.rel === "self" && l.type === "application/activity+json", | ||
| ); | ||
| if (self?.href) { | ||
| const actorId = new URL(self.href); | ||
| // Fetch the actor document to discover the inbox URL | ||
| const actorRes = await fetch(self.href, { | ||
| headers: { Accept: "application/activity+json" }, | ||
| }); | ||
| if (actorRes.ok) { | ||
| const actor = await actorRes.json() as { inbox?: string }; | ||
| if (actor.inbox) { | ||
| const result = { inboxId: new URL(actor.inbox), actorId }; | ||
| recipientCache.set(handle, result); | ||
| return result; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } catch { | ||
| // WebFinger failed; fall back to Mastodon convention | ||
| } |
There was a problem hiding this comment.
The fetch calls within this try block for WebFinger and actor document retrieval lack timeouts. If the remote server becomes unresponsive, these requests could hang, causing the test to time out with a generic error message. To make the test harness more robust, consider adding a timeout to these fetch calls using an AbortSignal.
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Background
Fedify currently has smoke tests for Mastodon, but lacks coverage for Misskey-family servers which use different API conventions and URL patterns. Sharkey is a popular Misskey fork that represents this server family well.
A key challenge is that Sharkey requires HTTPS for all ActivityPub federation lookups —
checkHttps()inApPersonServicerejectshttp://URIs outright, andWebFingerService.genUrl()hardcodeshttps://(see misskey-dev/misskey#10716). This means the test infrastructure needs TLS termination, unlike the plain HTTP setup used for Mastodon non-strict tests.Additionally, Sharkey's Mastodon-compatible API layer has gaps (e.g.
/api/v1/accounts/searchreturns 404 for remote users,/api/v1/accounts/lookupthrowsTypeError), so the orchestrator needs Misskey-native API fallbacks to work reliably.Related: #654
Summary
smoke-sharkey) that boots a Sharkey stack with Caddy TLS proxies and self-signed certificates, provisions users, and runs E2E scenarios via the shared orchestratorsharkey-web-backend) to avoid DNS collision with the TLS proxy aliases (sharkey,fedify-harness)/_test/reset/api/users/showendpointsres.okchecks before JSON parsing in inbox poll helpers🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com