Skip to content

[accordwimsy] Releases, and a repository made again by the Forgejo's migration with GitHub's authors - #50

Merged
DraChimeraVee merged 2 commits into
mainfrom
dravee/accordwimsy/releases
Nov 10, 2026
Merged

DraChimeraVee merged 2 commits into
mainfrom
dravee/accordwimsy/releases

Conversation

@DraChimeraVee

Copy link
Copy Markdown
Contributor

Phase 1 of the GitHub to git.scarletnx.dev bridge: the releases come over, and a repository can be made again by the Forgejo's own migration, the one way its issues, pull requests and comments carry their GitHub authors. Phase 2, the way back, is separate.

Releases (ACCORDWIMSY_RELEASES)

  • Rules. Space-separated repository:tag pattern[:newest], at most 16. A word that is no rule stops the program, and the error names the word. Production will set nightly:nightly-*:3 edenprobe:*.
  • Empty (the default). Same as today: no release comes, and the Releases tab stays off.
  • What a release brings. Each picked release is made with GitHub's name, pre-release mark and text, under a header line naming its tag, author and day.
  • Files. Fetched one at a time into release.part and checked against GitHub's size and SHA-256 (digest) before sending:
    • A mismatch is not sent and is reported on stderr.
    • A file GitHub replaced is sent again; one it removed is deleted here.
    • The SHA-256 comes from OpenSSL's libcrypto, which FreeBSD has in base; CI gets libssl-dev.
  • Removal.
    • A release the rules no longer pick (the 4th nightly) is deleted, but only once every picked release is here: none failed, none still waiting for its tag after this pass's fetch.
    • A release GitHub deleted waits out ACCORDWIMSY_GRACE_DAYS, as a branch does.
    • A lost state.json takes the releases back by tag and the files back by size, with nothing fetched again.

accordwimsy migrate REPOSITORY and accordwimsy adopt REPOSITORY

migrate:

  • moves this program's copy aside as <name>-bot-<stamp>, archived and private;
  • runs POST /repos/migrate with GITHUB_TOKEN (issues, PRs, comments, labels and milestones; no releases, no wiki);
  • then adopts the result.

A repository that a migration already made is refused.

adopt rebuilds the repository's state.json entry from the migration's copy:

  • Numbers. Every number up to the copy's last now belongs to the migration. From then on, edits keep GitHub's text alone, with no bot header, since the Forgejo shows the GitHub author itself.
  • updated_at. GitHub's value for each issue, so the next pass reads everything once and writes only what changed.
  • Each PR's branch here (read from Forgejo v17's updateGitForPullRequest):
    • a branch of GitHub's own: left to the mirror;
    • a fork's open PR: the migration's <owner>/<branch>. It now moves with GitHub's commits, stays out of the grace (otherwise it would be deleted after 7 days, and Forgejo would close the PR), and is deleted on close;
    • a fork's closed PR: it has no branch here, so a reopen on GitHub leaves it closed here, and the log says so.
  • Comments. Each GitHub comment is matched to the Forgejo's by issue, GitHub author id and time; RFC 3339 times with offsets are parsed.

It refuses and writes nothing when:

  • the copy is not a migration's;
  • an issue has no GitHub author;
  • a GitHub number below the last is missing;
  • any Forgejo comment matches none of GitHub's. A systematic mismatch would otherwise make the next pass re-post every comment.

Checks

  • make test in accordwimsy/, Linux: 224 of 224.
    • Before, 113. The new checks run against a fake Forgejo that models releases, attachments, the migration (its PR branches and comment order) and the listings adopt reads.
  • Mutants, by hand: 19 changes to the new logic, each one failing the tests.
    • Two were caught only after the tests were tightened: the open fork PR branch going to gone, and comments matched in the wrong order when GitHub lists them by update time.
  • The rest of CI's test job, locally: rei 241/241, tracer 1491/1491, test-mutants.py 50/50, test-install.sh, check-docs.py.

Not checked yet:

  • FreeBSD: the port's post-build runs these tests there.
  • A live migration on Forgejo 17.0.1. The fake follows its source. The production run starts with the smallest repository, and adopt's refusals guard the state if it differs.

…ir files checked against GitHub's SHA-256

Signed-off-by: AO55 <AO55@reden-emu.dev>
…ch keeps GitHub's authors, and adopt its copy

Signed-off-by: AO55 <AO55@reden-emu.dev>
@DraChimeraVee
DraChimeraVee merged commit 8de818a into main Nov 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants