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

Bump commons-io from 2.4 to 2.7 #2

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0418c5d
[FIX]修复chart安装后提示内容
TimeBye May 27, 2022
91788e1
Merge branch 'release-2.0.0' into 'master'
May 30, 2022
dba1c7a
[IMP] 修改主键加密提示消息
thefuckingcode May 30, 2022
a1802ae
Merge branch 'feature-yq-devops-2266' into 'master'
May 30, 2022
31e8aa8
[IMP]调整探针周期,默认启用启动探针
TimeBye Jun 9, 2022
51c04cf
[IMP] 解决代码异味
Jun 27, 2022
b3547a2
[IMP] update pom version
Jun 27, 2022
30771b2
[IMP] 修改pom
Jul 4, 2022
102cf15
Update pom.xml
Jul 4, 2022
83e9606
[IMP] 修改pom
Jul 8, 2022
46af270
Merge branch 'release-2.1.0' into 'master'
Jul 8, 2022
e7fde92
[IMP] 修改pom
Jul 8, 2022
055825c
Merge branch 'feature-yq-devops-pom' into 'master'
Jul 8, 2022
0f171f5
Update pom.xml
Jul 15, 2022
773d26e
Update pom.xml
Jul 15, 2022
5332153
Update pom.xml
Jul 15, 2022
bf605d5
Update pom.xml
Jul 15, 2022
851be3c
Merge branch 'master' into 'hotfix-2.1.1'
Jul 15, 2022
6682213
Merge branch 'hotfix-2.1.1' into 'master'
Jul 15, 2022
dd56c81
[imp] 临时屏蔽健康检查逻辑
Jul 29, 2022
483509f
[imp] 修改获取项目列表接口
Aug 1, 2022
0bf9799
[imp] 取消注释健康检查接口
Aug 1, 2022
8fb1cd9
[imp] 修改健康检查逻辑
Aug 1, 2022
959550a
[imp] 添加查询group接口
Aug 1, 2022
31bf819
[imp] 创建项目变量支持不传userId
Aug 1, 2022
0d01960
[imp] 代码调整
Aug 2, 2022
19c88f8
[ADD] 添加查询gitlab管理员接口
Aug 2, 2022
1957957
[imp] 新增查询所有项目成员接口
Aug 8, 2022
f1d62db
Merge branch 'hotfix-2.1.2' of code.choerodon.com.cn:hand-yanqianyun-…
Aug 8, 2022
76a3864
[imp] 代码调整
Aug 8, 2022
65eb4a4
reslove conflict
Aug 8, 2022
8c6808d
[imp] update pom version
Aug 8, 2022
3abc5d4
Merge branch 'temp' into 'master'
Aug 8, 2022
e842b66
[imp] 添加更新webhook接口
Aug 16, 2022
1186bc3
[IMP] 添加查询所有角色接口
Aug 22, 2022
cb3a14f
[IMP] 添加查询所有角色接口
Aug 23, 2022
959641a
[IMP] 添加查询所有角色接口
Aug 23, 2022
463c085
[IMP] 代码调整
Aug 23, 2022
14ae3f4
[IMP] 添加分页查询有权限的所有组接口
Aug 23, 2022
79e6fdc
[IMP] 添加分页查询有权限的所有组接口
Aug 23, 2022
c96e5d4
[IMP] 添加分页查询有权限的所有组接口
Aug 23, 2022
3432c36
[IMP] 添加分页查询有权限的所有组接口
Aug 23, 2022
34d4073
[IMP] 添加分页查询有权限的所有组接口
Aug 23, 2022
afeed1b
[IMP] 修改pom
Sep 9, 2022
0c054a6
[IMP] 修改pom
Sep 9, 2022
0c64bee
Merge branch 'modify-pom' into 'master'
Sep 9, 2022
f3893e6
Merge remote-tracking branch 'origin/master-2.2' into merge-master-2.2
Sep 16, 2022
83554a1
Merge branch 'merge-master-2.2' into 'master'
Sep 16, 2022
af5c027
[imp] 代码调整
Sep 20, 2022
fda734b
[imp] 代码调整
Sep 21, 2022
fc1075d
Update pom.xml
Sep 23, 2022
4236057
[IMP] 修复查询所有合并请求
Sep 29, 2022
50854a6
Merge branch 'master-2.2' into 'master'
Sep 29, 2022
f5e1fd7
reslove conflict
Sep 29, 2022
2092b94
Merge branch 'hotfix-2.1.2' into 'master'
Sep 29, 2022
784dccb
Bump commons-io from 2.4 to 2.7
dependabot[bot] Sep 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chart/gitlab-service/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Verify deployment:

