Skip to content

nd_interface_loopback: align deploy control to config_actions.deploy - #366

Merged
allenrobel merged 5 commits into
developfrom
align-loopback-config-actions-deploy
Aug 25, 2026
Merged

nd_interface_loopback: align deploy control to config_actions.deploy#366
allenrobel merged 5 commits into
developfrom
align-loopback-config-actions-deploy

Conversation

@allenrobel

@allenrobel allenrobel commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Merge Ordering — land before #403's post-#422 rebase

This PR and #403 (loopback policy_type discriminated union) both modify plugins/modules/nd_interface_loopback.py in the same regions (options block, EXAMPLES, main()), so textual conflicts between them are guaranteed. #403 is already held until #422 merges and owes a substantial rebase at that point (per the merge-ordering section in its body). Merging this small PR first lets #403 absorb the config_actions.deploy change in that one rebase it already owes. The reverse order works but is more expensive: this PR would have to re-express deploy control against the union-era module (which by then documents nine policy templates across two OSes).

Translation:

  1. Merge Detect field removals in replaced/overridden states (one-way subset diff) #422
  2. Merge this PR
  3. Rebase nd_interface_loopback: policy_type discriminated union #403 onto develop after 1 and 2 above

Related Issue(s)

Closes #364

Also checks off the #384 task-1 box for this module: its argspec imports now come from nd_argument_specs.py instead of the legacy nd.py.

Proposed Changes

