Skip to content
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

Improve configure schema command #1690

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

liangxin1300
Copy link
Collaborator

@liangxin1300 liangxin1300 commented Feb 14, 2025

  • Make sure schema changed after setting new schema by configure schema
  • Add test case for schema change
  • Get schema statically when cluster is not running
  • Improve documentation for configure schema command

doc/crm.8.adoc Outdated

Usage:
...............
schema [<schema>]
...............
Example:
...............
schema pacemaker-1.1
# To get the current schema version
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# To get the current schema version
# To get the schema version of the current CIB, or the latest version if no cluster configured yet

BTW, sounds currently crm configure schema only supports the running cluster. It reports call trace otherwise.

doc/crm.8.adoc Outdated
several, depending on version. At least the following schemas are
accepted by `crmsh`:
several, depending on version. You can see all supported schemas by
input +Tab+ after `crm configure schema`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
input +Tab+ after `crm configure schema`.
typing +<TAB><TAB>+ after `crm configure schema`.

…nfigure schema`

Also return False if schema is not supported.
@liangxin1300 liangxin1300 force-pushed the 20250214_schema_improve branch 2 times, most recently from 459a314 to 9a3c42c Compare February 17, 2025 14:09
@liangxin1300 liangxin1300 marked this pull request as ready for review February 17, 2025 14:11
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.74%. Comparing base (8bb3232) to head (9b1bfe5).
Report is 5 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
integration 53.61% <100.00%> (+0.08%) ⬆️
unit 53.07% <25.00%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
crmsh/cibconfig.py 64.72% <100.00%> (+0.08%) ⬆️
crmsh/schema.py 84.21% <100.00%> (+1.54%) ⬆️
crmsh/ui_configure.py 45.25% <100.00%> (+0.52%) ⬆️

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

@liangxin1300 liangxin1300 force-pushed the 20250214_schema_improve branch from 9a3c42c to 77281bc Compare February 18, 2025 02:13
Copy link
Contributor

@zzhou1 zzhou1 left a comment

Choose a reason for hiding this comment

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

Some cosmetic findings


Usage:
...............
schema [<schema>]
...............
Example:
...............
schema pacemaker-1.1
# To get the schema version of the current CIB, or the latest version if no cluster configured yet
schema
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
schema
schema

# To get the schema version of the current CIB, or the latest version if no cluster configured yet
schema
# To set the new schema version
schema pacemaker-4.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
schema pacemaker-4.0
schema pacemaker-4.0

doc/crm.8.adoc Outdated
* +pacemaker-2.0+

Use this command to display or switch to another RNG schema.
Note that it is highly recommended to use the latest schema version.

Usage:
...............
schema [<schema>]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
schema [<schema>]
schema [<pacemaker-schema_version>]

# To set the new schema version
schema pacemaker-4.0
# Then need to run `commit` to make the change effective
# if it's on interactive mode
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# if it's on interactive mode
# if it's on interactive mode
commit

@liangxin1300 liangxin1300 force-pushed the 20250214_schema_improve branch from 77281bc to 9b1bfe5 Compare February 18, 2025 06:42
liangxin1300 added a commit that referenced this pull request Feb 18, 2025
@liangxin1300 liangxin1300 merged commit 87655e0 into ClusterLabs:master Feb 18, 2025
32 checks passed
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