curl -s $(kubectl get po --namespace {{ .Release.Namespace }} \
-l choerodon.io/release={{ .Release.Name }} \
-l app.kubernetes.io/name={{ .Release.Name }} \
-o jsonpath="{.items[0].status.podIP}"):{{ .Values.containerPort.actuatorPort }}/actuator/health | jq -r .status

If the following similar information appears, it is a successful deployment:
Expand Down
5 changes: 2 additions & 3 deletions chart/gitlab-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ spec:
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
httpGet:
path: /actuator/health
port: actuator
tcpSocket:
port: server
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
Expand Down
16 changes: 8 additions & 8 deletions chart/gitlab-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,37 +264,37 @@ livenessProbe:
# -- Enable livenessProbe
enabled: true
# -- Initial delay seconds for livenessProbe
initialDelaySeconds: 480
initialDelaySeconds: 300
# -- Period seconds for livenessProbe
periodSeconds: 5
# -- Timeout seconds for livenessProbe
timeoutSeconds: 3
# -- Success threshold for livenessProbe
successThreshold: 1
# -- Failure threshold for livenessProbe
failureThreshold: 5
failureThreshold: 2
readinessProbe:
# -- Enable readinessProbe
enabled: true
# -- Initial delay seconds for readinessProbe
initialDelaySeconds: 30
initialDelaySeconds: 20
# -- Period seconds for readinessProbe
periodSeconds: 5
# -- Timeout seconds for readinessProbe
timeoutSeconds: 3
# -- Success threshold for readinessProbe
successThreshold: 1
# -- Failure threshold for readinessProbe
failureThreshold: 5
failureThreshold: 2
startupProbe:
# -- Enable startupProbe
enabled: false
enabled: true
# -- Initial delay seconds for startupProbe
initialDelaySeconds: 0
initialDelaySeconds: 10
# -- Period seconds for startupProbe
periodSeconds: 5
periodSeconds: 3
# -- Timeout seconds for startupProbe
timeoutSeconds: 3
timeoutSeconds: 2
# -- Success threshold for startupProbe
successThreshold: 1
# -- Failure threshold for startupProbe
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>gitlab-service</artifactId>
<version>2.0.0.RELEASE</version>
<version>2.2.0-20-SNAPSHOT</version>
<packaging>jar</packaging>
<url>https://github.com/choerodon/gitlab-service</url>

<!--加parent-->
<parent>
<groupId>io.choerodon</groupId>
<artifactId>choerodon-framework-parent</artifactId>
<version>2.0.0.RELEASE</version>
<version>2.2.0-20-SNAPSHOT</version>
</parent>

<build>
Expand Down Expand Up @@ -56,7 +56,7 @@
<dependency>
<groupId>io.choerodon</groupId>
<artifactId>choerodon-gitlab4j-api</artifactId>
<version>1.3.0-SNAPSHOT</version>
<version>2.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -117,7 +117,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import java.util.List;
import java.util.Optional;

import io.choerodon.gitlab.api.vo.CommitVO;
import io.choerodon.gitlab.api.vo.GitlabTransferVO;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.gitlab4j.api.models.Commit;
Expand All @@ -18,10 +15,9 @@

import io.choerodon.core.exception.FeignException;
import io.choerodon.gitlab.api.vo.CommitStatuseVO;
import io.choerodon.gitlab.api.vo.GitlabTransferVO;
import io.choerodon.gitlab.app.service.CommitService;

import javax.validation.Valid;

/**
* Created by zzy on 2018/1/14.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import io.choerodon.core.domain.Page;
import io.choerodon.core.exception.FeignException;
import io.choerodon.gitlab.api.vo.GitlabTransferVO;
import io.choerodon.gitlab.api.vo.GroupVO;
Expand Down Expand Up @@ -44,6 +45,24 @@ public ResponseEntity<List<Group>> list(@ApiParam(value = "userId")
return ResponseEntity.ok(groupService.listGroupsWithParam(userId, owned, search, skipGroups));
}

/**
* 分页查询所有组
*
* @return List
*/
@ApiOperation(value = "分页查询有权限的所有组")
@PostMapping("/{userId}/paging")
public ResponseEntity<Page<Group>> paging(@ApiParam(value = "userId")
@PathVariable(value = "userId") Integer userId,
@RequestParam(value = "page") Integer page,
@RequestParam(value = "size") Integer size,
@RequestParam(value = "owned", required = false) Boolean owned,
@RequestParam(value = "search", required = false) String search,
@RequestParam(value = "minAccessLevel", required = false) Integer minAccessLevel,
@RequestBody List<Integer> skipGroups) {
return ResponseEntity.ok(groupService.pagingGroupsWithParam(userId, page, size, owned, search, skipGroups,minAccessLevel));
}