Align nd_interface_loopback deploy control with the convention used by the unmerged interface
modules: replace the flat top-level deploy boolean with a config_actions dict whose single key
is deploy.

  • DOCUMENTATION: deploy: option replaced by config_actions: (dict) with a deploy suboption (type: bool, default true).
  • EXAMPLES: deploy: falseconfig_actions: { deploy: false }.
  • argument_spec: deploy=dict(...)config_actions_spec(include=("deploy",)), the shared fragment added by Relocate nd_argument_spec to nd_argument_specs.py; add config_actions_spec fragment #387
    (reproduces the deploy-only block hand-written in the sibling interface modules byte-for-byte).
  • nd_argument_spec import re-pointed from legacy nd.py to nd_argument_specs.py (Tracking: Gen-3 argspec imports via nd_argument_specs.py #384 task 1 for this module).
  • Read site: reads config_actions.deploy (default true) and sets orchestrator.deploy.
  • version_added corrected to 2.0.0 (review feedback).

Deploy scope and batching are unchanged (interface-scope interfaceActions/deploy, one bulk call per run);
only the toggle moves under config_actions.

No deprecation/changelog fragment: the module is unreleased (released changelog stops at 1.2.0;
galaxy 1.5.0), so nothing shipped is broken.

Test Notes

  • ndblack --check / ndisort --check-only: clean.
  • ndpylint: 10.00/10; ndmypy: only the pre-existing environmental ansible_collections.*
    import-resolution error on the unchanged import block; no new findings from this change.
  • ndtest --test validate-modules plugins/modules/nd_interface_loopback.py: passes (exit 0) —
    confirms DOCUMENTATION suboptions match the fragment-built argspec options.
  • ndpytest tests/unit/module_utils/orchestrators/test_loopback_interface.py tests/unit/module_utils/test_nd_argument_specs.py: 28 passed.
  • Integration merged.yaml no-deploy task updated to the new param shape.

Cisco Nexus Dashboard Version

4.2.1

Related ND API Resource Category

  • analyze
  • infra
  • manage
  • onemanage
  • other

Checklist

  • Latest commit is rebased from develop with merge conflicts resolved
  • New or updates to documentation has been made accordingly
  • Assigned the proper reviewers

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns nd_interface_loopback’s “deploy after mutation” toggle with the interface-module convention by nesting it under config_actions.deploy instead of a flat top-level deploy option, and updates the loopback integration scenario accordingly.

Changes:

  • Replace module option deploy: bool with config_actions: { deploy: bool } in DOCUMENTATION/EXAMPLES and in argument_spec.
  • Update the module runtime read site to set model_orchestrator.deploy from config_actions.deploy (defaulting to true).
  • Update the loopback integration “no-deploy” task to use the new config_actions.deploy shape.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
plugins/modules/nd_interface_loopback.py Moves deploy control under config_actions.deploy in docs, examples, argspec, and orchestration setup.
tests/integration/targets/nd_interface_loopback/tasks/merged.yaml Updates the no-deploy integration task to pass config_actions: { deploy: false }.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/modules/nd_interface_loopback.py Outdated
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch from c057fba to cdfefda Compare June 30, 2026 16:20
@allenrobel allenrobel self-assigned this Jul 1, 2026
@allenrobel allenrobel added 2.0.0 Release 2.0.0 ready for review Submitter is requesting a PR review labels Jul 1, 2026
allenrobel added a commit that referenced this pull request Jul 2, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
@allenrobel
allenrobel requested a review from Copilot July 2, 2026 18:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread plugins/modules/nd_interface_loopback.py
@allenrobel allenrobel removed the ready for review Submitter is requesting a PR review label Jul 2, 2026
@allenrobel
allenrobel marked this pull request as draft July 2, 2026 19:21
allenrobel added a commit that referenced this pull request Jul 3, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch from 443250a to 6975466 Compare July 3, 2026 01:34
@allenrobel allenrobel added ready for review Submitter is requesting a PR review postponed and removed ready for review Submitter is requesting a PR review labels Jul 7, 2026
allenrobel added a commit that referenced this pull request Jul 9, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch from 6975466 to a943ecb Compare July 9, 2026 16:55
allenrobel added a commit that referenced this pull request Jul 13, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
allenrobel added a commit that referenced this pull request Aug 11, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch from c802114 to 5ef99a7 Compare August 11, 2026 01:24
allenrobel added a commit that referenced this pull request Aug 11, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch from 5ef99a7 to aec3811 Compare August 11, 2026 20:54
allenrobel added a commit that referenced this pull request Aug 11, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch 2 times, most recently from 66e7309 to a92b51d Compare August 13, 2026 19:24
allenrobel added a commit that referenced this pull request Aug 13, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
Comment thread plugins/modules/nd_interface_loopback.py
allenrobel added a commit that referenced this pull request Aug 22, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch from a92b51d to 84eb53b Compare August 22, 2026 23:01
allenrobel added a commit that referenced this pull request Aug 24, 2026
Deployment is opt-in: `config_actions.deploy` now defaults to `False` in DOCUMENTATION and `argument_spec`, so
loopback changes are staged on the controller and only pushed to switches when the task sets
`config_actions.deploy: true`. Aligns with controller behavior and the NaC requirement.

- EXAMPLES that push config now set `config_actions.deploy: true` explicitly
- New unit test asserts DOCUMENTATION and `argument_spec` agree on the `False` default

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7fNh2q6RyHbb37T67hkN6
@allenrobel
allenrobel requested a review from mikewiebe August 24, 2026 18:49
allenrobel added a commit that referenced this pull request Aug 24, 2026
…to false

Deployment is now opt-in across the interface module family: `NDBaseInterfaceOrchestrator.deploy` defaults to
`False`, and the eight `nd_interface_*` modules that still declare `config_actions` inline (ethernet_trunk_host,
port_channel_access, port_channel_trunk_host, subinterface_managed, subinterface_unmanaged, svi, vpc_access,
vpc_trunk_host) default `config_actions.deploy` to `False` in both DOCUMENTATION and `argument_spec`. Changes are
staged on the controller and only pushed to switches when the task sets `config_actions.deploy: true`.

This aligns with controller behavior and the NaC requirement raised on PRs #366/#367, and follows the pattern
PR #504 established for the policy modules. `nd_interface_loopback` and `nd_interface_ethernet_access` pick up
the same default via the shared fragment in PRs #366 and #367.

- EXAMPLES that push config now set `config_actions.deploy: true` explicitly
- New parametrized unit test asserts DOCUMENTATION and `argument_spec` agree on the `False` default
- Orchestrator tests that exercise `deploy_pending` now opt in explicitly

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7fNh2q6RyHbb37T67hkN6
allenrobel added a commit that referenced this pull request Aug 24, 2026
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
allenrobel added a commit that referenced this pull request Aug 24, 2026
Deployment is opt-in: `config_actions.deploy` now defaults to `False` in DOCUMENTATION and `argument_spec`, so
loopback changes are staged on the controller and only pushed to switches when the task sets
`config_actions.deploy: true`. Aligns with controller behavior and the NaC requirement.

- EXAMPLES that push config now set `config_actions.deploy: true` explicitly
- New unit test asserts DOCUMENTATION and `argument_spec` agree on the `False` default

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7fNh2q6RyHbb37T67hkN6
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch from 8e00969 to 664e21e Compare August 24, 2026 23:01

@mikewiebe mikewiebe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

allenrobel and others added 5 commits August 24, 2026 15:38
Replace the flat top-level `deploy` boolean with a `config_actions` dict
carrying a single `deploy` key, matching the convention already used by the
unmerged interface modules (svi, ethernet_trunk_host, subinterface_managed,
subinterface_unmanaged).

Changes DOCUMENTATION, EXAMPLES, the argument_spec, and the read site. No
deprecation/changelog fragment: the module is unreleased (released changelog
stops at 1.2.0; galaxy 1.5.0), so nothing shipped is broken.

Closes #364

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H5FaXWEXvkgJUrUBZbfdFA
The module has not shipped in a release; 1.4.0 predates its actual
availability. Align version_added with the current collection version
so the config_actions change is not a post-release break.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Deb5UWoTfAZa6kq7khAEu6
Now that #387 is merged, build the `config_actions` block via
`config_actions_spec(include=("deploy",))` from `nd_argument_specs.py`
instead of the hand-written dict (which the fragment reproduces
byte-for-byte), and re-point the `nd_argument_spec` import from the
legacy `nd.py` to `nd_argument_specs.py` — completing the #384 task-1
checkbox for this module.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TnSktMFZGRafkf5GbuBwwm
`config_actions_spec()` now defaults `deploy` to `False` so that modules composing the shared fragment stage
changes on the controller and only push to switches when the user opts in with `config_actions.deploy: true`.
This matches the controller's own behavior and the NaC requirement (see PR #504 for the same change on the
policy modules).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7fNh2q6RyHbb37T67hkN6
Deployment is opt-in: `config_actions.deploy` now defaults to `False` in DOCUMENTATION and `argument_spec`, so
loopback changes are staged on the controller and only pushed to switches when the task sets
`config_actions.deploy: true`. Aligns with controller behavior and the NaC requirement.

- EXAMPLES that push config now set `config_actions.deploy: true` explicitly
- New unit test asserts DOCUMENTATION and `argument_spec` agree on the `False` default

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7fNh2q6RyHbb37T67hkN6
@allenrobel
allenrobel force-pushed the align-loopback-config-actions-deploy branch from 664e21e to 2bf23e6 Compare August 25, 2026 01:39
@allenrobel
allenrobel merged commit 97cc6a5 into develop Aug 25, 2026
57 checks passed
@allenrobel

Copy link
Copy Markdown
Collaborator Author

Merged after approvals by @gmicol and @mikewiebe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.0.0 Release 2.0.0 nac-0.0.1 NaC ND release 0.0.1 ready for review Submitter is requesting a PR review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nd_interface_loopback - align deploy control to config_actions.deploy

5 participants