-
Notifications
You must be signed in to change notification settings - Fork 75
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
refactor(xlineapi): improve is_conflict #932
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #932 +/- ##
==========================================
- Coverage 75.55% 75.12% -0.43%
==========================================
Files 180 191 +11
Lines 26938 28539 +1601
Branches 26938 28539 +1601
==========================================
+ Hits 20353 21441 +1088
- Misses 5366 5801 +435
- Partials 1219 1297 +78 ☔ View full report in Codecov by Sentry. |
@lxl66566 Your PR is in conflict and cannot be merged. |
This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 14 days |
13a44c6
to
2fe4785
Compare
2fe4785
to
a6e0129
Compare
@lxl66566 Convert your pr to draft since CI failed |
/// because RequestWrapper do not repr u8, we need to convert it manually. | ||
impl From<&RequestWrapper> for u8 { | ||
fn from(value: &RequestWrapper) -> Self { | ||
match *value { | ||
RequestWrapper::PutRequest(_) => 0, | ||
RequestWrapper::RangeRequest(_) => 1, | ||
RequestWrapper::DeleteRangeRequest(_) => 2, | ||
RequestWrapper::TxnRequest(_) => 3, | ||
RequestWrapper::CompactionRequest(_) => 4, | ||
RequestWrapper::AuthEnableRequest(_) => 5, | ||
RequestWrapper::AuthDisableRequest(_) => 6, | ||
RequestWrapper::AuthStatusRequest(_) => 7, | ||
RequestWrapper::AuthRoleAddRequest(_) => 8, | ||
RequestWrapper::AuthRoleDeleteRequest(_) => 9, | ||
RequestWrapper::AuthRoleGetRequest(_) => 10, | ||
RequestWrapper::AuthRoleGrantPermissionRequest(_) => 11, | ||
RequestWrapper::AuthRoleListRequest(_) => 12, | ||
RequestWrapper::AuthRoleRevokePermissionRequest(_) => 13, | ||
RequestWrapper::AuthUserAddRequest(_) => 14, | ||
RequestWrapper::AuthUserChangePasswordRequest(_) => 15, | ||
RequestWrapper::AuthUserDeleteRequest(_) => 16, | ||
RequestWrapper::AuthUserGetRequest(_) => 17, | ||
RequestWrapper::AuthUserGrantRoleRequest(_) => 18, | ||
RequestWrapper::AuthUserListRequest(_) => 19, | ||
RequestWrapper::AuthUserRevokeRoleRequest(_) => 20, | ||
RequestWrapper::AuthenticateRequest(_) => 21, | ||
RequestWrapper::LeaseGrantRequest(_) => 22, | ||
RequestWrapper::LeaseRevokeRequest(_) => 23, | ||
RequestWrapper::LeaseLeasesRequest(_) => 24, | ||
RequestWrapper::AlarmRequest(_) => 25, | ||
} | ||
} | ||
} |
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.
Derive #[repr(u8)]
in build.rs
?
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.
How to add it? I tried .field_attribute("Command.request_wrapper", ...)
but it seems not work. The field str is not match.
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.
.type_attribute("Command.request_wrapper", "#[repr(u8)]")
Signed-off-by: lxl66566 <lxl66566@gmail.com> refactor(xlineapi): complete refactor Signed-off-by: lxl66566 <lxl66566@gmail.com>
Signed-off-by: lxl66566 <lxl66566@gmail.com>
Signed-off-by: lxl66566 <lxl66566@gmail.com>
a6e0129
to
a6d3449
Compare
@lxl66566 Convert your pr to draft since CI failed |
Signed-off-by: lxl66566 <lxl66566@gmail.com>
Please briefly answer these questions:
what problem are you trying to solve? (or if there's no problem, what's the motivation for this change?)
is_conflict
method #379what changes does this pull request make?
lease()
. The PR is mainly to solve the first type of check rules.are there any non-obvious implications of these changes? (does it break compatibility with previous versions, etc)