/**
* 查询所有组
*
Expand Down Expand Up @@ -122,6 +141,25 @@ public ResponseEntity<List<Member>> listMember(
.orElseThrow(() -> new FeignException("error.groups.members.get"));
}

/**
* 查询组中的成员
*
* @param groupId 组对象Id
* @return List
*/
@ApiOperation(value = "分页查询成员列表")
@GetMapping(value = "/{groupId}/members/page")
public ResponseEntity<Page<Member>> pageMember(
@ApiParam(value = "组ID", required = true)
@PathVariable Integer groupId,
@RequestParam Integer page,
@RequestParam Integer size,
@ApiParam(value = "用户userId")
@RequestParam(required = false) Integer userId,
@RequestParam(value = "search", required = false) String search) {
return ResponseEntity.ok(groupService.pageMember(groupId, page, size, userId, search));
}

/**
* 根据用户ID获得组成员信息
*
Expand Down Expand Up @@ -230,8 +268,9 @@ public ResponseEntity<List<Project>> listProjects(
@RequestParam(value = "owned", required = false) Boolean owned,
@RequestParam(value = "search", required = false) String search,
@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "perPage", required = false) Integer perPage) {
return ResponseEntity.ok(groupService.listProjects(groupId, userId, owned, search, page, perPage));
@RequestParam(value = "perPage", required = false) Integer perPage,
@RequestParam(value = "minAccessLevel", required = false) Integer minAccessLevel) {
return ResponseEntity.ok(groupService.listProjects(groupId, userId, owned, search, page, perPage, minAccessLevel));
}

/**
Expand All @@ -252,6 +291,16 @@ public ResponseEntity<Group> queryGroupByName(
return new ResponseEntity<>(groupService.queryGroupByName(groupName, userId), HttpStatus.OK);
}

@ApiOperation(value = "根据组id查询组")
@GetMapping(value = "/query_by_id/{group_iid}")
public ResponseEntity<Group> queryGroupByIid(
@ApiParam(value = "组名", required = true)
@PathVariable(value = "group_iid") Integer groupIid,
@ApiParam(value = "userId")
@RequestParam(required = false) Integer userId) {
return new ResponseEntity<>(groupService.queryGroupByIid(groupIid, userId), HttpStatus.OK);
}

@ApiOperation(value = "根据组名检索组的列表")
@GetMapping(value = "/{group_name}/with_statistics")
public ResponseEntity<List<Group>> queryGroupWithStatisticsByName(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ public ResponseEntity<ProjectHook> create(
.orElseThrow(() -> new FeignException("error.projects.update.hook"));
}

@ApiOperation(value = "更新ProjectHook对象")
@PutMapping("{hook_id}")
public ResponseEntity<ProjectHook> update(
@ApiParam(value = "项目ID", required = true)
@RequestParam Integer projectId,
@ApiParam(value = "userId")
@RequestParam(required = false) Integer userId,
@ApiParam(value = "hookId", required = true)
@PathVariable(value = "hook_id") Integer hookId,
@RequestBody @Valid ProjectHook projectHook) {
return Optional.ofNullable(hookService.updateProjectHook(projectId, hookId, userId, projectHook))
.map(target -> new ResponseEntity<>(target, HttpStatus.NO_CONTENT))
.orElseThrow(() -> new FeignException("error.projects.update.hook"));
}

/**
* 获取ProjectHook对象
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import io.swagger.annotations.ApiParam;
import org.gitlab4j.api.models.PipelineSchedule;
import org.gitlab4j.api.models.Variable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public ResponseEntity<List<Map<String, Object>>> batchSaveVariableEvent(
@ApiParam(value = "项目ID", required = true)
@PathVariable Integer projectId,
@ApiParam(value = "用户ID", required = true)
@RequestParam(value = "userId") Integer userId,
@RequestParam(value = "userId", required = false) Integer userId,
@ApiParam(value = "variable信息", required = true)
@RequestBody @Valid List<VariableVO> list) {
return Optional.ofNullable(projectService.batchCreateVariable(projectId, list, userId))
Expand Down Expand Up @@ -323,7 +323,7 @@ public ResponseEntity<List<DeployKey>> getDeployKeys(
@ApiParam(value = "项目ID", required = true)
@RequestParam Integer projectId,
@ApiParam(value = "用户Id")
@RequestParam Integer userId) {
@RequestParam(required = false) Integer userId) {
return Optional.ofNullable(projectService.getDeployKeys(projectId, userId))
.map(target -> new ResponseEntity<>(target, HttpStatus.OK))
.orElseThrow(() -> new FeignException("error.project.deploy.key.get"));
Expand Down Expand Up @@ -461,6 +461,23 @@ public ResponseEntity<Member> getMember(
.orElseThrow(() -> new FeignException("error.groups.member.create"));
}

/**
* 查询项目角色
*
* @param projectId 项目id
* @param userId 用户Id
* @return Member
*/
@ApiOperation(value = "查询项目角色,包含继承的角色")
@GetMapping(value = "/{projectId}/members/all/{userId}")
public ResponseEntity<Member> getAllMember(
@ApiParam(value = "项目id", required = true)
@PathVariable(value = "projectId") Integer projectId,
@ApiParam(value = "成员信息", required = true)
@PathVariable(value = "userId") Integer userId) {
return ResponseEntity.ok(projectService.getAllMember(projectId, userId));
}

