Repository navigation
test(branching): let the real branch tests decide netbox-branching compatibility - #207
Conversation
…mpatibility The contract test kept a review record for each netbox-branching release: the references that save a replayed object, and an AST fingerprint of each scope that holds one. A release without a record failed the suite. So each Dependabot patch bump failed CI, also when the change was harmless. 1.2.3 only edits ObjectChange.apply and ObjectChange.get_merge_data (upstream Remove the release records, the scan, the fingerprints and their tests. Remove also the pin on the exact signature of Branch.merge, Branch.revert and Branch.sync: the wrapper passes all arguments through. The tests in test_branch_replay.py run iterative and squash merges, reverts and syncs on a real branch. A netbox-branching change that breaks the replay skip makes them fail. At startup, the version check still limits the plugin to netbox-branching 1.2.x.
|
No actionable comments were generated in the recent review. WalkthroughThe branching tests remove replay call-site scanning, release-specific allow-lists and fingerprints, and an exact-signature assertion. The wrapper-contract test still compares each wrapped method’s signature with its original. ChangesBranching test changes
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Possibly related PRs
Merge Risk:
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |



The branching contract test kept a review record for each netbox-branching release: the references that save a replayed object, and an AST fingerprint of each scope that holds one. A release without a record failed the suite. So each Dependabot patch bump failed CI, also when the plugin still worked.
#205 (1.2.2 -> 1.2.3) shows this. On the branching leg only the three record tests failed. All other tests passed, including every merge, revert and sync test. The upstream change is harmless for the plugin:
ObjectChange.applystrips schema-local foreign keys on a CREATE (upstream #684), andget_merge_datawrites the fields that a squashed update touched (upstream #688). Both run inside the wrappedBranch.merge/Branch.revert.Change
REVIEWED_RELEASES, the reference scan, the scope fingerprints,ReplayCallSiteContractTestandReplayCallSiteScanTest.Branch.merge,Branch.revertandBranch.sync. The wrapper passes all arguments through, so a new upstream parameter does not break it.Compatibility is now decided by the real tests:
test_branch_replay.pyruns iterative and squash merges, reverts and syncs on a provisioned branch. It also covers the cascade cases and the merge exit paths (no change, dry run, failure). A netbox-branching change that breaks the replay skip makes them fail.ReplayWrapperContractTeststill checks that the plugin wraps each replaying method once and keeps its signature and attributes.check_versionstill limits the plugin to netbox-branching 1.2.x.After this merges, #205 passes on a rebase with no change of its own.
Verification
Full suite locally: all tests pass except one view query-count test, which fails the same way on
main(an unrelated pre-existing local environment issue; CI is unaffected). The branching leg of this PR runs on 1.2.2. The #205 run already shows the real branch tests passing on 1.2.3.Summary by CodeRabbit