Skip to content

junos_then_action_conflicts: resolve next-term vs next-policy precedence#190

Merged
dhalperi merged 1 commit into
mainfrom
spr/main/69966ff8
May 20, 2026
Merged

junos_then_action_conflicts: resolve next-term vs next-policy precedence#190
dhalperi merged 1 commit into
mainfrom
spr/main/69966ff8

Conversation

@dhalperi
Copy link
Copy Markdown
Member

@dhalperi dhalperi commented May 20, 2026

Adds 4 §5 flow-control terms (4011-4014) to characterize how Junos
collapses next term and next policy when both appear in the same
then block, and recollects the lab on vJunos-router 25.4R1.12.

Finding: next term and next policy are the same attribute family.
A then block holds at most one of them — dedup collapses identical
pairs, and last-wins applies to mixed pairs:

  • 4011 NT;NT -> NT (dedup; route falls through, no propagation)
  • 4012 NP;NP -> NP (dedup; route returns to BGP, propagates)
  • 4013 NT;NP -> NP (last-wins; route propagates)
  • 4014 NP;NT -> NT (last-wins; route falls through)

In all four cases both side-effect community add lines survive the
collapse and execute around the surviving terminator; the collector
RIB confirms the runtime winner via which marker communities arrive.
This generalizes the §1/§2/§3 last-wins rule to the named-disposition
family and tightens the README synthesis prose accordingly.

Prompt:

Let's iterate on the lab we just added in HEAD. Let's add a setup to
resolve next-term vs next-policy (order sensitive or not, and which
one wins?)

Stack:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

Adds 4 §5 flow-control terms (4011-4014) to characterize how Junos
collapses `next term` and `next policy` when both appear in the same
`then` block, and recollects the lab on vJunos-router 25.4R1.12.

Finding: `next term` and `next policy` are the same attribute family.
A `then` block holds at most one of them — dedup collapses identical
pairs, and last-wins applies to mixed pairs:

- 4011 NT;NT  -> NT       (dedup; route falls through, no propagation)
- 4012 NP;NP  -> NP       (dedup; route returns to BGP, propagates)
- 4013 NT;NP  -> NP       (last-wins; route propagates)
- 4014 NP;NT  -> NT       (last-wins; route falls through)

In all four cases both side-effect `community add` lines survive the
collapse and execute around the surviving terminator; the collector
RIB confirms the runtime winner via which marker communities arrive.
This generalizes the §1/§2/§3 last-wins rule to the named-disposition
family and tightens the README synthesis prose accordingly.

Prompt:
```
Let's iterate on the lab we just added in HEAD. Let's add a setup to
resolve next-term vs next-policy (order sensitive or not, and which
one wins?)
```

commit-id:69966ff8
@dhalperi dhalperi enabled auto-merge (squash) May 20, 2026 22:36
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.63%. Comparing base (4f9712c) to head (1e8803c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #190   +/-   ##
=======================================
  Coverage   83.63%   83.63%           
=======================================
  Files          87       87           
  Lines        4204     4204           
=======================================
  Hits         3516     3516           
  Misses        688      688           
Flag Coverage Δ
unittests 83.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dhalperi dhalperi merged commit d389abc into main May 20, 2026
115 checks passed
@dhalperi dhalperi deleted the spr/main/69966ff8 branch May 20, 2026 22:48
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.

2 participants