Skip to content

update the last updated pill and automate the process - #78

Merged
Asifdotexe merged 1 commit into
mainfrom
fix-data-and-action-flow
Aug 1, 2026
Merged

update the last updated pill and automate the process#78
Asifdotexe merged 1 commit into
mainfrom
fix-data-and-action-flow

Conversation

@Asifdotexe

@Asifdotexe Asifdotexe commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Chores
    • Added automatic updates for the site’s “Last Updated” date.
    • Synchronized the displayed timestamp and structured metadata whenever the index page is refreshed.

@Asifdotexe Asifdotexe self-assigned this Jul 26, 2026
@Asifdotexe Asifdotexe added the enhancement New feature or request label Jul 26, 2026
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a date-update script for index.html, wires it into pre-commit, and updates JSON-LD metadata plus the visible “Last Updated” timestamp to July 26, 2026.

Changes

Index date updates

Layer / File(s) Summary
Date update script
scripts/update_index_date.py
Computes the current date and updates matching JSON-LD and <time> date values in index.html.
Pre-commit integration and index timestamps
.pre-commit-config.yaml, index.html
Runs the script through a local pre-commit hook and records the updated structured-data and visible timestamps.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the visible last-updated badge update and the new automation to keep it in sync.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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-data-and-action-flow

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/update_index_date.py`:
- Around line 6-8: Update the script’s index-path handling and replacement flow:
resolve index.html relative to the script/repository rather than the current
working directory, and make a missing file fail loudly instead of returning
successfully. Capture the replacement counts from both re.subn calls and
validate that each expected regex matched; raise or otherwise exit with an error
when either count is zero, while preserving successful writes when both
replacements occur.
- Around line 13-15: Update the date initialization in the index-date update
flow to use the UTC timezone explicitly instead of the local-timezone-dependent
datetime.datetime.now(). Keep the existing iso_date and human_date formatting
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: abc8306e-30f7-4a46-83df-77112fead07e

📥 Commits

Reviewing files that changed from the base of the PR and between d8e015b and 7d0cd46.

📒 Files selected for processing (3)
  • .pre-commit-config.yaml
  • index.html
  • scripts/update_index_date.py

Comment on lines +6 to +8
index_path = Path("index.html")
if not index_path.exists():
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Fail loudly when the update did not occur.

A missing index.html or a formatting change that prevents either regex from matching currently exits successfully, allowing stale SEO metadata and visible timestamps to be committed. Resolve the repository path relative to the script/repository and validate re.subn() replacement counts before returning.

Also applies to: 18-25

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/update_index_date.py` around lines 6 - 8, Update the script’s
index-path handling and replacement flow: resolve index.html relative to the
script/repository rather than the current working directory, and make a missing
file fail loudly instead of returning successfully. Capture the replacement
counts from both re.subn calls and validate that each expected regex matched;
raise or otherwise exit with an error when either count is zero, while
preserving successful writes when both replacements occur.

Comment on lines +13 to +15
now = datetime.datetime.now()
iso_date = now.strftime("%Y-%m-%d")
human_date = now.strftime("%B %d, %Y").replace(" 0", " ") # Format like 'July 26, 2026'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Repository files matching update_index_date.py:\n'
fd -a 'update_index_date.py' . || true

printf '\nRelevant file contents:\n'
if [ -f scripts/update_index_date.py ]; then
  cat -n scripts/update_index_date.py
fi

printf '\nSearch for update script date usages/requirements:\n'
rg -n "update_index_date|last\\s+updated|generated|datetime\\.now|timezone|tzinfo" -S . || true

Repository: Asifdotexe/Theseus

Length of output: 50375


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Candidate files:\n'
fd -e py -e html 'update_index_date|index\.html' . || true

printf '\nDirect file contents:\n'
if [ -f scripts/update_index_date.py ]; then
  cat -n scripts/update_index_date.py
fi

printf '\nDirect focused searches:\n'
rg -n --max-count 200 "update_index_date|last\\s+updated|updated on|datetime\\.now\\(|datetime\\.(utcfromtimestamp|utcnow)|timezone|tzinfo|strftime\\(\"%Y-%m-%d%b|%B %d" . || true

Repository: Asifdotexe/Theseus

Length of output: 2745


Use UTC when updating the index date.

datetime.datetime.now() depends on the contributor’s local timezone, so the same commit run near midnight can update index.html to different dates in different timezones. Use datetime.now(datetime.UTC) or another explicit canonical timezone.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/update_index_date.py` around lines 13 - 15, Update the date
initialization in the index-date update flow to use the UTC timezone explicitly
instead of the local-timezone-dependent datetime.datetime.now(). Keep the
existing iso_date and human_date formatting unchanged.

@Asifdotexe
Asifdotexe merged commit a5181b3 into main Aug 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant