{"action":"created","comment":{"url":"https://api.github.com/repos/CESNET/perun/pulls/comments/229611416","pull_request_review_id":168357055,"id":229611416,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTYxMTQxNg==","diff_hunk":"@@ -125,13 +128,18 @@ public void deleteAllGroups(PerunSession sess, Vo vo) throws VoNotExistsExceptio\n \t}\n \n \t@Override\n-\tpublic void deleteGroups(PerunSession perunSession, List<Group> groups, boolean forceDelete) throws GroupNotExistsException, InternalErrorException, PrivilegeException, GroupAlreadyRemovedException, RelationExistsException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved {\n+\tpublic void deleteGroups(PerunSession perunSession, List<Group> groups, boolean forceDelete) throws GroupNotExistsException, InternalErrorException, PrivilegeException, GroupAlreadyRemovedException, RelationExistsException, GroupAlreadyRemovedFromResourceException, GroupRelationDoesNotExist, GroupRelationCannotBeRemoved, ExternallyManagedException {\n \t\tUtils.checkPerunSession(perunSession);\n \t\tUtils.notNull(groups, \"groups\");\n \n \t\t//Test if all groups exists and user has right to delete all of them\n \t\tfor(Group group: groups) {\n \t\t\tgetGroupsManagerBl().checkGroupExists(perunSession, group);\n+\n+\t\t\tif(getGroupsManagerBl().isGroupInStructureSynchronizationTree(perunSession, group) || getGroupsManagerBl().hasGroupSynchronizedChild(perunSession, group))\t{\n+\t\t\t\tthrow new ExternallyManagedException(\"Group \" + group + \"or som of the subGroups are externally managed!\");","path":"perun-core/src/main/java/cz/metacentrum/perun/core/entry/GroupsManagerEntry.java","position":39,"original_position":39,"commit_id":"a1e1678cc14f7b14b1cfe2994e56166aba79a7c5","original_commit_id":"a1e1678cc14f7b14b1cfe2994e56166aba79a7c5","user":{"login":"stavamichal","id":5602147,"node_id":"MDQ6VXNlcjU2MDIxNDc=","avatar_url":"https://avatars1.githubusercontent.com/u/5602147?v=4","gravatar_id":"","url":"https://api.github.com/users/stavamichal","html_url":"https://github.com/stavamichal","followers_url":"https://api.github.com/users/stavamichal/followers","following_url":"https://api.github.com/users/stavamichal/following{/other_user}","gists_url":"https://api.github.com/users/stavamichal/gists{/gist_id}","starred_url":"https://api.github.com/users/stavamichal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stavamichal/subscriptions","organizations_url":"https://api.github.com/users/stavamichal/orgs","repos_url":"https://api.github.com/users/stavamichal/repos","events_url":"https://api.github.com/users/stavamichal/events{/privacy}","received_events_url":"https://api.github.com/users/stavamichal/received_events","type":"User","site_admin":false},"body":"Typo.","created_at":"2018-10-31T09:09:29Z","updated_at":"2018-10-31T09:40:12Z","html_url":"https://github.com/CESNET/perun/pull/1964#discussion_r229611416","pull_request_url":"https://api.github.com/repos/CESNET/perun/pulls/1964","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/CESNET/perun/pulls/comments/229611416"},"html":{"href":"https://github.com/CESNET/perun/pull/1964#discussion_r229611416"},"pull_request":{"href":"https://api.github.com/repos/CESNET/perun/pulls/1964"}}},"pull_request":{"url":"https://api.github.com/repos/CESNET/perun/pulls/1964","id":215897168,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1ODk3MTY4","html_url":"https://github.com/CESNET/perun/pull/1964","diff_url":"https://github.com/CESNET/perun/pull/1964.diff","patch_url":"https://github.com/CESNET/perun/pull/1964.patch","issue_url":"https://api.github.com/repos/CESNET/perun/issues/1964","number":1964,"state":"open","locked":false,"title":"Group structure synchronization","user":{"login":"balcirakpeter","id":17315935,"node_id":"MDQ6VXNlcjE3MzE1OTM1","avatar_url":"https://avatars1.githubusercontent.com/u/17315935?v=4","gravatar_id":"","url":"https://api.github.com/users/balcirakpeter","html_url":"https://github.com/balcirakpeter","followers_url":"https://api.github.com/users/balcirakpeter/followers","following_url":"https://api.github.com/users/balcirakpeter/following{/other_user}","gists_url":"https://api.github.com/users/balcirakpeter/gists{/gist_id}","starred_url":"https://api.github.com/users/balcirakpeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balcirakpeter/subscriptions","organizations_url":"https://api.github.com/users/balcirakpeter/orgs","repos_url":"https://api.github.com/users/balcirakpeter/repos","events_url":"https://api.github.com/users/balcirakpeter/events{/privacy}","received_events_url":"https://api.github.com/users/balcirakpeter/received_events","type":"User","site_admin":false},"body":"-Attributes needs to be set:\r\n\tgroupStructureSynchronizationEnabled\r\n\tgroup extSource\r\n\tgroups query\r\n\tgroup members query\r\n\tthere has to be defined extSource in perun-extSources.xml\r\n\r\n- Optional attributes:\r\n\tflatGroupStructureEnabled\r\n\tgroup members extSource\r\n\tgroup structure synchronization interval\r\n\tgroup structure synchronization timeout\r\n- For this type of synchronization was created object CandidateGroup,\r\n  which extends Group by parentGroupName (String) and extSource (ExtSource).\r\n\r\n-Group structure synchronizations is run by scheduler every 5 minutes (by default).\r\n It works with threads just like member synchronization, but it has its own pool of threads and variables.\r\n groups are synchronized by groupName. From extSource are taken subjects with groupName, description and parentGroupName.\r\n\r\n-Synchronization of group structure gets subject groups from extSource and creates candidatGroups from them.\r\n Each candidate is categorized to: group candidate to add, group to update and group to remove.\r\n\r\n 1. Adding candidateGroups: If there is already their parentGroup (from extSource) in the structure,\r\n\tcreate group under that parent (CandidateGroup has parentGroupName from extSource).\r\n\tIf there is no such parentGroup, create Group under baseGroup.\r\n 2. Updating Groups: Check if, after creating new groups, there was added parent group (from extSource) of updating group.\r\n\tIf there is such a group, then move updating group under that group. Then update also group description.\r\n 3. Removing Groups: Move all subGroups under baseGroup and then remove group.\r\n\r\n Get list of all subGroups of basGroup and order them (leaf groups are first).\r\n for each subGroup in the list set neccessary attributes and run method synchronizeGroup.\r\n after that save information about member synchronization for that group.\r\n after all subGroups were proccessed, save information about group structure synchronization.\r\n\r\n-There was also implemented forceGroupStructureSynchronization, which puts group to the first place of the pool.\r\n\r\n-For test purposes were implemented methods getSubjectGroups() in  ExtSourceCSV, ExtSourceSql and ExtSourceSqlComplex.\r\n\r\n-Method saveInformationAboutGroupSynchronization were duplicated. Original solution is run as new transaction,\r\n which was causing dataAccessException while saving information about member synchronization for each subGroup of baseGroup.\r\n The duplicity is run as nested transaction which works fine.","created_at":"2018-09-17T07:52:54Z","updated_at":"2018-10-31T09:40:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5830df12848a4343e0fb94a3b94dcf10577811b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":728071582,"node_id":"MDU6TGFiZWw3MjgwNzE1ODI=","url":"https://api.github.com/repos/CESNET/perun/labels/waiting%20for%20changes","name":"waiting for changes","color":"f4df42","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/CESNET/perun/pulls/1964/commits","review_comments_url":"https://api.github.com/repos/CESNET/perun/pulls/1964/comments","review_comment_url":"https://api.github.com/repos/CESNET/perun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CESNET/perun/issues/1964/comments","statuses_url":"https://api.github.com/repos/CESNET/perun/statuses/a1e1678cc14f7b14b1cfe2994e56166aba79a7c5","head":{"label":"balcirakpeter:groupSynchronizationBase","ref":"groupSynchronizationBase","sha":"a1e1678cc14f7b14b1cfe2994e56166aba79a7c5","user":{"login":"balcirakpeter","id":17315935,"node_id":"MDQ6VXNlcjE3MzE1OTM1","avatar_url":"https://avatars1.githubusercontent.com/u/17315935?v=4","gravatar_id":"","url":"https://api.github.com/users/balcirakpeter","html_url":"https://github.com/balcirakpeter","followers_url":"https://api.github.com/users/balcirakpeter/followers","following_url":"https://api.github.com/users/balcirakpeter/following{/other_user}","gists_url":"https://api.github.com/users/balcirakpeter/gists{/gist_id}","starred_url":"https://api.github.com/users/balcirakpeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balcirakpeter/subscriptions","organizations_url":"https://api.github.com/users/balcirakpeter/orgs","repos_url":"https://api.github.com/users/balcirakpeter/repos","events_url":"https://api.github.com/users/balcirakpeter/events{/privacy}","received_events_url":"https://api.github.com/users/balcirakpeter/received_events","type":"User","site_admin":false},"repo":{"id":52038481,"node_id":"MDEwOlJlcG9zaXRvcnk1MjAzODQ4MQ==","name":"perun","full_name":"balcirakpeter/perun","private":false,"owner":{"login":"balcirakpeter","id":17315935,"node_id":"MDQ6VXNlcjE3MzE1OTM1","avatar_url":"https://avatars1.githubusercontent.com/u/17315935?v=4","gravatar_id":"","url":"https://api.github.com/users/balcirakpeter","html_url":"https://github.com/balcirakpeter","followers_url":"https://api.github.com/users/balcirakpeter/followers","following_url":"https://api.github.com/users/balcirakpeter/following{/other_user}","gists_url":"https://api.github.com/users/balcirakpeter/gists{/gist_id}","starred_url":"https://api.github.com/users/balcirakpeter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balcirakpeter/subscriptions","organizations_url":"https://api.github.com/users/balcirakpeter/orgs","repos_url":"https://api.github.com/users/balcirakpeter/repos","events_url":"https://api.github.com/users/balcirakpeter/events{/privacy}","received_events_url":"https://api.github.com/users/balcirakpeter/received_events","type":"User","site_admin":false},"html_url":"https://github.com/balcirakpeter/perun","description":"Identity and Access Management System","fork":true,"url":"https://api.github.com/repos/balcirakpeter/perun","forks_url":"https://api.github.com/repos/balcirakpeter/perun/forks","keys_url":"https://api.github.com/repos/balcirakpeter/perun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balcirakpeter/perun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balcirakpeter/perun/teams","hooks_url":"https://api.github.com/repos/balcirakpeter/perun/hooks","issue_events_url":"https://api.github.com/repos/balcirakpeter/perun/issues/events{/number}","events_url":"https://api.github.com/repos/balcirakpeter/perun/events","assignees_url":"https://api.github.com/repos/balcirakpeter/perun/assignees{/user}","branches_url":"https://api.github.com/repos/balcirakpeter/perun/branches{/branch}","tags_url":"https://api.github.com/repos/balcirakpeter/perun/tags","blobs_url":"https://api.github.com/repos/balcirakpeter/perun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balcirakpeter/perun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balcirakpeter/perun/git/refs{/sha}","trees_url":"https://api.github.com/repos/balcirakpeter/perun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balcirakpeter/perun/statuses/{sha}","languages_url":"https://api.github.com/repos/balcirakpeter/perun/languages","stargazers_url":"https://api.github.com/repos/balcirakpeter/perun/stargazers","contributors_url":"https://api.github.com/repos/balcirakpeter/perun/contributors","subscribers_url":"https://api.github.com/repos/balcirakpeter/perun/subscribers","subscription_url":"https://api.github.com/repos/balcirakpeter/perun/subscription","commits_url":"https://api.github.com/repos/balcirakpeter/perun/commits{/sha}","git_commits_url":"https://api.github.com/repos/balcirakpeter/perun/git/commits{/sha}","comments_url":"https://api.github.com/repos/balcirakpeter/perun/comments{/number}","issue_comment_url":"https://api.github.com/repos/balcirakpeter/perun/issues/comments{/number}","contents_url":"https://api.github.com/repos/balcirakpeter/perun/contents/{+path}","compare_url":"https://api.github.com/repos/balcirakpeter/perun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balcirakpeter/perun/merges","archive_url":"https://api.github.com/repos/balcirakpeter/perun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balcirakpeter/perun/downloads","issues_url":"https://api.github.com/repos/balcirakpeter/perun/issues{/number}","pulls_url":"https://api.github.com/repos/balcirakpeter/perun/pulls{/number}","milestones_url":"https://api.github.com/repos/balcirakpeter/perun/milestones{/number}","notifications_url":"https://api.github.com/repos/balcirakpeter/perun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balcirakpeter/perun/labels{/name}","releases_url":"https://api.github.com/repos/balcirakpeter/perun/releases{/id}","deployments_url":"https://api.github.com/repos/balcirakpeter/perun/deployments","created_at":"2016-02-18T21:02:00Z","updated_at":"2018-10-31T07:10:25Z","pushed_at":"2018-10-31T07:10:20Z","git_url":"git://github.com/balcirakpeter/perun.git","ssh_url":"git@github.com:balcirakpeter/perun.git","clone_url":"https://github.com/balcirakpeter/perun.git","svn_url":"https://github.com/balcirakpeter/perun","homepage":"http://perun.cesnet.cz","size":34634,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CESNET:master","ref":"master","sha":"c6d5a8a715d867c0cb2e9096cfdc8a0e818c543a","user":{"login":"CESNET","id":1116469,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMTY0Njk=","avatar_url":"https://avatars2.githubusercontent.com/u/1116469?v=4","gravatar_id":"","url":"https://api.github.com/users/CESNET","html_url":"https://github.com/CESNET","followers_url":"https://api.github.com/users/CESNET/followers","following_url":"https://api.github.com/users/CESNET/following{/other_user}","gists_url":"https://api.github.com/users/CESNET/gists{/gist_id}","starred_url":"https://api.github.com/users/CESNET/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CESNET/subscriptions","organizations_url":"https://api.github.com/users/CESNET/orgs","repos_url":"https://api.github.com/users/CESNET/repos","events_url":"https://api.github.com/users/CESNET/events{/privacy}","received_events_url":"https://api.github.com/users/CESNET/received_events","type":"Organization","site_admin":false},"repo":{"id":4085998,"node_id":"MDEwOlJlcG9zaXRvcnk0MDg1OTk4","name":"perun","full_name":"CESNET/perun","private":false,"owner":{"login":"CESNET","id":1116469,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMTY0Njk=","avatar_url":"https://avatars2.githubusercontent.com/u/1116469?v=4","gravatar_id":"","url":"https://api.github.com/users/CESNET","html_url":"https://github.com/CESNET","followers_url":"https://api.github.com/users/CESNET/followers","following_url":"https://api.github.com/users/CESNET/following{/other_user}","gists_url":"https://api.github.com/users/CESNET/gists{/gist_id}","starred_url":"https://api.github.com/users/CESNET/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CESNET/subscriptions","organizations_url":"https://api.github.com/users/CESNET/orgs","repos_url":"https://api.github.com/users/CESNET/repos","events_url":"https://api.github.com/users/CESNET/events{/privacy}","received_events_url":"https://api.github.com/users/CESNET/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/CESNET/perun","description":"Identity and Access Management System","fork":false,"url":"https://api.github.com/repos/CESNET/perun","forks_url":"https://api.github.com/repos/CESNET/perun/forks","keys_url":"https://api.github.com/repos/CESNET/perun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CESNET/perun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CESNET/perun/teams","hooks_url":"https://api.github.com/repos/CESNET/perun/hooks","issue_events_url":"https://api.github.com/repos/CESNET/perun/issues/events{/number}","events_url":"https://api.github.com/repos/CESNET/perun/events","assignees_url":"https://api.github.com/repos/CESNET/perun/assignees{/user}","branches_url":"https://api.github.com/repos/CESNET/perun/branches{/branch}","tags_url":"https://api.github.com/repos/CESNET/perun/tags","blobs_url":"https://api.github.com/repos/CESNET/perun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CESNET/perun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CESNET/perun/git/refs{/sha}","trees_url":"https://api.github.com/repos/CESNET/perun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CESNET/perun/statuses/{sha}","languages_url":"https://api.github.com/repos/CESNET/perun/languages","stargazers_url":"https://api.github.com/repos/CESNET/perun/stargazers","contributors_url":"https://api.github.com/repos/CESNET/perun/contributors","subscribers_url":"https://api.github.com/repos/CESNET/perun/subscribers","subscription_url":"https://api.github.com/repos/CESNET/perun/subscription","commits_url":"https://api.github.com/repos/CESNET/perun/commits{/sha}","git_commits_url":"https://api.github.com/repos/CESNET/perun/git/commits{/sha}","comments_url":"https://api.github.com/repos/CESNET/perun/comments{/number}","issue_comment_url":"https://api.github.com/repos/CESNET/perun/issues/comments{/number}","contents_url":"https://api.github.com/repos/CESNET/perun/contents/{+path}","compare_url":"https://api.github.com/repos/CESNET/perun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CESNET/perun/merges","archive_url":"https://api.github.com/repos/CESNET/perun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CESNET/perun/downloads","issues_url":"https://api.github.com/repos/CESNET/perun/issues{/number}","pulls_url":"https://api.github.com/repos/CESNET/perun/pulls{/number}","milestones_url":"https://api.github.com/repos/CESNET/perun/milestones{/number}","notifications_url":"https://api.github.com/repos/CESNET/perun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CESNET/perun/labels{/name}","releases_url":"https://api.github.com/repos/CESNET/perun/releases{/id}","deployments_url":"https://api.github.com/repos/CESNET/perun/deployments","created_at":"2012-04-20T11:55:38Z","updated_at":"2018-10-30T12:38:57Z","pushed_at":"2018-10-31T09:37:08Z","git_url":"git://github.com/CESNET/perun.git","ssh_url":"git@github.com:CESNET/perun.git","clone_url":"https://github.com/CESNET/perun.git","svn_url":"https://github.com/CESNET/perun","homepage":"https://perun.cesnet.cz/web/","size":35679,"stargazers_count":32,"watchers_count":32,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":52,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause","node_id":"MDc6TGljZW5zZTQ="},"forks":52,"open_issues":9,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CESNET/perun/pulls/1964"},"html":{"href":"https://github.com/CESNET/perun/pull/1964"},"issue":{"href":"https://api.github.com/repos/CESNET/perun/issues/1964"},"comments":{"href":"https://api.github.com/repos/CESNET/perun/issues/1964/comments"},"review_comments":{"href":"https://api.github.com/repos/CESNET/perun/pulls/1964/comments"},"review_comment":{"href":"https://api.github.com/repos/CESNET/perun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CESNET/perun/pulls/1964/commits"},"statuses":{"href":"https://api.github.com/repos/CESNET/perun/statuses/a1e1678cc14f7b14b1cfe2994e56166aba79a7c5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"stavamichal"}}