Public: anyone can read this; the crew can change it.

/sitemap.xml gives each repository a lastmod from its last push, and a suspended account's repositories never appear #5724

Parked opened this
Closed without merging

/sitemap.xml now gives each pushed public repository a in YYYY-MM-DD form, and a repository that has never been pushed gets none. The new test, test/suspended-hidden.test.ts, test/sitemap-timing.test.ts and bun x tsc --noEmit all pass. Where the push time comes from: repositories have no push-time column.

Notes

stopped parked by the crew deploy 38ce17d

opened this

/sitemap.xml now gives each pushed public repository a <lastmod> in YYYY-MM-DD form, and a repository that has never been pushed gets none. The new test, test/suspended-hidden.test.ts, test/sitemap-timing.test.ts and bun x tsc --noEmit all pass.

  • Where the push time comes from: repositories have no push-time column. sitemapRepos takes it from the newest push event for each repository, read in one grouped query. It still goes through listReposVisibleTo(db, undefined, { withoutArchived: true }), so private, archived and suspended repositories stay out. It stays in the same Fresh holder and is still cleared by forgetListings, so no new invalidation was needed. It now returns { path, pushedAt } entries instead of strings.
  • llmsRepos: unchanged and still returns names only. In src/web/standards.ts only sitemapXml changed.
  • Tests: test/sitemap-lastmod.test.ts covers three cases: a pushed repository has a date-shaped lastmod, a never-pushed one has none, and after suspendAccount the next sitemap no longer lists the owner's repository. The suspension test calls only suspendAccount and not forgetListings, so it also checks that suspending clears the cache by itself.
  • Not done: I did not run each new test against the old code to confirm it fails there. The suspension test guards a behaviour that already worked, so it will not fail without this change.
  • Left out: lastmod uses only push events, so a repository created by an import or a mirror sync gets none until someone pushes to it.

Closes #5694

commented

/sitemap.xml now gives each pushed public repository a <lastmod> in YYYY-MM-DD form, and a repository that has never been pushed gets none. The new test, test/suspended-hidden.test.ts, test/sitemap-timing.test.ts and bun x tsc --noEmit all pass.

  • Where the push time comes from: repositories have no push-time column. sitemapRepos takes it from the newest push event for each repository, read in one grouped query. It still goes through listReposVisibleTo(db, undefined, { withoutArchived: true }), so private, archived and suspended repositories stay out. It stays in the same Fresh holder and is still cleared by forgetListings, so no new invalidation was needed. It now returns { path, pushedAt } entries instead of strings.
  • llmsRepos: unchanged and still returns names only. In src/web/standards.ts only sitemapXml changed.
  • Tests: test/sitemap-lastmod.test.ts covers three cases: a pushed repository has a date-shaped lastmod, a never-pushed one has none, and after suspendAccount the next sitemap no longer lists the owner's repository. The suspension test calls only suspendAccount and not forgetListings, so it also checks that suspending clears the cache by itself.
  • Not done: I did not run each new test against the old code to confirm it fails there. The suspension test guards a behaviour that already worked, so it will not fail without this change.
  • Left out: lastmod uses only push events, so a repository created by an import or a mirror sync gets none until someone pushes to it.
commented

Parked by the crew: the check failed ("RepoSource: one repository, two places to read it from > a mirror reports its stages in order and ends holding the repo") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs