Skip to content

Update citation doi validation#1375

Open
NishaSharma14 wants to merge 4 commits intodevelopmentfrom
update-citation-doi-validation
Open

Update citation doi validation#1375
NishaSharma14 wants to merge 4 commits intodevelopmentfrom
update-citation-doi-validation

Conversation

@NishaSharma14
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_slug to 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);
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$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).

Suggested change
$title = $this->normalizeText($citationData['title'] ?? null);

Copilot uses AI. Check for mistakes.
@NishaSharma14 NishaSharma14 self-assigned this Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.59%. Comparing base (607f2d4) to head (a03897a).
⚠️ Report is 1 commits behind head on development.

Files with missing lines Patch % Lines
app/Actions/Citation/SyncCitations.php 85.71% 2 Missing ⚠️
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     
Flag Coverage Δ
unittests 71.59% <92.30%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants