Skip to content

Update fixRevProperty method#726

Merged
MaximPlusov merged 2 commits intointegrationfrom
fix-rev
Apr 2, 2026
Merged

Update fixRevProperty method#726
MaximPlusov merged 2 commits intointegrationfrom
fix-rev

Conversation

@LonelyMidoriya
Copy link
Copy Markdown
Contributor

@LonelyMidoriya LonelyMidoriya commented Mar 24, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Stricter revision-year validation: revision year is now checked against the expected year for each PDF profile and must match exactly.
    • Automatic correction: missing or incorrect revision-year properties are set to the profile-specific expected year and reported as added or updated fixes.

@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: 9f43e3eb-cd87-4903-9065-4c5200ab11cb

📥 Commits

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

📒 Files selected for processing (1)
  • metadata-fixer/src/main/java/org/verapdf/metadata/fixer/gf/impl/model/MetadataImpl.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • metadata-fixer/src/main/java/org/verapdf/metadata/fixer/gf/impl/model/MetadataImpl.java

📝 Walkthrough

Walkthrough

Unused regex-based constants were removed and a fixed year constant added. The fixRevProperty(...) method now computes a per-flavour expected revision year ("2024" for PDFUA_2, otherwise "2020"), validates by exact equality, and sets or adds the revision property with 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. fixRevProperty(...) now computes expectedRev per flavour ("2024" for PDFUA_2, else "2020"), uses exact-value comparison instead of regex, and adds/sets the revision property while producing contextual "Added property" or "Set property" messages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through constants, tidy and spry,
Swapped fuzzy regex for a clear-cut sky.
PDF flavours know which year to keep,
I add or set, no patterns to reap.
Metadata neat — a rabbit's small leap.

🚥 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 accurately identifies the main change: updates to the fixRevProperty method, which is the primary focus of the changeset.

✏️ 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.

@MaximPlusov MaximPlusov merged commit e24b45a into integration Apr 2, 2026
8 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 2, 2026
github-actions bot pushed a commit that referenced this pull request Apr 2, 2026
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