Skip to content

feat(import): quiet board import API for migration tools - #8673

Open
karlitschek wants to merge 4 commits into
mainfrom
feat/board-import-api
Open

karlitschek wants to merge 4 commits into
mainfrom
feat/board-import-api

Conversation

@karlitschek

@karlitschek karlitschek commented Nov 3, 2026 •

Copy link
Copy Markdown
Member
  • Resolves: #
  • Target version: main

Summary

Adds an internal PHP API, OCA\Deck\Import\IBoardImporter, and a deck_import_refs table, so migration tools can bring boards from other systems (for example task planners) into Deck:

  • create boards with labels, stacks and cards; manage assignments, attachments of existing files and board shares; list, stat and soft-delete cards;
  • original creation, start, due and done times are kept;
  • everything is keyed by the tool's own references, so imports can be repeated safely; cards changed in Deck meanwhile are reported, not overwritten;
  • writes go through the mappers, so no activity, notification, mention or Deck event is produced, while search, collaboration resources, share access, etags and the audit log stay correct;
  • attachments are shared after the card transaction, because a failed mount-cache insert aborts the surrounding transaction on PostgreSQL.

Tests: integration tests for idempotency and quietness (on SQLite, PostgreSQL and MySQL, with activity and notifications installed), and a canonical-form unit test.

This draft description was written with AI assistance (Claude Code) at the author's request; the author reviews it before the PR leaves draft.

TODO

  • Author's description and sign-off

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests (unit, integration, api and/or acceptance) are included
  • Documentation (manuals or wiki) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

This change was written with Claude Code (claude-opus-5-5) and is to be reviewed by the author before it leaves draft; every commit carries an Assisted-by trailer. Commits still need the author's sign-off (DCO).

🤖 Generated with Claude Code

@karlitschek
karlitschek force-pushed the feat/board-import-api branch from 8453354 to d2537b2 Compare November 3, 2026 12:03
@karlitschek
karlitschek marked this pull request as ready for review November 3, 2026 12:06
@karlitschek
karlitschek force-pushed the feat/board-import-api branch 3 times, most recently from f694833 to 78b25eb Compare November 3, 2026 19:45
karlitschek and others added 4 commits November 3, 2026 23:20
An importing app that runs again, or follows changes in its source,
must find the boards, stacks, labels, cards and shares it wrote before.
deck_import_refs maps the app's own reference (by its SHA-256) to the
Deck object, with the hash of what was last written, so later imports
can tell whether somebody changed the object in Deck since.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
occ deck:import creates a new board on every run and keeps no map from
source IDs, so a migration can't run again, follow changes or verify
what it wrote. IBoardImporter lets an app create boards with labels and
stacks, write cards with their original creation, start, due and done
times, assignments, labels and existing files as attachments, list,
stat and soft-delete them and manage the board's shares, all keyed by
its own references and safe to repeat.

It writes through the mappers, so no activity, notification, mention
or Deck event is created; full-text search, collaboration resources,
share access, etags and the audit log are kept right through Deck's
own listeners. Cards that were due before the import never announce
themselves as overdue. A card somebody changed in Deck answers
"changed" and keeps their version. Both sides hash a canonical form of
each card (CardCanonicalForm) to verify it.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
The quiet test imports and shares a plan with overdue, assigned and
attached cards, runs the due and description cron jobs and counts the
notification, activity, mail and comment tables, the activity and mail
managers and Deck's events; a second test shows the same probes see
Deck's normal services. The canonical form is pinned to hashes Go's
encoding/json produces.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Sharing a file runs the server's share and mount listeners, and one of
them recovers from a failed insert into the mount cache. On PostgreSQL
that failure aborts the surrounding transaction, so every card with an
attachment failed there. Cards, labels and assignments are now written
in one transaction and attachments after it; until they are written the
reference has no source hash, so a repeat completes the card instead of
reporting a conflict. Files are checked before anything is written, and
share and audit side effects run after commit as well.

A repeated ensureBoard no longer bumps the board's change time, and
board IDs beyond Deck's 32-bit IDs are not found instead of failing in
the database.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
@karlitschek
karlitschek force-pushed the feat/board-import-api branch from 78b25eb to d84e54d Compare November 3, 2026 22:20

This branch has not been deployed

No deployments
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