Commit Graph
8 Commits
Author SHA1 Message Date
Patrick Niebeling ee72d6fcf9 Do not move cards that are in the trash
Deck's CardMapper::findAllByStack() filters on stack_id and archived only --
there is no deleted_at condition -- so getActiveCardsInStack() also returned
cards the user had deleted. They stay in the table until Deck's DeleteCron
purges them, which is long enough for an overdue one to get moved out of the
trash and back into a stack.
2026-08-13 15:36:39 +02:00
Patrick Niebeling 80371d48fb Never let a throwable escape the workflow run
Build package / php-lint (8.2) (push) Successful in 58s
Build package / php-lint (8.3) (push) Successful in 41s
Build package / php-lint (8.4) (push) Successful in 36s
Build package / xml-lint (push) Successful in 12s
Build package / unit-tests (push) Successful in 38s
Build package / package (push) Successful in 58s
Job::start() calls setLastRun() before run() and clears `reserved_at` only
afterwards through setExecutionTime(), which is not in a finally block. Any
uncaught throwable therefore leaves the job reserved, and JobList::getNext()
skips reserved jobs until the reservation is 12 hours stale -- so a single
failing workflow takes the whole app offline for half a day, while last_run
still shows the start of that failed attempt.

Wrap both loops so a failure is logged with its exception and the remaining
users and workflows still run.
2026-08-13 15:24:16 +02:00
Patrick Niebeling 68d88e952b Include the card description in the notification mail
Build package / php-lint (8.2) (push) Successful in 1m46s
Build package / php-lint (8.3) (push) Successful in 47s
Build package / php-lint (8.4) (push) Successful in 38s
Build package / xml-lint (push) Successful in 17s
Build package / unit-tests (push) Successful in 45s
Build package / package (push) Successful in 1m4s
The mail named the card and the workflow but not what the card is about,
which meant opening Deck to know whether the move mattered.

The description is escaped explicitly: addBodyText() only calls
htmlspecialchars() when it has to derive the plain-text part itself, and we
pass both parts to get line breaks in the HTML body -- so escaping user
input is on us. Long descriptions are cut at 2000 characters.

Deck stores the description as Markdown; it is sent unrendered rather than
pulling in a parser for one mail.
2026-08-13 15:01:53 +02:00
Patrick Niebeling b37a0db123 Make the background job time-sensitive so cron actually runs it
Build package / php-lint (8.2) (push) Successful in 48s
Build package / php-lint (8.3) (push) Successful in 45s
Build package / php-lint (8.4) (push) Successful in 47s
Build package / xml-lint (push) Successful in 13s
Build package / unit-tests (push) Successful in 43s
Build package / package (push) Canceled after 0s
The job was registered but never executed: `background-job:list` kept
showing last_run = 1970-01-01. It was marked TIME_INSENSITIVE, and
OC\Core\Service\CronService::runCli() reads `maintenance_window_start` and
calls jobList->getNext($onlyTimeSensitive = true) whenever the current UTC
hour is outside [start, start+4] -- so with a maintenance window configured,
time-insensitive jobs are skipped for the other 20 hours of the day.

A job whose entire purpose is a 5-minute (now configurable down to 60s)
reaction time is time-sensitive by definition.

Also fix the occ invocation in README.md and CLAUDE.md: background-job:worker
takes job classes, not an app id, so the documented
`background-job:worker workflow_deck_automation` matched nothing.
2026-08-13 14:48:13 +02:00
Patrick Niebeling 13903f8137 Hide inactive boards, keep source and target stack apart, make the interval configurable
Build package / php-lint (8.2) (push) Successful in 46s
Build package / php-lint (8.3) (push) Successful in 40s
Build package / php-lint (8.4) (push) Successful in 35s
Build package / xml-lint (push) Successful in 13s
Build package / unit-tests (push) Successful in 46s
Build package / package (push) Successful in 1m3s
- Boards: BoardService::getUserBoards() defaults to $includeArchived = true,
  and that flag also gates the `deleted_at = 0` condition, so archived and
  trashed boards showed up in the dropdown. Request the filtered query
  instead, with a fallback to the no-arg call if the signature ever changes.
  Stacks need nothing: StackMapper::findAll() always filters deleted_at.
