[ADD] oca-upstream-sync: weekly drift check against upstream OCA - #241
Open
AungKoKoLin1997 wants to merge 1 commit into
Open
AungKoKoLin1997 wants to merge 1 commit into
AungKoKoLin1997 wants to merge 1 commit into
Conversation
Vendored copies drift from the OCA repos they came from, and checking by hand every week does not happen. A scheduled workflow reports the drift into a single issue; nothing is written to the repo on a schedule. The design turns on recording a baseline per module -- the upstream commit a copy was taken from, plus a fingerprint of the copy at that moment. That separates what OCA changed from what we changed, which a plain diff against the branch tip cannot do. Without it a sync job cannot tell an upstream fix from a deliberate local patch, and reverts the patch. Seeded with three modules. Their measured state is why the distinction matters: purchase_exception is a pristine copy and can auto-sync; auditlog is patched (qrtl #172, plus a test file absent upstream) and is refused; purchase_invoice_plan carries a local ja.po and is refused.
Contributor
Author
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
AungKoKoLin1997
marked this pull request as ready for review
September 14, 2026 03:13
AungKoKoLin1997
requested review from
kanda999,
nobuQuartile,
smorita7749 and
yostashiro
September 14, 2026 03:15
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.
Weekly automated check for drift between the modules vendored here and the OCA repos they came from, so upstream fixes stop going unnoticed for months.
Draft: the seed config covers 3 of 97 modules deliberately — the rollout plan below explains why and what comes next.
Problem
We vendor OCA modules by copying them into this repo. OCA keeps fixing bugs and adding features, but nobody checks every week whether our copies have fallen behind. By the time someone notices, the gap is months wide and the sync is a large, risky diff.
What this PR adds
A GitHub Actions workflow + a Python script that compares each configured module against its upstream OCA repo.
How the weekly schedule works
The scheduled run is report-only. Writing to the repo is always a manual action from the Actions tab.
Manual actions (workflow_dispatch)
checkdiscover-baselinesapplymergeBoth
applyandmergeopen a draft PR for review — they never push to16.0directly.Why baselines, not just a diff
The obvious approach: diff each module against upstream tip, PR the difference. The problem: that diff mixes OCA's changes with our local patches, and an auto-sync reverts them.
Several modules here are patched on purpose.
auditlogcarries qrtl #172 andtests/test_multi_company.py(absent upstream);purchase_invoice_plancarries a locali18n/ja.po. A tool that cannot see the difference will silently revert all of it.Each module therefore records a baseline — the upstream commit it was taken from, plus a fingerprint:
A module is only auto-written when the first diff is empty, proved by measurement, not claimed in a config file.
Measured state of the three seeded modules
purchase_exceptionauditlogpurchase_invoice_planpurchase_exceptionis a pristine copy, 8 commits behind → safe to auto-sync.auditlogis patched (qrtl [4781][FIX] auditlog: patch away all write overrides in res.groups for test #172 + extra test file) → refused, correctly.purchase_invoice_plancarries a locali18n/ja.po→ refused, correctly.Rollout plan
This is designed to be adopted gradually, not all at once. Only modules listed in
.oca-sync.ymlare looked at — everything else is untouched.Phase 1: Merge this PR (3 modules seeded)
After merging, the Monday schedule starts producing the drift issue for the 3 seeded modules. Nothing else changes. This lets us confirm the workflow runs correctly in CI and the issue format is useful.
Phase 2: Map all modules
Add the remaining ~94 modules to
.oca-sync.ymlin batches, then rundiscover-baselinesfrom the Actions tab. The script walks upstream history and automatically finds which commit each copy came from:i18n/ja.po)This is where we learn which modules are category A (pure upstream), B (upstream + overlay PR), or C (locally patched). The script does the classification; we just need to review and confirm.
Phase 3: Review weekly issues
Let the Monday job run for a few weeks. Read the drift report. Get comfortable with how it classifies things and what it flags. No syncing yet — just observing.
Phase 4: Start syncing
Once confident in the baselines:
applyfrom the Actions tab for thesyncablemodules → opens a draft PR with the upstream updatesneeds mergemodules, runmerge <module>→ opens a draft PR with a three-way merge that preserves local workPhase 5 (optional): Auto-sync on schedule
Once the process is proven, we can add
--applyto the scheduled Monday run so pristine copies sync automatically and open a draft PR without manual dispatch. That's a one-line change to the workflow, but only worth doing after the baselines are populated and trusted.Verified locally
--discover-baselinesattributespurchase_exceptionexactly,purchase_invoice_plancode-only, and correctly finds nothing forauditlog(3.4s for both upstream repos)--applysyncspurchase_exceptionto upstream tip and re-records its baselineneeds mergeand--applyrefuses it even when named explicitly--mergethree-way merges 8 upstream commits into the patched copy, keeping the local editpre-commitpasses on all added filesKnown rough edges
Documented in
README-oca-upstream-sync.md:GITHUB_TOKEN— close/reopen the PR to trigger itoca-gen-addon-readmeregeneration flips a module out ofsyncableuntil re-baselinedOCA/<repo>directly