Skip to content

Update fixRevProperty method#726

Open
LonelyMidoriya wants to merge 1 commit intointegrationfrom
fix-rev
Open

Update fixRevProperty method#726
LonelyMidoriya wants to merge 1 commit intointegrationfrom
fix-rev

Conversation

@LonelyMidoriya
Copy link
Copy Markdown
Contributor

@LonelyMidoriya LonelyMidoriya commented Mar 24, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced metadata revision year validation with stricter accuracy checks for improved PDF compliance.
    • Improved revision property handling to correctly identify and fix missing or incorrect values based on PDF file type requirements.

@LonelyMidoriya LonelyMidoriya self-assigned this Mar 24, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 068fb9b9-8c9d-4fec-9860-2f05f69f89f1

📥 Commits

Reviewing files that changed from the base of the PR and between dc95769 and 3561e4a.

📒 Files selected for processing (1)
  • metadata-fixer/src/main/java/org/verapdf/metadata/fixer/gf/impl/model/MetadataImpl.java

📝 Walkthrough

Walkthrough

The revision property validation and fixing logic in the metadata fixer has been refactored. Unused regex-based constants were removed, and the method now computes a per-flavour expected revision year ("2024" for PDFUA_2, otherwise "2020"), replacing revision validation with exact-value comparison and generating contextual fix messages.

Changes

Cohort / File(s) Summary
Revision Year Validation Refactor
metadata-fixer/src/main/java/org/verapdf/metadata/fixer/gf/impl/model/MetadataImpl.java
Removed unused year-correction constants and introduced YEAR_2024 constant. Updated fixRevProperty(...) to compute per-flavour expectedRev values and changed validation from regex pattern matching to exact-value comparison. Modified fix behavior to dynamically generate "Added property" or "Set property" messages based on whether the revision property is missing or differs from expected value.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A year made true, a fix refined—
No regex patterns cluttering the mind,
Each flavour knows what it should be,
Twenty-twenty-four or two-zero, you see!
Validation precise, messages dance,
Metadata mended by strategy's glance. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the main change in the pull request, which is updating the fixRevProperty method's logic and behavior for handling revision properties.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-rev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant