Skip to content

fix(ci): guard non-OCA and orphan-upstream forks, skip superseded rebases - #17

Merged
dnplkndll merged 1 commit into
mainfrom
fix/digest-guard-orphans-superseded
Nov 30, 2026
Merged

dnplkndll merged 1 commit into
mainfrom
fix/digest-guard-orphans-superseded

Conversation

@dnplkndll

Copy link
Copy Markdown
Contributor

What changed

The 2026-11-28 digest reported the same failures it had reported for weeks. Four of the five headline problems sat in the script's blind spots, and the 28 rebase conflicts were mostly branches with nothing left to rebase. This PR closes those gaps. Alongside it, the forks themselves were cleaned up (branches retired or rebased, mirrors reset where allowed).

Sync (fork_sync_digest.py)

  • Per-fork mirror flag. It defaults to the current behaviour (on when upstream_org is set).

    • Non-OCA mirrors (ledoent/odoo, ledoent/sentry) are now compared with their GitHub parent before merge-upstream.
    • sentry@master will report "diverged, 136 ahead" instead of an unexplained HTTP 409.
    • odoo-cloud-platform is explicitly mirror: false: its 19.0 carries real commits, so merging is correct there.
  • No common ancestor.

    • The compare API answers 404 "No common ancestor" (OpenUpgrade@20.0 vs OCA's orphan 20.0 skeleton).
    • The old code treated that as a flaky compare, fell through, and merge-upstream 409'd every night.
    • It's now reported as no shared history, with its own section and subject tag.
  • Safe-to-reset classifier. Flags a diverged branch as safe to reset when:

    • every ahead commit is a merge or the distributor chore, and
    • the net delta is at most forward-port.yml.

    The digest then prints the exact reset command. It never resets on its own. Checked live: it flags social@18.0 (12 ahead, only delta forward-port.yml) and correctly does not flag sentry@master.

  • Skip reasons. merge-upstream answers 404 "Branch not found" whichever side lacks the branch, and the digest used to call all of them "not on upstream". The skipped branches now say which side is missing it.

    • Today's three (sale-workflow@20.0, report-print-send@19.0/20.0) are all missing on fork.
  • check_ledoent_branch uses the fork's real parent and its default branch, not the hardcoded OCA / 18.0 fallbacks.

Rebaser

  • rebase_exclude: (fnmatch globs) parks a branch deliberately.

  • Listed once as "to retire", not rebased or counted as conflicts:

    • branches whose every fork and upstream PR is closed or merged,
    • branches with no commits of their own (the nightly rebase had emptied 13 ddmrp branches to 0/0),
    • branches whose commits git cherry shows are fully upstream.

    Branches with no PR keep rebasing, because some are aggregated by repos.yaml without one.

  • Conflict rows show the base date of the commit the branch was cut from (· base from YYYY-MM-DD). That separates "upstream did this months ago" from a fresh conflict.

forks.yml

  • OpenUpgrade:
    • Drop 20.0 from branches:. It has no shared history with OCA's 20.0, and it is the base of the prod-pinned 20.0-campaign and the open 20.0 fork PRs, so it must not be reset.
    • Add rebase_exclude: [19.0-fix-stock-account-coa-account-type], a real conflict with OCA#5881 that needs a lab check first.
  • New mirror flags: ledoent/odoo and ledoent/sentry get mirror: true; odoo-cloud-platform gets mirror: false.
  • Stale comments refreshed:
    • the 20.0 series,
    • the sentry release-branch model (the old text referred to *-kencove branches),
    • seer's actual fork parent (kencove/seer, defunct),
    • ddmrp MIGs, now all merged upstream by ForgeFlow.
  • Workflow header: updated to describe the same model.

Tests

  • python -m pytest .github/scripts/tests: 57 passed (15 new), and ruff check is clean.
  • New tests cover: orphan, never-POST; safe-to-reset vs real content; a non-OCA mirror compared against its parent; the skip reason; the ledoent check using the real parent; excluded and closed-PR branches never cloned; open-anywhere PR state; no PRs → still rebased; merged-upstream and superseded branches not pushed; render sections and subject tags.
  • The live, read-only classifier checks shown above were run with the new code against GitHub.

After merge

A manual run (gh workflow run fork-sync-and-digest.yml -R ledoent/.github) should report:

  • 0 sync fail and no "no shared history",
  • social@18.0 diverged with the safe-to-reset command (until it is reset),
  • sentry@master diverged (pending the reset decision),
  • no custom-branch failure (ddmrp's ledoent branch is retired),
  • no rebase conflicts beyond the excluded branch.

…ases

Sync:
- Mirror guard is now per fork (forks.yml `mirror`, default = upstream_org
  set). Non-OCA mirrors (ledoent/odoo, ledoent/sentry) are compared with
  their GitHub parent before merge-upstream, so sentry/master reports its
  divergence instead of 409-ing nightly. odoo-cloud-platform stays
  `mirror: false` (it carries real commits).
- Compare 404 "No common ancestor" is reported as "no shared history"
  instead of falling through to a merge-upstream 409 (OpenUpgrade@20.0).
- A diverged branch whose ahead commits are only sync merges / the
  distributor chore, with a net delta of forward-port.yml at most, is
  flagged "safe to reset" with the exact command. Never reset automatically.
- Skipped branches say which side is missing them (merge-upstream's 404 is
  the same for both).
- check_ledoent_branch targets the fork's real parent and default branch
  instead of hardcoded OCA / 18.0.

Rebaser:
- forks.yml `rebase_exclude` parks branches on purpose.
- Branches whose every fork/upstream PR is closed or merged, branches with
  no commits of their own, and branches git cherry shows fully upstream are
  listed once as "to retire" instead of being rebased and re-reported.
- Conflicts show the date of the base the branch was cut from.

forks.yml: drop OpenUpgrade 20.0 from branches (orphan upstream; ours is
the prod 20.0-campaign base), exclude 19.0-fix-stock-account-coa-account-type,
mark odoo/sentry mirrors, and refresh stale comments (20.0 series, sentry
release-branch model, seer's kencove parent, ddmrp MIGs retired).
@dnplkndll
dnplkndll merged commit b54129c into main Nov 30, 2026
1 check passed
@dnplkndll
dnplkndll deleted the fix/digest-guard-orphans-superseded branch November 30, 2026 12:59
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