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

UpdateVersion and deleteRule API for RampManager #3159

Merged
merged 2 commits into from
Sep 28, 2022

Conversation

ShellyWEI
Copy link
Collaborator

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

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
Copy link

codecov bot commented Sep 23, 2022

Codecov Report

Merging #3159 (b49b24b) into master (e5986e2) will decrease coverage by 0.09%.
The diff coverage is 13.06%.

❗ Current head b49b24b differs from pull request most recent head e6e5c77. Consider uploading reports for the commit e6e5c77 to get more accurate results

@@             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     
Impacted Files Coverage Δ
.../main/java/azkaban/imagemgmt/daos/RampRuleDao.java 0.00% <0.00%> (ø)
...n/java/azkaban/imagemgmt/daos/RampRuleDaoImpl.java 0.71% <0.00%> (-0.95%) ⬇️
...ava/azkaban/imagemgmt/models/RampRuleDenyList.java 0.00% <0.00%> (ø)
...src/main/java/azkaban/project/JdbcProjectImpl.java 64.37% <0.00%> (-1.35%) ⬇️
...kaban/imagemgmt/services/ImageRampRuleService.java 100.00% <ø> (ø)
...kaban/imagemgmt/servlets/ImageRampRuleServlet.java 3.09% <0.00%> (-2.27%) ⬇️
...n/imagemgmt/services/ImageRampRuleServiceImpl.java 72.54% <52.63%> (-7.76%) ⬇️
...rver/src/main/java/azkaban/execapp/FlowRunner.java 70.94% <60.00%> (-0.36%) ⬇️
...n/java/azkaban/imagemgmt/dto/RampRuleFlowsDTO.java 100.00% <100.00%> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

public void deleteRule(final String ruleName, final User user) {
// validate permission
final Set<String> owners = rampRuleDao.getOwners(ruleName);
if (!permissionManager.hasPermission(user, owners)) {
Copy link
Member

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.

Copy link
Member

@djaiswal83 djaiswal83 left a 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?

Copy link
Member

@djaiswal83 djaiswal83 left a 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.

@ShellyWEI ShellyWEI merged commit e069212 into azkaban:master Sep 28, 2022
@ShellyWEI ShellyWEI deleted the updateVersion branch September 28, 2022 17:00
NancyXie2022 pushed a commit that referenced this pull request May 26, 2023
* 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
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