Repository navigation
Support reflecting more than one platform in a single run - #22
Merged
Merged
Conversation
Restructures spec/ into one subfolder per platform and adds a PLATFORMS environment variable: unset, behavior is unchanged (one `github` platform from the historical unprefixed variables); set, each named platform reads its own <PLATFORM>_-prefixed OpenAPI document/overlays/token/constants, falling back to built-in defaults for `github` and a new `google-calendar` platform (read-only: calendar-list entries and events). main.rs now syncs every configured platform into the same store, applying the GitHub OAuth fallback only to a platform actually named `github`. Clockify, also requested in the issue, needs syncables-rs to support apiKey-header credentials first (it only models Authorization: Bearer today) — documented in the README rather than added without working auth. Closes #15. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015uMtEr3myMSRyBMaSWP3k5
Merging origin/main (#21, which grouped every record under one Drive/ Document/Table per imported dataset) auto-merged cleanly but left Config::dataset_namespace() referencing a `constants` field that this branch had already moved onto each PlatformConfig, and a single AtomicStorage shared across all configured platforms — which would collide every platform's records into the same dataset instead of keeping each platform's own Drive. Moves dataset_namespace() onto PlatformConfig (derived from that platform's own constants) and builds one AtomicStorage per platform, sharing the same underlying Db, matching the one-AtomicStorage-per- dataset pattern #21 already established for a single run with multiple namespaces. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015uMtEr3myMSRyBMaSWP3k5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Works towards #15 ("Add a few more platforms"): reflector-rs can now reflect several read-only platforms in one run instead of just GitHub.
spec/restructured to one subfolder per platform:spec/github/(moved) and a newspec/google-calendar/, each with its own OpenAPI document andoverlays/{auth,pagination,crud-causality}.yaml.PLATFORMSenvironment variable. Unset, behavior is unchanged — onegithubplatform, configured exactly as before from the historical unprefixed variables (OPENAPI_DOCUMENT,API_TOKEN/GITHUB_TOKEN,API_CONSTANTS, …). Set to a comma-separated list (e.g.PLATFORMS=github,google-calendar), every named platform instead reads its own<PLATFORM>_-prefixed variables (GITHUB_API_TOKEN,GOOGLE_CALENDAR_API_TOKEN, …), with built-in defaults forgithubandgoogle-calendarand explicit configuration required for anything else.main.rsnow loops over the configured platforms, syncing each into the same store; the GitHub-specific interactive OAuth fallback applies only to a platform actually namedgithub. One platform failing (bad credential, network error) is logged and skipped rather than aborting the whole run; the process exits non-zero only if something failed.google-calendar. A narrowed, read-only OpenAPI document (calendar-list entries and events) plus overlays, adapted from the fuller documentlocalthought/reflectoralready vendors for the TypeScript engine — notably using a plainpageTokenpagination scheme rather than that engine'sincrementalSync, sincesyncables-rs's pagination extension only recognizespageNumber/pageToken/nextLink. Verified end-to-end against the real API (anonymous credentials, so the requests were rejected, but the document parsed and the resource model — calendar-list entries providing each event'scalendarIdcontext — walked correctly).x-api-keyheader (an OpenAPIapiKeyscheme), andsyncables::Credentialsinlocalthought/syncables-rsonly modelsAuthorization: Bearertoday. Documented as a concrete blocker in the README rather than adding it without working auth.Reflecting more than one platformsection, configuration table, vendored-documents section) and.env.exampleupdated to match, plus a session log underdocs/ai-logs/sessions/per this repo's AI-disclosure convention.Test plan
cargo fmt -- --checkcargo test(46 tests)cargo clippy --all-targets -- -D warningscargo buildcargo build --target wasm32-unknown-unknown --libcargo clippy --target wasm32-unknown-unknown --lib -- -D warningsgithub, unsetPLATFORMS) still syncs as before.PLATFORMS=google-calendar— document/overlays parse, resource model derives correctly, requests are constructed against the real Google Calendar API (anonymous credentials, so rejected with 401/403 as expected).🤖 Generated with Claude Code
https://claude.ai/code/session_015uMtEr3myMSRyBMaSWP3k5
Generated by Claude Code