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

Simplify default role allocation for users #3061

Merged
merged 1 commit into from Mar 2, 2022

Conversation

mithmatt
Copy link
Collaborator

@mithmatt mithmatt commented Mar 2, 2022

Describe your changes :

I worked on this to simplify the code changes on how default role is allocated to users.

  • Avoid change description updates for each user when their role is changed
  • Simplify the codebase

Type of change :

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Frontend Preview (Screenshots) :

For frontend related change, please link screenshots of your changes preview! Optional for backend related changes.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my own.
  • I have tagged my reviewers below.
  • I have commented on my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed.

Reviewers

Backend: @sureshms @harshach

@mithmatt mithmatt requested a review from harshach March 2, 2022 02:14
@mithmatt mithmatt self-assigned this Mar 2, 2022
@mithmatt mithmatt added this to the Milestone 5 - 0.9.0 Release milestone Mar 2, 2022
@mithmatt mithmatt added this to In progress in Release 0.9.0 via automation Mar 2, 2022
@mithmatt
Copy link
Collaborator Author

mithmatt commented Mar 2, 2022

All tests passed locally

[INFO] Running org.openmetadata.catalog.EnumBackwardCompatibilityTest
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in org.openmetadata.catalog.EnumBackwardCompatibilityTest
INFO  [2022-03-01 18:25:09,015] io.dropwizard.health.core.HealthCheckManager: delayed shutdown: started (waiting 5 seconds)
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 919, Failures: 0, Errors: 0, Skipped: 0
[INFO]

@@ -383,43 +391,5 @@ private void setDefaultToFalse(Role role) {
throw EntityNotFoundException.byMessage(CatalogExceptionMessage.entitiesNotFound(Entity.USER));
}
}

private void updateUsers(EntityReference addRole, EntityReference removeRole) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No changes to tests, since the logic remains the same.

Copy link
Contributor

@vivekratnavel vivekratnavel left a comment

Choose a reason for hiding this comment

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

+1 LGTM

@sonarcloud
Copy link

sonarcloud bot commented Mar 2, 2022

[open-metadata-ingestion] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@mithmatt
Copy link
Collaborator Author

mithmatt commented Mar 2, 2022

Test on maven CI failed due to known flaky test

2022-03-02T02:32:11.6358045Z [INFO] 
2022-03-02T02:32:11.6358822Z [INFO] Results:
2022-03-02T02:32:11.6359636Z [INFO] 
2022-03-02T02:32:11.6359927Z [ERROR] Failures: 
2022-03-02T02:32:11.6363032Z [ERROR]   WebhookResourceTest.put_updateEndpointURL:180->EntityResourceTest.deleteEntity:1413->EntityResourceTest.deleteEntity:1423 Expected org.apache.http.client.HttpResponseException to be thrown, but nothing was thrown.
2022-03-02T02:32:11.6364965Z [INFO] 
2022-03-02T02:32:11.6366910Z [ERROR] Tests run: 919, Failures: 1, Errors: 0, Skipped: 0
2022-03-02T02:32:11.6367220Z [INFO] 

See #2961

@mithmatt
Copy link
Collaborator Author

mithmatt commented Mar 2, 2022

Merging...

@mithmatt mithmatt merged commit e822b6f into open-metadata:main Mar 2, 2022
Release 0.9.0 automation moved this from In progress to Done Mar 2, 2022
@mithmatt mithmatt deleted the role_user_simplify branch March 2, 2022 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants