Skip to content

ci(sync): weekly upstream sync with a conflict report and a checked list of fork divergence - #36

Merged
AlxcBTW merged 10 commits into
mainfrom
feat/sync-automation
Oct 27, 2026
Merged

AlxcBTW merged 10 commits into
mainfrom
feat/sync-automation

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What

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

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@AlxcBTW

AlxcBTW commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

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.

@AlxcBTW
AlxcBTW merged commit b5c92a5 into main Oct 27, 2026
11 checks passed
@AlxcBTW AlxcBTW mentioned this pull request Oct 27, 2026
12 tasks done
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.

1 participant