Skip to content

fix(sitemap): use repository updates for repositories lastmod - #5587

Closed
Utkarsh3725 wants to merge 1 commit into
OWASP:mainfrom
Utkarsh3725:fix-repositories-sitemap-lastmod
Closed

Utkarsh3725 wants to merge 1 commit into
OWASP:mainfrom
Utkarsh3725:fix-repositories-sitemap-lastmod

Conversation

@Utkarsh3725

Copy link
Copy Markdown

What

Fixes the /repositories static sitemap entry so its lastmod is based on the latest Repository.updated_at value.

Why

Closes #5259.

Previously /repositories was missing from the static sitemap model mapping, so it fell back to datetime.now(UTC) on every sitemap generation.

Testing

  • Added regression coverage for /repositories.
  • Ran python3 -m py_compile backend/src/apps/sitemap/views/static.py backend/tests/unit/apps/sitemap/views/static_test.py
  • Ran git diff --check

Could not run the focused pytest locally because Poetry is not installed in the environment.

@github-actions

Copy link
Copy Markdown

Contribution validation failed:

  • issue_assignee: The linked issue must be assigned to the PR author before this PR can be merged.

  • commit_signature: One or more commits are not signed.

  • commit_sign_off: One or more commits are missing or have an invalid Signed-off-by trailer.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 61e89770-beb7-41d4-ab0d-2008065be246

📥 Commits

Reviewing files that changed from the base of the PR and between 61d1a37 and ad43940.

📒 Files selected for processing (2)
  • backend/src/apps/sitemap/views/static.py
  • backend/tests/unit/apps/sitemap/views/static_test.py

Summary by CodeRabbit

  • Bug Fixes
    • Sitemap timestamps for the repositories page now reflect the latest repository update instead of the current time.
  • Tests
    • Added coverage to verify the repositories sitemap timestamp behavior.

Walkthrough

The static sitemap now derives /repositories lastmod from the latest Repository.updated_at value. A unit test verifies the repository aggregation and returned timestamp.

Changes

Repository sitemap timestamp

Layer / File(s) Summary
Map and validate repository lastmod
backend/src/apps/sitemap/views/static.py, backend/tests/unit/apps/sitemap/views/static_test.py
The /repositories route maps to Repository. The test verifies the aggregated latest timestamp is returned.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot closed this Sep 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repositories static sitemap lastmod always uses current time instead of latest repository update

1 participant