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

Support weak typed data attributes, and rename related methods #189

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

zklgame
Copy link
Contributor

@zklgame zklgame commented Jul 19, 2023

This MR did:

  1. support weak typed data attributes by managing a isPrefix field in DataAttributeDef and a new registry field.
  2. rename related getDataObject methods to getDataAttribute.

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #189 (562d648) into main (54cdb47) will increase coverage by 0.61%.
The diff coverage is 80.51%.

@@             Coverage Diff              @@
##               main     #189      +/-   ##
============================================
+ Coverage     69.37%   69.99%   +0.61%     
- Complexity      349      355       +6     
============================================
  Files            58       59       +1     
  Lines          1476     1513      +37     
  Branches        134      135       +1     
============================================
+ Hits           1024     1059      +35     
- Misses          379      381       +2     
  Partials         73       73              
Impacted Files Coverage Δ
...orkflow/core/persistence/DataAttributesRWImpl.java 66.66% <60.00%> (+1.04%) ⬆️
...va/io/iworkflow/core/utils/DataAttributeUtils.java 75.00% <75.00%> (ø)
src/main/java/io/iworkflow/core/Client.java 59.16% <76.47%> (+0.51%) ⬆️
src/main/java/io/iworkflow/core/Registry.java 79.24% <82.75%> (+2.42%) ⬆️
src/main/java/io/iworkflow/core/WorkerService.java 85.64% <100.00%> (+0.21%) ⬆️
...o/iworkflow/core/persistence/DataAttributeDef.java 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@longquanzheng longquanzheng left a comment

Choose a reason for hiding this comment

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

lgtm, just some minor comments

dataAttributeField.getDataAttributeType())
);
for (final DataAttributeDef dataAttributeField : fields) {
if (!dataAttributeField.isPrefix()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: swap the order of the if-else will make it slightly better to read:

if (dataAttributeField.isPrefix()) {

else {}

.build();
}

public static DataAttributeDef createByPrefix(final Class dataType, final String key) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: key ==> keyPrefix

Also it will better to provide some comments to it. As it's not straightforward to know why this is needed.

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