Repository navigation
feat(forge): never reuse a migrated repository's pull request numbers - #335
Merged
Merged
Conversation
sc-forge admin repo set-pull-floor sets a per-repository floor (schema migration 6); both pull-number allocation paths take the larger of the floor and the highest existing number, plus one. A repository migrated from Gitea then never gives out an old number again, so a stored .../pulls/N answers 404 instead of naming an unrelated pull request (Codento Engine ADR-0080, COD2-7135). Also gives each pulls unit test its own temp directory (two tests in one second shared one).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
tonibergholm
approved these changes
Nov 9, 2026
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.
Codento Engine is moving its Project repositories from Gitea to sc-forge (Engine ADR-0080, COD2-7135). sc-forge numbers pull requests from 1 in each repository. Engine still holds
.../pulls/Nreferences to old Gitea pull requests, so after the move those numbers would point at new, unrelated pull requests.This adds a per-repository floor on pull-request numbers:
sc-forge admin repo set-pull-floor --owner --name --floor --data-dirsets it, and works while the server runs. The floor only rises.pulls::next_numberandpulls::insert) number the next pull request one above the larger of the floor and the highest existing number.repos.pull_floor. A binary older than this one refuses a data directory this one has opened.docs/FORGE-OPERATIONS.mddocuments the command for migrations.Proof:
/pulls/1answers 404.cargo test -p scl-forgepasses all 323 tests, and fmt and clippy (-D warnings) are clean.Not covered: a floor change between choosing a pull request's number and inserting it could leave a stray retention ref until the next sync. Engine sets floors during its write freeze, before any pull request can be created.
Reviewed with sol-loop: 3 rounds with gpt-6.1-sol on high. Sol verdict: approved
Created with Claude Opus 5.5 in T3 Code (Claude Code harness).