Skip to content

Add opt-in GitHub star list imports as nested Karakeep lists - #10

Open
AdamsGH wants to merge 2 commits into
sidoshi:mainfrom
AdamsGH:feat/github-star-lists
Open

AdamsGH wants to merge 2 commits into
sidoshi:mainfrom
AdamsGH:feat/github-star-lists

Conversation

@AdamsGH

@AdamsGH AdamsGH commented Oct 22, 2026

Copy link
Copy Markdown

Problem

GitHub stars are imported into one flat GitHub Starred list. GitHub star lists and their repository memberships are not fetched, so the grouping is lost. This also affects users whose stars are already imported: another flat sync does not populate any child lists.

Changes

  • Add KS_GITHUB_SYNCLISTS, disabled by default. When enabled, import the authenticated user's star lists as children of GitHub Starred, using their original names. Keep bookmarks directly in the parent list as well.
  • Track each source by its stable GraphQL list ID, stored in a karakeep-sync-source: github-list:<id> line in the child description. Preserve existing description text. Source renames update the same Karakeep child in place, without changing its ID or memberships or modifying GitHub.
  • Adopt an untracked same-named child under the parent on first import. Prefer source identity over names afterward, and do not adopt children linked to another source.
  • Paginate both GitHub lists and list items. Reject HTTP errors, GraphQL errors with partial data, and missing or repeated pagination cursors.
  • Run list imports even when the flat import stops after five existing bookmarks. Reuse bookmarks by URL and report failed Karakeep membership writes instead of treating an HTTP error as success.

Verification

  • cargo fmt --all -- --check
  • cargo test --locked --all-features --workspace: 22 tests passed. Coverage includes source renames, repeated imports, first-run adoption with preserved descriptions, source-identity collisions, pagination, existing-bookmark backfill, parent-scoped lookup, early cutoff, and API failures.
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo test --locked --doc --workspace
  • Built and ran the Docker image with the existing Rust 1.88 builder. Against Karakeep 0.34.1, verified 30 child lists and 765 memberships. All 818 pre-existing bookmark IDs and the original parent-list memberships were preserved, with no new duplicate GitHub bookmarks.

Limits

Imports are additive, not a full mirror. They do not remove memberships, delete destination lists, or modify GitHub. Only lists and repositories visible to the token can be imported, and the token must support the GraphQL queries. The source-ID metadata line in each child description must be retained for rename tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant