Skip to content

Add LocalDateValidator and year field ranges#186

Merged
alexander-yevsyukov merged 20 commits intomasterfrom
add-validators
Mar 11, 2026
Merged

Add LocalDateValidator and year field ranges#186
alexander-yevsyukov merged 20 commits intomasterfrom
add-validators

Conversation

@alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Mar 10, 2026

This PR migrates Time to latest version of Validation, which offers MessageValidators. LocalDateValidator was implemented to offer day of month validation regarding number of days per month, including support for February 29th in leap years.

Other notable changes

  • Proto definitions were updated to avoid unnecessary (validate) = true on the nested date/time fields. We assume valid instances provided to the outer message construction. There is no need to re-validate the fields.
  • Support of the runtime-calculated validation was removed because Validation no longer provides it.
  • The year fields in LocalDate and YearMonth types got min/max value offered by Java Time's Year class. We want our data types to be compatible with Java Time limits.

@alexander-yevsyukov alexander-yevsyukov self-assigned this Mar 10, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 378b90dd96

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

 * Use backticked functions.
 * Use `run` block for related assertions.
 * Document why we have `MONTH_UNDEFINED` in tests.
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.10%. Comparing base (7bdb643) to head (85b7916).
⚠️ Report is 21 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #186      +/-   ##
============================================
+ Coverage     89.43%   93.10%   +3.67%     
  Complexity      293      293              
============================================
  Files            55       53       -2     
  Lines           965      943      -22     
  Branches         25       26       +1     
============================================
+ Hits            863      878      +15     
+ Misses           94       56      -38     
- Partials          8        9       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexander-yevsyukov alexander-yevsyukov changed the title Add LocalDateValidator Add LocalDateValidator and year field ranges Mar 10, 2026
@alexander-yevsyukov alexander-yevsyukov merged commit b24a928 into master Mar 11, 2026
7 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the add-validators branch March 11, 2026 15:19
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