chore: review workflow supports merge conflicts — Phase A0 before CI failures - #8
Merged
Merged
Conversation
…failures Backport of zoolutions/phlex-reactive#220 adapted to this repo: - /github-review-pr gains Phase A0 (merge-conflict detection via gh pr view --json mergeable with a local git-merge-tree fallback against the PR's actual head, ref verification before trusting exit codes) plus a resolution runbook: merge never rebase, semantic per-file rules, verification gates, plain push, loop-back rules, and Phase A0/end-state additions to the final report. - /github-review-failures gains a detection-only pre-flight that stops on CONFLICTING and hands off to the orchestrator. Repo-specific rules: version.rb conflicts keep the branch's deliberate bump (rake release lands directly on main); docs/Gemfile.lock takes the base's pin and re-resolves only via bundler (PLATFORMS caveat from the Rakefile); docs/bun.lock re-resolves via bun install; CHANGELOG Unreleased is a union; doc.rb/routes.rb registries keep both sides. Gates are this repo's real CI commands (rubocop lib spec, rspec).
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.
Summary
Adds a Phase A0: Merge conflicts step to the full review pass — it runs BEFORE the CI-failures phase so CI is diagnosed against the post-merge reality, not a base that no longer exists.
/github-review-pr:gh pr view --json mergeable,mergeStateStatus,baseRefName, with a localgit merge-tree --write-tree --name-onlyfallback when GitHub reportsUNKNOWN— tested against the PR's ACTUAL head (git fetch origin pull/<PR>/head+FETCH_HEAD, never the localHEAD), withgit rev-parse --verifyon both refs before trusting merge-tree's exit code; the--name-onlyoutput is the resolution work list.gh pr checkouton a clean tree, merge never rebase (shared branch — no force-push), semantic per-file resolution rules, verification gates before pushing, plaingit push./github-review-failures: a detection-only pre-flight —CONFLICTINGstops and hands off to/github-review-pr's Phase A0 (this command's toolset deliberately excludes the merge machinery);UNKNOWNproceeds.gh pr checkout,git status/switch/fetch/merge/merge-tree/rev-parse,bundle install,bun install,cd).Repo-specific adaptations (verified against this repo, not copied from phlex-reactive)
lib/phlex_forms/version.rb: the "a version conflict means the branch bumped on purpose" rule holds here —rake release[X.Y.Z]aborts unless onmainand commits the bump directly tomain, so feature branches never touch this file accidentally.docs/Gemfile.lock: the only committed Ruby lockfile (the gem root's is gitignored). Take the base's file (it carries the releasedphlex-formspin); if the branch changed docs deps, re-resolve viacd docs && bundle install— with the Rakefile's documented PLATFORMS caveat (a full re-resolve can fail; stop and ask rather than hand-edit).docs/bun.lock: take base, re-runcd docs && bun installif the branch changeddocs/package.json.docs/app/assets/builds/) are gitignored; phlex-reactive's min.js/vendored-twin rules do not apply and were not ported.docs/app/models/doc.rbonly (keep both sides'pagelines, base order first) —docs/config/routes.rbis static docs-kit boilerplate here (pages are served through the onedocs/:docroute), so it isn't a per-page registry in this repo.bundle exec rubocop lib spec(the Lint job's exact invocation) +bundle exec rspec; docs files lint via the docs app's own.rubocop.ymlwith files passed explicitly.Backport of zoolutions/phlex-reactive#220.