Detect trashed and archived Deck entities, skip archived boards
Build package / xml-lint (push) Successful in 1m55s
Build package / unit-tests (push) Successful in 3m39s
Build package / php-lint (8.4) (push) Successful in 3m45s
Build package / php-lint (8.5) (push) Successful in 3m55s
Build package / package (push) Successful in 3m10s
Build package / xml-lint (push) Successful in 1m55s
Build package / unit-tests (push) Successful in 3m39s
Build package / php-lint (8.4) (push) Successful in 3m45s
Build package / php-lint (8.5) (push) Successful in 3m55s
Build package / package (push) Successful in 3m10s
Deck's Entity getters are magic (__call), so method_exists() never saw getDeletedAt() or getArchived(): trashed cards were moved, trashed boards were neither dropped from "my boards" nor detected by findStackIds(), and every board counted as not archived. DeckIntegrationService now checks the properties with property_exists() via isTrashed()/isArchived(). Workflows on archived boards stay enabled but are skipped by the runner (isBoardArchived(), read through BoardMapper) until the board is unarchived, and the settings list marks them. Archived boards are no longer offered in the board dropdown at all; editing a workflow on one clears board and stacks and says why.
This commit is contained in:
1 parent
9e1a15bab0
commit
4464e5ad3c
5 files changed
+109
-17
No files matched your search
@@ -229,6 +229,25 @@ class WorkflowRunner {
|
||||
return;
|
||||
}
|
||||
|
||||
// An archived board is intact, just shelved: the workflow is skipped,
|
||||
// not disabled, and resumes once the board is unarchived.
|
||||
try {
|
||||
$archived = $this->deckService->isBoardArchived($workflow->getBoardId());
|
||||
} catch (DeckUnavailableException $e) {
|
||||
$this->logger->warning('Could not check whether the board of workflow {id} is archived: ' . $e->getMessage(), [
|
||||
'app' => 'workflow_deck_automation',
|
||||
'id' => $workflow->getId(),
|
||||
]);
|
||||
return;
|
||||
}
|
||||
if ($archived) {
|
||||
$this->logger->debug('Skipping workflow {id}: its board is archived', [
|
||||
'app' => 'workflow_deck_automation',
|
||||
'id' => $workflow->getId(),
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$cards = $this->deckService->getActiveCardsInStack($workflow->getSourceStackId());
|
||||
} catch (DeckUnavailableException $e) {
|
||||
|
||||
Reference in new issue
Block a user