/**
* 获取项目下所有成员
*
Expand All @@ -476,6 +493,20 @@ public ResponseEntity<List<Member>> getAllMemberByProjectId(
.map(result -> new ResponseEntity<>(result, HttpStatus.OK))
.orElseThrow(() -> new FeignException("error.project.member.list"));
}
/**
* 获取项目下所有成员
*
* @param projectId 项目id
* @return List
*/
@ApiOperation(value = "获取项目下所有成员")
@GetMapping(value = "/{project_id}/all_members/list")
public ResponseEntity<List<Member>> getAllMemberByProjectIdAndQuery(
@ApiParam(value = "项目id", required = true)
@PathVariable(value = "project_id") Integer projectId,
@RequestParam(value = "query") String query) {
return ResponseEntity.ok(projectService.getAllMemberByProjectIdAndQuery(projectId, query));
}

/**
* 获取用户的gitlab项目列表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ public ResponseEntity<List<User>> list(
.orElseThrow(() -> new FeignException("error.users.queryAll"));
}

/**
* 查找所有admin用户
*
* @return List
*/
@ApiOperation(value = "查找所有用户")
@GetMapping(value = "/list_admin_users")
public ResponseEntity<List<User>> listAdminUsers() {
return Optional.ofNullable(userService.getAdminUsers())
.map(target -> new ResponseEntity<>(target, HttpStatus.OK))
.orElseThrow(() -> new FeignException("error.users.queryAll"));
}

/**
* 根据用户ID获得用户信息
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.choerodon.gitlab.api.vo;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.choerodon.gitlab.app.service;

import org.springframework.http.ResponseEntity;

/**
* @author: trump
* @date: 2019/8/21 16:33
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/io/choerodon/gitlab/app/service/GroupService.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.choerodon.gitlab.app.service;

import java.util.List;

import org.gitlab4j.api.models.*;

import io.choerodon.core.domain.Page;
import io.choerodon.gitlab.api.vo.GroupVO;
import io.choerodon.gitlab.api.vo.MemberVO;
import io.choerodon.gitlab.api.vo.VariableVO;
import org.gitlab4j.api.models.*;

import java.util.List;

public interface GroupService {
/**
Expand Down Expand Up @@ -196,8 +198,13 @@ List<Variable> batchCreateVariable(Integer groupId,
* @param userId 用户Id
* @return List
*/
List<Project> listProjects(Integer groupId, Integer userId, Boolean owned, String search, Integer page, Integer perPage);
List<Project> listProjects(Integer groupId, Integer userId, Boolean owned, String search, Integer page, Integer perPage, Integer minAccessLevel);

List<Group> queryGroupWithStatisticsByName(String groupName, Integer userId, Boolean statistics);

Group queryGroupByIid(Integer groupIid, Integer userId);

Page<Member> pageMember(Integer groupId, Integer page, Integer size, Integer userId, String search);

Page<Group> pagingGroupsWithParam(Integer userId, Integer page, Integer size, Boolean owned, String search, List<Integer> skipGroups, Integer minAccessLevel);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.List;

import org.gitlab4j.api.models.CommitStatuse;
import org.gitlab4j.api.models.ProjectHook;


Expand All @@ -23,4 +22,6 @@ public interface HookService {
ProjectHook updateProjectHook(Integer projectId,Integer hookId, Integer userId);

List<ProjectHook> listProjectHook(Integer projectId, Integer userId);

ProjectHook updateProjectHook(Integer projectId, Integer hookId, Integer userId, ProjectHook projectHook);
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,7 @@ Map<String, Object> createProtectedBranches(Integer projectId,

Project updateNameAndPath(Integer projectId, Integer userId, String name);

List<Member> getAllMemberByProjectIdAndQuery(Integer projectId, String query);

Member getAllMember(Integer projectId, Integer userId);
}
Loading