You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci(sync): weekly upstream sync with a conflict report and a checked list of fork divergence - #36
Replaces the daily sync/upstream job (red since 26.10., it gave up on conflicts) with a weekly sync that always produces a pull request, and adds a checked list of what the fork changes.
.github/workflows/sync-upstream.yml: weekly (Monday 04:17 UTC) and workflow_dispatch. Fetches upstream main, merges it into sync/upstream-<date> cut from main, opens or refreshes one pull request, and starts build.yml for it (Linux on the hosted runner via hosted=true, plus Windows). Token permissions are contents, pull-requests and actions write only, at job level. A clean merge opens a normal pull request. A conflict opens a draft with the conflict markers committed on the branch and the conflicting files listed, and starts no build. A branch a person has pushed to is never rewritten; later runs merge on top of it. The dispatch inputs base and prefix let the job be tried on a branch.
tools/sync_upstream.py: the merge and the report. The body lists the upstream commits and merged pull requests (as code spans, so the upstream repository gets no cross-reference backlinks), the files changed on both sides (the bridge hot spots, with their group from docs/dev/FORK.md), and the conflicts. It reuses tools/check_main_sync.py.
docs/dev/FORK.md and tools/fork_divergence.py: a table of every place the fork differs from upstream and why, checked against git diff from the merge base. The check fails on a diverging file with no row and on a row that matches nothing; the sync job runs it after the merge. No row is about one title.
The sync commits are Conventional Commits (chore(sync): merge upstream boykopovar/AnyPS5 up to <sha>). tools/check_conventions.py passes on this branch.
Not in this PR: the central observation hook (#35). When it merges, the "Observation hot spots" row in docs/dev/FORK.md shrinks; the check will say which patterns went stale.
Files of the other open pull requests (#9, #29, #30, #33, #35) are not touched, except README.md (one paragraph).
Tested
tools/tests/test_sync_upstream.py (8 tests: clean merge, hot spots, conflict markers and draft state, argument handling, table check) passes. Replaying the sync of 26.10. (main a1e8075, upstream ca0e955) gives exactly the manual finding: 2,206 commits, 643 pull requests, 1,154 files, 30 files changed on both sides and 14 conflicting files, as a draft with the list. Against today's upstream the merge is clean (180 commits). The workflow was run once with workflow_dispatch on this branch, see the comment below. Not run: the dispatched builds.
Checklist
Based on current main; no other open PR implements the same functions
One topic per PR; follow-ups go in a new PR
No comments in code except technical debt
Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
No notes, investigation .md files or images added to the repository
New third-party code is a submodule built from source
Generic behaviour, not specific to one title
Depends on: none
Fixes: none
Unblocks: none
GPUs tested: n/a
AI-assisted: yes
Need help on this PR? Tag @codesmith-bot with what you need.
Dry run on this branch with workflow_dispatch (inputs base=feat/sync-automation, prefix=sync/test, build=false), against today's upstream main (180 commits, merge clean): run 40574031478 is green. It pushed sync/test-2026-10-27, opened pull request 37 (closed again, branch deleted), refreshed it on the second run, and the divergence check passed (73 files, 10 groups).
What the runs found out about the platform:
The workflow token cannot push upstream's workflow changes (refusing to allow a GitHub App to create or update workflow .github/workflows/sanitizers.yml without workflows permission). Upstream changes workflow files often, so this would fail every sync. The job now catches that rejection, adds a commit ci(sync): keep the fork's workflow files... that restores the fork's version of every workflow file, pushes again, and lists those files in the pull request body ("Workflow files not included") so a person applies what the fork needs. A token with workflows permission (a PAT or an app) would remove this step; none is set up.
gh pr create, gh pr list and gh pr edit (GraphQL) fail or return nothing with the workflow token here ("Resource not accessible by integration"); the REST endpoints work, so the job uses gh api.
Not run: the dispatched builds (build=false in the dry run). The step is gh workflow run build.yml --ref main -f pr=<n> -f hosted=true, which uses inputs build.yml already has.
Replay of the sync of 26.10. (main a1e8075, upstream ca0e955) through tools/sync_upstream.py: 2,206 commits, 643 pull requests, 1,154 files, 30 files changed on both sides, 14 conflicts (README, six Export.cpp of the Np libraries, libSceNet, libSceNetCtl, libSceHttp, libSceHttp2, libc General, two debt files), reported as a draft with the list. That is the same set the manual git merge-tree probe found.
What today's manual sync (34) would have shown: the merge had conflicts in the hot spot files that this table names, so a draft would have opened with them. The NetCtlNatInfo layout change, the pointer-return stubs and the duplicate TCP guard in sceNetSetsockopt are not merge conflicts; they compile or fail only after a merge, so the build and net_bridge_p2p on the dispatched run would have caught them, red, on the sync branch instead of by hand.
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
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.
What
Replaces the daily
sync/upstreamjob (red since 26.10., it gave up on conflicts) with a weekly sync that always produces a pull request, and adds a checked list of what the fork changes..github/workflows/sync-upstream.yml: weekly (Monday 04:17 UTC) andworkflow_dispatch. Fetches upstream main, merges it intosync/upstream-<date>cut from main, opens or refreshes one pull request, and startsbuild.ymlfor it (Linux on the hosted runner viahosted=true, plus Windows). Token permissions arecontents,pull-requestsandactionswrite only, at job level. A clean merge opens a normal pull request. A conflict opens a draft with the conflict markers committed on the branch and the conflicting files listed, and starts no build. A branch a person has pushed to is never rewritten; later runs merge on top of it. The dispatch inputsbaseandprefixlet the job be tried on a branch.tools/sync_upstream.py: the merge and the report. The body lists the upstream commits and merged pull requests (as code spans, so the upstream repository gets no cross-reference backlinks), the files changed on both sides (the bridge hot spots, with their group fromdocs/dev/FORK.md), and the conflicts. It reusestools/check_main_sync.py.docs/dev/FORK.mdandtools/fork_divergence.py: a table of every place the fork differs from upstream and why, checked againstgit difffrom the merge base. The check fails on a diverging file with no row and on a row that matches nothing; the sync job runs it after the merge. No row is about one title.chore(sync): merge upstream boykopovar/AnyPS5 up to <sha>).tools/check_conventions.pypasses on this branch.Not in this PR: the central observation hook (#35). When it merges, the "Observation hot spots" row in
docs/dev/FORK.mdshrinks; the check will say which patterns went stale.Files of the other open pull requests (#9, #29, #30, #33, #35) are not touched, except
README.md(one paragraph).Tested
tools/tests/test_sync_upstream.py(8 tests: clean merge, hot spots, conflict markers and draft state, argument handling, table check) passes. Replaying the sync of 26.10. (main a1e8075, upstream ca0e955) gives exactly the manual finding: 2,206 commits, 643 pull requests, 1,154 files, 30 files changed on both sides and 14 conflicting files, as a draft with the list. Against today's upstream the merge is clean (180 commits). The workflow was run once withworkflow_dispatchon this branch, see the comment below. Not run: the dispatched builds.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repositoryNeed help on this PR? Tag
@codesmith-botwith what you need.