Skip to content

test(branching): let the real branch tests decide netbox-branching compatibility - #207

Merged
marcinpsk merged 1 commit into
mainfrom
test/branching-real-tests-only
Nov 13, 2026
Merged

marcinpsk merged 1 commit into
mainfrom
test/branching-real-tests-only

Conversation

@marcinpsk

@marcinpsk marcinpsk commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

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.apply strips schema-local foreign keys on a CREATE (upstream #684), and get_merge_data writes the fields that a squashed update touched (upstream #688). Both run inside the wrapped Branch.merge/Branch.revert.

Change

  • Remove REVIEWED_RELEASES, the reference scan, the scope fingerprints, ReplayCallSiteContractTest and ReplayCallSiteScanTest.
  • Remove the pin on the exact signature of Branch.merge, Branch.revert and Branch.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.py runs 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.
  • ReplayWrapperContractTest still checks that the plugin wraps each replaying method once and keeps its signature and attributes.
  • At startup, check_version still 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

  • Tests
    • Removed checks that enforced replay call-site review references and fingerprints.
    • Removed the exact-signature assertion for wrapped replay methods.

…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.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The 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.

Changes

Branching test changes

Layer / File(s) Summary
Update replay test contracts
netbox_interface_name_rules/tests/test_branching.py
The wrapper-contract test drops the exact original-signature assertion and “as it was reviewed” wording. The file also removes replay call-site scans, release-specific allow-lists and fingerprints, and their AST and hashing helpers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to f5336

This change only simplifies compatibility tests so that patch releases of netbox-branching no longer fail CI without a review record. Runtime behavior is unchanged, and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title says the real branch tests decide netbox-branching compatibility. The PR removes the release-specific replay call-site review framework (REVIEWED_RELEASES, reference scan, fingerprints, Repl…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title says the real branch tests decide netbox-branching compatibility. The PR removes the release-specific replay call-site review framework (REVIEWED_RELEASES, reference scan, fingerprints, ReplayCallSiteContractTest, ReplayCallSiteScanTest, and the exact-signature pin) and relies on behavioral tests in test_branch_replay.py. The title matches the main change. It uses the test(branching) prefix and stays under the 80-character count given in the title block. The title does not name the removal of the review records, but it captures the primary intent.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the branching test,
Then finds fewer rules to keep.
The replay scans have hopped away,
Their fingerprints no longer sleep.
The wrapper check remains in place,
While carrots wait in a neat heap.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 47dba52c-6b73-4e04-91ea-108d737ef0b6
Commits

Reviewing files that changed from the base of the PR and between a144452 and f5336ad.

Files selected for processing: 1

  • netbox_interface_name_rules/tests/test_branching.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@marcinpsk
marcinpsk merged commit 0bcd2c9 into main Nov 13, 2026
16 checks passed
@marcinpsk
marcinpsk deleted the test/branching-real-tests-only branch November 13, 2026 10:08
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