-
Notifications
You must be signed in to change notification settings - Fork 33
feature/orgs merge #373
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
base: develop
Are you sure you want to change the base?
feature/orgs merge #373
Conversation
* EPMRPP-89966 refactor roles
* EPMRPP-90460 update dao
# Conflicts: # build.gradle # src/main/java/com/epam/reportportal/auth/event/UiAuthenticationSuccessEventHandler.java # src/main/java/com/epam/reportportal/auth/integration/builder/AuthIntegrationBuilder.java # src/main/java/com/epam/reportportal/auth/integration/handler/impl/strategy/AuthIntegrationStrategy.java
# Conflicts: # build.gradle
# Conflicts: # build.gradle
# Conflicts: # build.gradle # src/main/java/com/epam/reportportal/auth/event/UiAuthenticationSuccessEventHandler.java
# Conflicts: # src/main/java/com/epam/reportportal/auth/event/UiAuthenticationSuccessEventHandler.java
# Conflicts: # build.gradle # src/main/java/com/epam/reportportal/auth/integration/handler/impl/strategy/AuthIntegrationStrategy.java
# Conflicts: # .github/workflows/build-dev-image.yml # src/main/java/com/epam/reportportal/auth/entity/project/Project.java # src/main/java/com/epam/reportportal/auth/entity/user/User.java
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reviewdog
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|27 col 1| Wrong lexicographical order for 'com.epam.reportportal.auth.entity.user.UserRole' import. Should be before 'com.epam.reportportal.auth.rules.exception.ReportPortalException'.
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|65| Line is longer than 100 characters (found 108).
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|90 col 3| Missing a Javadoc comment.
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|110 col 5| Missing a Javadoc comment.
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|131 col 7| Missing a Javadoc comment.
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|137| Line is longer than 100 characters (found 104).
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|147 col 5| Missing a Javadoc comment.
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|173 col 7| Missing a Javadoc comment.
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|204 col 9| Missing a Javadoc comment.
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|211| Line is longer than 100 characters (found 101).
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|276| Line is longer than 100 characters (found 114).
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|296| Line is longer than 100 characters (found 106).
src/main/java/com/epam/reportportal/auth/commons/ReportPortalUser.java|303 col 59| '(' is preceded with whitespace.
import java.util.Optional; | ||
import lombok.Getter; | ||
|
||
/** |
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.
Summary javadoc is missing.
return this.roleLevel <= other.roleLevel; | ||
} | ||
|
||
public static Optional<OrganizationRole> forName(final String name) { |
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.
Missing a Javadoc comment.
import com.epam.reportportal.auth.entity.enums.OrganizationType; | ||
import java.io.Serializable; | ||
import java.time.Instant; | ||
import jakarta.persistence.Column; |
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.
Wrong lexicographical order for 'jakarta.persistence.Column' import. Should be before 'java.time.Instant'.
import java.io.Serializable; | ||
import java.time.Instant; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Convert; |
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.
Wrong lexicographical order for 'jakarta.persistence.Convert' import. Should be before 'java.time.Instant'.
import java.time.Instant; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Convert; | ||
import jakarta.persistence.Entity; |
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.
Wrong lexicographical order for 'jakarta.persistence.Entity' import. Should be before 'java.time.Instant'.
import org.hibernate.annotations.DynamicInsert; | ||
import org.hibernate.annotations.JdbcType; | ||
import org.hibernate.annotations.Type; | ||
import org.hibernate.dialect.PostgreSQLEnumJdbcType; | ||
import org.hibernate.annotations.UpdateTimestamp; |
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.
Wrong lexicographical order for 'org.hibernate.annotations.UpdateTimestamp' import. Should be before 'org.hibernate.dialect.PostgreSQLEnumJdbcType'.
MEMBER(2, "Member"), | ||
PROJECT_MANAGER(3, "Project manager"); | ||
VIEWER(0, "Viewer"), | ||
EDITOR (1, "Editor"); |
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.
'(' is preceded with whitespace.
import com.epam.reportportal.auth.rules.exception.ErrorType; | ||
import com.epam.reportportal.auth.rules.exception.ReportPortalException; | ||
import com.epam.reportportal.auth.entity.organization.OrganizationRole; |
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.
Wrong lexicographical order for 'com.epam.reportportal.auth.entity.organization.OrganizationRole' import. Should be before 'com.epam.reportportal.auth.rules.exception.ReportPortalException'.
import com.epam.reportportal.auth.rules.exception.ErrorType; | ||
import com.epam.reportportal.auth.rules.exception.ReportPortalException; | ||
import com.epam.reportportal.auth.entity.organization.OrganizationRole; | ||
import com.epam.reportportal.auth.entity.project.ProjectRole; |
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.
Wrong lexicographical order for 'com.epam.reportportal.auth.entity.project.ProjectRole' import. Should be before 'com.epam.reportportal.auth.rules.exception.ReportPortalException'.
import com.epam.reportportal.auth.rules.exception.ErrorType; | ||
import com.epam.reportportal.auth.rules.exception.ReportPortalException; | ||
import com.epam.reportportal.auth.entity.organization.OrganizationRole; | ||
import com.epam.reportportal.auth.entity.project.ProjectRole; | ||
import com.epam.reportportal.auth.entity.user.ProjectUser; |
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.
Wrong lexicographical order for 'com.epam.reportportal.auth.entity.user.ProjectUser' import. Should be before 'com.epam.reportportal.auth.rules.exception.ReportPortalException'.
import com.epam.reportportal.auth.entity.organization.OrganizationRole; | ||
import com.epam.reportportal.auth.entity.project.ProjectRole; | ||
import com.epam.reportportal.auth.entity.user.ProjectUser; | ||
import com.epam.reportportal.auth.entity.user.UserRole; |
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.
Wrong lexicographical order for 'com.epam.reportportal.auth.entity.user.UserRole' import. Should be before 'com.epam.reportportal.auth.rules.exception.ReportPortalException'.
|
||
private ReportPortalUser(String username, String password, | ||
Collection<? extends GrantedAuthority> authorities, Long userId, | ||
UserRole role, Map<String, ProjectDetails> projectDetails, String email, boolean isActive) { | ||
UserRole role, Map<String, OrganizationDetails> organizationDetails, String email, boolean isActive) { |
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.
Line is longer than 100 characters (found 108).
|
||
public static class ProjectDetails implements Serializable { | ||
@Getter |
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.
Missing a Javadoc comment.
public String getProjectName() { | ||
return projectName; | ||
} | ||
public static class OrganizationDetailsBuilder { |
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.
Missing a Javadoc comment.
return this; | ||
} | ||
|
||
public ProjectDetailsBuilder withProjectName(String projectName) { | ||
this.projectName = projectName; | ||
public OrganizationDetailsBuilder withOrganizationRole(String orgRole) { |
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.
Missing a Javadoc comment.
return this; | ||
} | ||
|
||
public ProjectDetailsBuilder withProjectRole(String projectRole) { |
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.
Missing a Javadoc comment.
} | ||
|
||
public ProjectDetails build() { | ||
return new ProjectDetails(projectId, projectName, projectKey, projectRole, organizationId); |
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.
Line is longer than 100 characters (found 101).
@@ -230,8 +273,8 @@ public ReportPortalUserBuilder withEmail(String email) { | |||
return this; | |||
} | |||
|
|||
public ReportPortalUserBuilder withProjectDetails(Map<String, ProjectDetails> projectDetails) { | |||
this.projectDetails = projectDetails; | |||
public ReportPortalUserBuilder withOrganizationDetails(Map<String, OrganizationDetails> organizationDetails) { |
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.
Line is longer than 100 characters (found 114).
it -> OrganizationDetails.builder() | ||
.withOrgId(it.getOrganization().getId()) | ||
.withOrganizationRole(it.getOrganizationRole().name()) | ||
.withProjectDetails(mapProjectDetails(user.getProjects(), it.getOrganization().getId())) |
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.
Line is longer than 100 characters (found 106).
return build(); | ||
} | ||
|
||
private Map<String, ProjectDetails> mapProjectDetails (Set<ProjectUser> projects, Long orgId) { |
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.
'(' is preceded with whitespace.
* Refactor GitHub user synchronization to use email for user identification * Refactor LDAP user replication to use email for user identification * Refactor SAML user replication to improve email handling and user creation logic * Refactor error messages and update user activity event publishing logic
|
No description provided.