Model ticket link counterparts explicitly #81

Merged
Twyco merged 5 commits from koda/ticket-link-counterparts-v2 into main 2026-05-24 10:20:02 +00:00
Contributor

Summary

  • add explicit counterpart labels for ticket link types
  • preserve stored link direction so the opposite ticket can show the counterpart label automatically
  • update metadata UI/resources/factories/tests for counterpart-aware link types

Verification

  • npm run build
  • php artisan test tests/Feature/Models/TicketLinkTypeTest.php tests/Feature/Models/TicketLinkTest.php tests/Feature/Projects/ProjectTicketLinkControllerTest.php tests/Feature/Projects/ProjectTicketMetadataSettingsControllerTest.php tests/Feature/Projects/ProjectTicketControllerTest.php tests/Feature/Api/TicketApiTest.php
## Summary - add explicit counterpart labels for ticket link types - preserve stored link direction so the opposite ticket can show the counterpart label automatically - update metadata UI/resources/factories/tests for counterpart-aware link types ## Verification - npm run build - php artisan test tests/Feature/Models/TicketLinkTypeTest.php tests/Feature/Models/TicketLinkTest.php tests/Feature/Projects/ProjectTicketLinkControllerTest.php tests/Feature/Projects/ProjectTicketMetadataSettingsControllerTest.php tests/Feature/Projects/ProjectTicketControllerTest.php tests/Feature/Api/TicketApiTest.php
Koda added 1 commit 2026-05-23 10:30:38 +00:00
Model ticket link counterparts explicitly
linter / quality (pull_request) Successful in 3m5s
tests / ci (8.4) (pull_request) Failing after 1m41s
486994e441
Koda added 1 commit 2026-05-23 10:44:12 +00:00
Show current status moves in board settings
linter / quality (pull_request) Successful in 1m28s
tests / ci (8.4) (pull_request) Failing after 1m37s
764468d938
Koda added 1 commit 2026-05-23 10:44:55 +00:00
Update metadata settings API test for counterpart labels
tests / ci (8.4) (pull_request) Successful in 1m39s
linter / quality (pull_request) Successful in 1m23s
f6f9d7b066
Koda reviewed 2026-05-24 09:52:52 +00:00
Koda left a comment
Author
Contributor

Verdict: REQUEST_CHANGES

Short summary:
The directional counterpart labeling works nicely end-to-end, but the new storage strategy removes the old canonical uniqueness guarantee for ticket pairs.

Findings:

  • Blocker: none
  • Should fix: concurrent link creation from opposite ticket pages can now persist duplicate logical links as both (source=A,target=B) and (source=B,target=A).
  • Nit/Optional: none

Risk notes:

  • I did not flag legacy-data/backfill concerns because you confirmed KanbanGit is not production deployed yet.
  • The main risk here is correctness under concurrent writes.

Suggested follow-ups/tests:

  • Add a regression test around relinking/reorienting an existing reverse-direction link, and keep a lock/canonical uniqueness guard around the create path.
Verdict: REQUEST_CHANGES Short summary: The directional counterpart labeling works nicely end-to-end, but the new storage strategy removes the old canonical uniqueness guarantee for ticket pairs. Findings: - Blocker: none - Should fix: concurrent link creation from opposite ticket pages can now persist duplicate logical links as both `(source=A,target=B)` and `(source=B,target=A)`. - Nit/Optional: none Risk notes: - I did not flag legacy-data/backfill concerns because you confirmed KanbanGit is not production deployed yet. - The main risk here is correctness under concurrent writes. Suggested follow-ups/tests: - Add a regression test around relinking/reorienting an existing reverse-direction link, and keep a lock/canonical uniqueness guard around the create path.
Author
Contributor

Should fix: dropping the canonical ticket-pair key here also drops the database-level protection against duplicates for the same two tickets. Two users can now create the same link concurrently from opposite ticket pages and end up with both (A,B) and (B,A) rows, because the lookup runs before either insert commits and the unique index only covers the ordered pair. Please serialize on the ticket pair before the lookup/create path (or add an equivalent canonical uniqueness guarantee) so one logical link cannot be created twice.

Should fix: dropping the canonical ticket-pair key here also drops the database-level protection against duplicates for the same two tickets. Two users can now create the same link concurrently from opposite ticket pages and end up with both `(A,B)` and `(B,A)` rows, because the lookup runs before either insert commits and the unique index only covers the ordered pair. Please serialize on the ticket pair before the lookup/create path (or add an equivalent canonical uniqueness guarantee) so one logical link cannot be created twice.
Author
Contributor

Here is the improvements PR: OpenSource/KanbanGit#82

Here is the improvements PR: https://git.twyco.de/OpenSource/KanbanGit/pulls/82
Twyco added 2 commits 2026-05-24 10:01:21 +00:00
Twyco approved these changes 2026-05-24 10:19:57 +00:00
Twyco merged commit ffe5939628 into main 2026-05-24 10:20:02 +00:00
Twyco deleted branch koda/ticket-link-counterparts-v2 2026-05-24 10:20:02 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: PetschStudios/KanbanGit#81