Repository navigation
Conversation
… file in blog post date
… and to not show the wrong date to blog by its own
Signed-off-by: Sameer Chore <sameerchore5@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit details
WalkthroughThe blog data generator parses each post date once before building the post object. Invalid or missing dates now cause an error that identifies the Markdown file and supplied value. Valid dates are stored as ISO strings. Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 18bd59e9-472c-4ce6-8c08-c722f3431188
📒 Files selected for processing (2)
scripts/data/blog.mjstests/data/blog.test.mjs
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.
|
Rather than this, can't we just edit the blog posts to have the right dates? |
yes true I thought on this ,that dev should write valid blog dates. I just added validation as fallback bcoz invalid dates and incorrect format previously allowed the build to succeed with incorrect data.Now It provides an early, clear error, as I pasted img of before after in decription , If this not still needed I'll work to other area by closing this... |
|
This just seems awfully complex for something that (should be, if it were to exist) fairly simple |
|
Understood. , if I find any other optimal way I will continue with this ...otherwise avoids adding unnecessary build logic and will close pr , thanks for the feedback. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3882d858-3d2c-49b9-b01f-a8cbb7c6f9ce
📒 Files selected for processing (2)
scripts/data/blog.mjstests/data/blog.test.mjs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
57a3cda to
d72f4b5
Compare
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
0f425244-ccb6-4906-aee6-00d47d601b33
Files selected for processing: 1-
scripts/data/blog.mjs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
-
|
Thanks for the feedback @avivkeller @moshams272 . I've cut this down to a single check in scripts/data/blog.mjs and removed the tests. Before: a missing or malformed date crashed the build with RangeError: Invalid time value, without naming the post. Empty or non-date values (date:, 0, true) were silently written as 1970-01-01. Existing posts build with identical output. Impossible dates like 2026-02-30 are still out of scope, since the YAML parser rolls them over before this code runs. If you'd rather not have this check, I'm happy to close the PR. |
fixes: #279
Summary
Fix blog date validation during documentation builds.
JavaScript can normalize invalid dates such as
2026-02-30(30 days in feb is incorrect date) into a different valid date instead of rejecting them. This could allow incorrect blog metadata to pass through the build.This change validates the calendar date and time components before generating blog data. Invalid values now fail with an error that includes the affected file and date value.
What kind of change does this PR introduce?
Bug fix and test improvement.
Did you add tests for your changes?
Yes. Tests cover:
2026-02-30Does this PR introduce a breaking change?
No. Valid blog dates continue to work as before. Dates that were previously accepted and normalized incorrectly are now rejected during the build.
Before
After
Invalid dates are rejected with a clear validation error identifying the file and value.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
No documentation required.
Use of AI
AI was used during investigation and implementation review. The changes and test results were reviewed locally.
Summary by CodeRabbit