Skip to content

[codex] fix Outrank import dates#699

Merged
riderx merged 1 commit into
mainfrom
codex/fix-outrank-import-dates
May 16, 2026
Merged

[codex] fix Outrank import dates#699
riderx merged 1 commit into
mainfrom
codex/fix-outrank-import-dates

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented May 14, 2026

Summary

  • keep imported Outrank frontmatter dates as Date values so gray-matter writes YAML timestamps
  • preserve fallback handling for invalid or missing article timestamps

Root cause

The importer converted dates to ISO strings before serializing frontmatter. gray-matter wrote those values as quoted YAML strings, but the Astro blog schema expects date values.

Validation

  • generated a test Outrank article and confirmed created_at / updated_at are unquoted YAML timestamps
  • bunx prettier --write scripts/blogs/import_outrank.ts
  • bun run ci:verify:web

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of timestamp handling in blog import process, ensuring accurate article dates.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aa65f5a9-65c0-4476-8a00-13bba5fb6c72

📥 Commits

Reviewing files that changed from the base of the PR and between de9ea90 and e9a7370.

📒 Files selected for processing (1)
  • scripts/blogs/import_outrank.ts

📝 Walkthrough

Walkthrough

The PR refactors timestamp handling in the blog import script from ISO date strings to Date objects. A new toDate() helper safely converts optional timestamp strings with fallback support. The writeArticle() function signature, frontmatter generation, and main entry point are updated to work with Date instances throughout.

Changes

Timestamp type migration

Layer / File(s) Summary
Date helper function
scripts/blogs/import_outrank.ts
Introduces toDate() utility that converts optional timestamp strings to Date instances with fallback support when inputs are missing or invalid.
Function signature update
scripts/blogs/import_outrank.ts
Updates writeArticle() to accept payloadTimestamp as a Date type instead of a string, establishing the new type contract.
Frontmatter generation with Date objects
scripts/blogs/import_outrank.ts
Changes created_at and updated_at frontmatter fields to derive from Date objects using the new toDate() helper, replacing ISO-string-based logic.
Main entry point timestamp handling
scripts/blogs/import_outrank.ts
Updates main() to compute payloadTimestamp using toDate(payload.timestamp, new Date()) instead of ISO-string conversion, completing the timestamp type migration.

🎯 2 (Simple) | ⏱️ ~10 minutes

A timestamp tale of types so true, 🐰
From strings to Date, a cleaner view,
With fallbacks when dates are few,
The helper transforms front to through!

✨ 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 codex/fix-outrank-import-dates

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

@riderx riderx marked this pull request as ready for review May 16, 2026 16:10
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@riderx riderx merged commit 7f33a47 into main May 16, 2026
9 checks passed
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