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

[#6153]refactor: Break up role commands in Gravitino CLI #6170

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

cool9850311
Copy link
Contributor

What changes were proposed in this pull request?

Break up role commands in Gravitino command line class

Why are the changes needed?

For readability and maintainability.

Fix: #6153

Does this PR introduce any user-facing change?

None.

How was this patch tested?

Tested locally.

@justinmclean justinmclean changed the title [#6153]refactor: Break up role commands in Gravitino command line class [#6153]refactor: Break up role commands in Gravitino CLI Jan 9, 2025
return false;
}
}

Copy link
Member

Choose a reason for hiding this comment

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

All calls below are misisng calls to validate()

command + " requires exactly one role, but multiple are currently passed.");
return roles[0];
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Please don't change error messages, as they need to be consistent with other error messages.


metalake = new FullName(line).getMetalakeName();

String[] roles = line.getOptionValues(GravitinoOptions.ROLE);
Copy link
Member

Choose a reason for hiding this comment

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

roles could become a property

roles = Arrays.stream(roles).distinct().toArray(String[]::new);
}

String[] privileges = line.getOptionValues(GravitinoOptions.PRIVILEGE);
Copy link
Member

Choose a reason for hiding this comment

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

same here

Copy link
Member

@justinmclean justinmclean Jan 9, 2025

Choose a reason for hiding this comment

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

This file is missing a license header, causing the CI to fail.

…ne class

Break up role commands in Gravitino command line class

For readability and maintainability.

Tested locally.
Copy link
Member

@justinmclean justinmclean left a comment

Choose a reason for hiding this comment

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

LGTM thanks for the contribution

@justinmclean justinmclean merged commit b438ef4 into apache:main Jan 10, 2025
27 checks passed
Abyss-lord pushed a commit to Abyss-lord/gravitino that referenced this pull request Jan 11, 2025
…e#6170)

### What changes were proposed in this pull request? 
Break up role commands in Gravitino command line class

### Why are the changes needed?
For readability and maintainability.

### Fix: apache#6153

### Does this PR introduce any user-facing change?  
None.

### How was this patch tested?
Tested locally.
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.

Refactor role commands in Gavitino CLI
2 participants