-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
UpdateVersion and deleteRule API for RampManager #3159
Conversation
Update Version for existing RampRule will update version metadata on DB directly; while delete rule will delete all metadata related to the rule. Both API would not introduce new insert but only update existing data. Failure would occur when: - no existing rule - input failed validation - no user permission
Codecov Report
@@ Coverage Diff @@
## master #3159 +/- ##
============================================
- Coverage 41.78% 41.69% -0.10%
- Complexity 4754 4768 +14
============================================
Files 607 610 +3
Lines 40663 40875 +212
Branches 4717 4738 +21
============================================
+ Hits 16992 17042 +50
- Misses 22260 22417 +157
- Partials 1411 1416 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
azkaban-common/src/main/java/azkaban/imagemgmt/daos/RampRuleDaoImpl.java
Outdated
Show resolved
Hide resolved
azkaban-common/src/main/java/azkaban/imagemgmt/daos/RampRuleDaoImpl.java
Show resolved
Hide resolved
public void deleteRule(final String ruleName, final User user) { | ||
// validate permission | ||
final Set<String> owners = rampRuleDao.getOwners(ruleName); | ||
if (!permissionManager.hasPermission(user, owners)) { |
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.
This and code block at line 255 are duplicate. Please dedupe.
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.
The code overall looks good. I have few comments, can you please address them?
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 for addressing the comments. The code looks good now.
* UpdateVersion and deleteRule API for RampManager Update Version for existing RampRule will update version metadata on DB directly; while delete rule will delete all metadata related to the rule. Both API would not introduce new insert but only update existing data. Failure would occur when: - no existing rule - input failed validation - no user permission PR link: #3159 RB=3643970 G=azkabandev-reviewers R=sarumuga,prkhande,ypadron,jakhani,anath1,areznik,sshardoo,apruthi,angoel,abtiwari,adsharma,gsalia,djaiswal A=shwei
Update Version for existing RampRule will update version metadata on DB directly; while delete rule will delete all metadata related to the rule. Both API would not introduce new insert but only update existing data. Failure would occur when: