Distinguish develop-behind from diverged in the branch check - #432
Merged
Conversation
Two kinds of Python need different project-type requirements: utility code (as in PlexCleaner) can and should carry unit tests and coverage, while codegen/boilerplate that runs during another tool's build to emit generated source (ESPHome codegen producing enriched C++) has no tests and no coverage and needs only the linter. Capture the work to add a linter-only Python type, and record that ESPHome-Config's +python reclassification is deferred until it exists. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The branch-drift check flagged every path where main changed since the merge-base and main != develop as "develop lacks (forward-sync needed)", without testing direction. A path both branches moved (main's Dependabot pin plus develop's own re-vendor) landed in that set even though develop supersedes main, so the audit told a converging repo to forward-sync files that would have reverted its work. Split the set: a path develop still holds at the merge-base is a genuine forward-sync; a path both branches moved is diverged and reported as such (develop may already supersede main), never as a develop deficit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the spec/audit.py branch-drift logic to correctly distinguish when develop is genuinely behind main versus when both branches have changed since the merge-base, preventing misleading “forward-sync needed” findings in diverged cases.
Changes:
- Split branch-drift reporting into two buckets:
behind(develop still at merge-base) vsdiverged(both branches moved off merge-base). - Add a clearer DRIFT finding message for diverged paths to prompt reconciliation before promotion.
- Extend the README backlog with an item proposing a linter-only Python project type for codegen/boilerplate use cases.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| spec/audit.py | Refines branch-drift detection to report directionally-correct findings (behind vs diverged) based on merge-base comparisons. |
| README.md | Adds a TODO/backlog item describing a potential new “linter-only Python” project type. |
Address the review: tighten the inline comment to one sentence per line per the comment-hygiene rule, and move the behind-vs-diverged logic into a pure classify_branch_drift() helper exercised by a selftest fixture that covers modify/add/delete on main plus a develop-only change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ptr727
added a commit
that referenced
this pull request
Jul 25, 2026
…) (#434) ## Promote develop to main Four doc/spec-only changes, all squashed to develop and Copilot-clean: - **#430** - README backlog: refresh the stale README + evaluate a lower-maintenance structure. - **#431** - README backlog: a linter-only Python type (codegen/boilerplate: no tests/coverage, linter only) distinct from the utility `python` type; ESPHome-Config `+python` deferred until it exists. - **#432** - `audit.py` branch check now splits "develop genuinely behind" (forward-sync) from "changed on both / develop may supersede", with a `classify_branch_drift()` helper + selftest. Surfaced by the PlexCleaner convergence, where develop was ahead but read as a forward-sync gap. - **#433** - canonical `build-release-task.yml` artifact-delete uses the `if ! …; then` form instead of a force-success tail (matches the listing step; write-safety compliant). Changes the `github-release` verbatim region → fleet re-vendors next cycle. No code/workflow changes to the hub's own pipeline - documentation and spec only, so no release fires on merge. ## Verification - `spec/validate.py` OK; `spec/audit.py --selftest` PASS. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
What
The
audit.pybranch-drift check split by direction: a path develop still holds at the merge-base is a genuine forward-sync ("develop lacks"); a path both branches moved off the base isdivergedand reported as "changed on both main and develop … develop may already supersede main."Why
Surfaced by the PlexCleaner convergence (ptr727/PlexCleaner#880): the check flagged 4 workflow files as "develop lacks (forward-sync needed)" when develop was actually ahead (it carried the release-task re-vendor #882 that main lacked). The old logic only tested
main != developamong main-side changes, never whether develop was behind or ahead, so a both-changed file read as a develop deficit. Forward-syncing per that framing would have reverted develop's work.Verification
python3 spec/audit.py --selftestPASS;spec/validate.pyOK.diverged(accurate) instead ofdevelop lacks.🤖 Generated with Claude Code