-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: ui_context: crm configure up prompt #1466 #1481
Fix: ui_context: crm configure up prompt #1466 #1481
Conversation
The regression was introduced in beb26f3 Before beb26f3 it was like $ crm(live/15sp5-1)configure# primitive d Dummy $ crm(live/15sp5-1)configure# up $ There are changes pending. Do you want to commit them (y/n)? After beb26f3 there is no prompt 'There are changes pending... (y/n)?' This change brings the prompt back.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Please backport to crmsh-4.6
It seems that this patch breaks regression tests. |
backport ClusterLabs#1481 The regression was introduced in beb26f3 Before beb26f3 it was like $ crm(live/15sp5-1)configure# primitive d Dummy $ crm(live/15sp5-1)configure# up $ There are changes pending. Do you want to commit them (y/n)? After beb26f3 there is no prompt 'There are changes pending... (y/n)?' This change brings the prompt back.
backport #1481 The regression was introduced in beb26f3 Before beb26f3 it was like $ crm(live/15sp5-1)configure# primitive d Dummy $ crm(live/15sp5-1)configure# up $ There are changes pending. Do you want to commit them (y/n)? After beb26f3 there is no prompt 'There are changes pending... (y/n)?' This change brings the prompt back.
#1300 tried to remove unnecessary dependencies on a running pacemaker service when crmsh is not actually going to call the service. However, it removed the call to `end_game()` from `up()` and `quit()` incorrectly. This made sublevel `configure` not to have a chance to check uncommitted changes anymore, leading to a regression described in #1466. #1481 tried to fix this regression by adding the call to `end_game()` back to `up()`, and check if pacemaker service is running before calling `end_game()`. This is not optimal as `up()` is a common method used for all sublevels and the status of pacemaker service is only related sublevel `configure`. Checking the status of pacemaker service when using other sublevels does not make sense. This pull request uses a more straightforward method to fix the problem: improve how to detect uncommitted changes in `has_cib_changes()`. The original implementation is to check if there is any elements in change queue. This requires the in memory representation of cib to be populated, leading to an indirect dependency to pacemaker service. However, we can take advantage of a property: the in memory cib needs to be populated before doing any changes. So in the implementation can be optimized: if the in memory cib is not populated, we will know there is not any change.
The regression was introduced in beb26f3
Before beb26f3 it was like
After beb26f3 there is no prompt
There are changes pending. Do you want to commit them (y/n)?
This change brings the prompt back.