Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates how citation DOI validation behaves during project validation processing, and improves citation de-duplication when DOI is missing by introducing a normalized title_slug.
Changes:
- Skip DOI-required validation for citations when a project has a future
release_date. - Add
title_slugto citations and use it to match/update existing citations when DOI is missing. - Extend feature test coverage for both the future-release DOI skip behavior and title-slug duplicate prevention.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Feature/Project/PublishProjectTest.php | Adds/adjusts tests to cover DOI validation behavior for past vs. future release dates. |
| tests/Feature/ManageCitationsTest.php | Adds a test ensuring missing-DOI citations are de-duplicated by slugified title. |
| database/migrations/2026_04_01_060726_add_title_slug_to_citations_table.php | Adds title_slug, indexes it, and backfills existing rows. |
| app/Models/Validation.php | Updates citation DOI validation logic to skip DOI enforcement for future release dates. |
| app/Models/Citation.php | Allows mass assignment of title_slug. |
| app/Actions/Citation/SyncCitations.php | Computes/stores title_slug and uses it for missing-DOI matching. |
| @@ -73,7 +74,7 @@ private function findOrCreateCitation(Project $project, array $citationData): Ci | |||
| { | |||
| $doi = $this->normalizeDoi($citationData['doi'] ?? null); | |||
| $title = $this->normalizeText($citationData['title'] ?? null); | |||
There was a problem hiding this comment.
$title is normalized but never used in this method. This is dead code and makes it harder to follow the matching logic; remove the unused variable (or use it if it’s intended for a future match condition).
| $title = $this->normalizeText($citationData['title'] ?? null); |
database/migrations/2026_04_01_060726_add_title_slug_to_citations_table.php
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #1375 +/- ##
=================================================
+ Coverage 71.57% 71.59% +0.02%
- Complexity 2435 2438 +3
=================================================
Files 210 210
Lines 9371 9386 +15
=================================================
+ Hits 6707 6720 +13
- Misses 2664 2666 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.