Repository navigation
Preview: Replace instance exports with synthetic fixtures - #68
Merged
Merged
Conversation
The preview's fixtures were exports from a real Forgejo instance mixed with hand-made additions. The exported repositories were also unusable in a fresh clone: Git does not keep their empty refs directories, so the seeder silently pushed this repository's own history instead. Fixtures are now invented and declared under dev/fixtures: owner.json for users and the organization, and one folder per repository holding its description, history, commit files and workflow runs. The seeder builds each history as real commits and creates issues, pull requests, releases and packages through the API. What the API cannot create is written to the database from the same declarations: past timestamps, the activity feed, finished workflow runs with logs, and their commit statuses. Those rows are checked against the live schema, so a Forgejo upgrade that changes a column fails by naming it. Times are relative to the day of seeding. The preview user is now alex, and dev:forgejo:reset empties the volume for a fresh seed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The local preview's fixtures were exports from a real Forgejo instance mixed with hand-made additions. This replaces them with invented data declared in one consistent format.
Why
alex,samandacmeand contain nothing from a real instance. Earlier commits are left as they are; history is not rewritten.refs/directories, so they were not valid repositories andgit push --mirrorfell back to pushing this repository's own history into both fixture repositories.What the preview has now
acme/webappalex/notesalex/notesstays small on purpose so empty states can be checked.samis a second user and a member of anacmeteam.How it works
dev/fixtures/owner.jsondeclares users, the organization and teams. Each folder underdev/fixtures/repository/holds one repository:repository.json,history.json, the files of each commit, and workflow runs with their logs.daysAgo, resolved at seeding, so the feed and contribution heatmap always look recent.bun dev:forgejo:resetempties the volume for a fresh seed.dev/fixtures/README.mddocuments the format. The preview's default login changes fromwhereareiamtoalex.Checks
bun commitpasses (402 tests). New tests cover the fixture clock, the log parser and line-offset encoding, and the consistency of the checked-in fixtures (every commit has files, every referenced user, label, milestone, branch and commit exists).Known limits: the merge commit of the merged pull request is created at seed time, and the Actions sidebar marks both workflows with Forgejo's "no matching runner" warning because the preview has no runner.
🤖 Generated with Claude Code