Skip to content

Fix: completers: Avoid repeated node completions - #2168

Draft
liangxin1300 wants to merge 1 commit into
ClusterLabs:masterfrom
liangxin1300:20260805_improve_completers
Draft

Fix: completers: Avoid repeated node completions#2168
liangxin1300 wants to merge 1 commit into
ClusterLabs:masterfrom
liangxin1300:20260805_improve_completers

Conversation

@liangxin1300

Copy link
Copy Markdown
Collaborator

Node-based completers could keep suggesting arguments that were already completed. This made commands such as cluster remove offer duplicate node choices, while resource move and ban repeated node completion beyond their single node argument.

  • Add shared exclude_completed completer wrapper
  • Filter completed nodes for cluster remove
  • Use positional node completion for move and ban

@liangxin1300 liangxin1300 mentioned this pull request Aug 6, 2026
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.60%. Comparing base (157564b) to head (728f265).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
crmsh/completers.py 33.33% 6 Missing ⚠️
Additional details and impacted files
Flag Coverage Δ
integration 55.25% <70.00%> (+0.01%) ⬆️
unit 52.74% <70.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
crmsh/ui_cluster.py 71.97% <100.00%> (ø)
crmsh/ui_configure.py 49.83% <100.00%> (ø)
crmsh/ui_corosync.py 80.90% <100.00%> (+2.71%) ⬆️
crmsh/ui_node.py 62.43% <100.00%> (ø)
crmsh/ui_resource.py 72.82% <100.00%> (ø)
crmsh/completers.py 52.83% <33.33%> (-3.99%) ⬇️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Harness.
📢 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.

@liangxin1300
liangxin1300 force-pushed the 20260805_improve_completers branch 2 times, most recently from c2952ef to 4e176c0 Compare August 6, 2026 15:05
Repeating completers suggested values that had already been completed.
This made multi-value commands offer duplicate nodes, resources, or
properties, and made commands with only one node argument keep completing
nodes in later positions.

- Add an exclude_completed completer wrapper
- Filter repeated node, object, and property completions
- Use positional completion for resource move and ban
- Reuse the shared node completer for corosync push
- Use positional completion for corosync link removal
@liangxin1300
liangxin1300 force-pushed the 20260805_improve_completers branch from 4e176c0 to 728f265 Compare August 7, 2026 08:05
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