- Each stack dropdown now hides whatever the other one holds, so source and
  target can no longer be set to the same stack. The save-time check stays
  as the backstop for rows stored before this rule.
- RunWorkflowsJob reads its interval from config.php
  ('workflow_deck_automation.interval', seconds, default 300, clamped to a
  60s minimum). TimedJob re-reads the interval on every cron pass, so a
  changed value takes effect without any occ command.
2026-08-13 14:33:28 +02:00
Patrick Niebeling 85b42d84c9 Fix unusable personal settings form: v8 Vue idioms and Deck relations
Build package / package (push) Successful in 50s
Lint info.xml / xml-lint (push) Successful in 20s
Lint PHP / php-lint (8.2) (push) Successful in 58s
Lint PHP / php-lint (8.3) (push) Successful in 57s
Lint PHP / php-lint (8.4) (push) Successful in 55s
PHPUnit / unit-tests (push) Successful in 1m7s
The settings page rendered, but nothing in it worked:

- All NcSelect dropdowns showed "undefined" for every option. In
  @nextcloud/vue 9 the `label` prop is vue-select's option display *key*,
  not a caption, so `label="Board"` read `option.Board`. Use `input-label`.
- Saving always failed with "Bitte einen Titel angeben". Vue 3 dropped
  `.sync`; NcTextField and NcCheckboxRadioSwitch bind via `modelValue`, so
  `:value.sync` / `:checked.sync` never wrote back. Use `v-model`.
- NcButton's style prop is now `variant`, `type` is the native button type
  and `native-type` is gone. `type="tertiary"` rendered
  `<button type="tertiary">`, which HTML falls back to `submit` for, making
  the cancel button submit the form.
- The user dropdown was always empty. Deck's RelationalEntity replaces
  resolved relations with a RelationalObject once an entity is enriched, so
  `$acl->getParticipant()` returns that wrapper and the uid lives in
  `getPrimaryKey()` -- probing for `getUID()` yielded null. This also broke
  the background job's assigned-user filter, which shares the extractor.
- A board's ACL never contains its owner (a private board has an empty
  ACL), so participants are now seeded with the owner, group ACL entries
  are expanded via IGroupManager and display names resolved via
  IUserManager.
- One board appeared twice: getUserBoards() merges own/group/circle boards
  and includes archived and trashed ones. Deduplicate by id and drop those.

Also keep one failing lookup in onBoardChange from taking the other two
dropdowns down with it, and document all of the above in CLAUDE.md.
2026-08-13 14:13:11 +02:00
Patrick Niebeling d2f6640d3d Fix blank personal settings page from mismatched bundle names
Build main artifact / package (push) Successful in 1m11s
Lint info.xml / xml-lint (push) Successful in 14s
Lint PHP / php-lint (8.2) (push) Successful in 48s
Lint PHP / php-lint (8.3) (push) Successful in 39s
Lint PHP / php-lint (8.4) (push) Successful in 34s
PHPUnit / unit-tests (push) Successful in 37s
@nextcloud/vite-config prefixes every entry name with the app id, so the
entry "workflow-deck-automation-personal-settings" was emitted as
js/workflow_deck_automation-workflow-deck-automation-personal-settings.mjs
while Util::addScript() was still asking for the unprefixed name. Nextcloud
found neither the script nor the style, so only the empty mount div rendered
and the settings page stayed blank.

Shorten the entry to "personal-settings" and pass the full on-disk basename
(APP_ID . '-personal-settings') to addScript()/addStyle(). Document the
prefix rule and the intentionally near-empty CSS entry stub in CLAUDE.md.
2026-08-13 13:38:38 +02:00
Patrick NiebelingandClaude Sonnet 5 300acde27e Add Deck workflow automation Nextcloud app
Lint info.xml / xml-lint (push) Successful in 30s
Lint PHP / php-lint (8.2) (push) Successful in 55s
Lint PHP / php-lint (8.3) (push) Successful in 44s
Lint PHP / php-lint (8.4) (push) Successful in 41s
PHPUnit / unit-tests (push) Failing after 41s
Ports the standalone due-date cron script into a proper Nextcloud 34
app with a personal-settings UI, per-user workflow configuration
(source/target stack, assigned-user and label filters, email
notification), a TimedJob background runner, and Gitea CI pipelines.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 10:13:05 +02:00