Skip to content

feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11399

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

Merged
merged 54 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
71d3236
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Oct 24, 2024
dec31db
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 12, 2024
f027f34
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 20, 2024
f8e33b5
Merge remote-tracking branch 'origin/master' into feat-11019
yjieliang Dec 20, 2024
17a4b94
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 20, 2024
fa86d87
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 20, 2024
89f5f3c
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 20, 2024
a4c5f76
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 25, 2024
2c98914
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 25, 2024
32b29d9
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 25, 2024
600867b
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Dec 25, 2024
e64f006
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 6, 2025
df9021e
Merge remote-tracking branch 'origin/master' into feat-11019
yjieliang Jan 6, 2025
f1fabac
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 6, 2025
3584ef1
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 6, 2025
0e7331c
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 7, 2025
3aa44f0
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 7, 2025
95c6117
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 7, 2025
dcb79a4
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 7, 2025
20168f2
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 7, 2025
4789940
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 8, 2025
bbf9c51
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 8, 2025
4376a2f
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 8, 2025
98793ff
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 8, 2025
8a707c1
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 9, 2025
8838f29
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 9, 2025
65db9a9
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 9, 2025
e358f41
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 9, 2025
53ea22a
Merge remote-tracking branch 'origin/master' into feat-11019
yjieliang Jan 9, 2025
8a1bac6
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 10, 2025
e4ead6d
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 14, 2025
41f9e7f
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 14, 2025
4256554
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 14, 2025
44042a3
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 14, 2025
8ce2802
feat:流水线查看和构建详情查看配置界面敏感字段展示优化 #11019
yjieliang Jan 14, 2025
21e7351
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Feb 8, 2025
3e0a351
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Feb 8, 2025
6cff42f
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Feb 10, 2025
7cd9856
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Feb 10, 2025
71b364d
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Feb 11, 2025
65d895c
Merge branch 'master' into feat-11019
yjieliang Feb 14, 2025
f165892
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Feb 14, 2025
89ababf
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Feb 14, 2025
8e259c4
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Feb 14, 2025
21ba39b
Merge remote-tracking branch 'refs/remotes/origin/master' into feat-1…
yjieliang Mar 4, 2025
692f521
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Mar 4, 2025
e5a835e
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Mar 4, 2025
0b91532
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Mar 4, 2025
75a6fe7
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Mar 4, 2025
4eea1c7
Merge branch 'refs/heads/master' into feat-11019
yjieliang Apr 10, 2025
b95bfbb
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Apr 16, 2025
28d37f3
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Apr 17, 2025
d5cef5c
Merge branch 'refs/heads/master' into feat-11019
yjieliang Apr 17, 2025
faf1791
feat:流水线查看和构建详情查看配置界面敏感字段展示优化#11019
yjieliang Apr 17, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,6 @@ abstract class Element(
}

open fun initTaskVar(): MutableMap<String, Any> = mutableMapOf()

open fun transferSensitiveParam(params: List<String>) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,12 @@ data class MarketBuildAtomElement(
)
}

override fun transferSensitiveParam(params: List<String>) {
val input = data["input"] as MutableMap<String, Any>? ?: return
params.forEach {
input[it] = "******"
}
}

override fun getClassType() = classType
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,12 @@ data class MarketBuildLessAtomElement(
)
}

override fun transferSensitiveParam(params: List<String>) {
val input = data["input"] as MutableMap<String, Any>? ?: return
params.forEach {
input[it] = "******"
}
}

override fun getClassType() = classType
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,64 @@

package com.tencent.devops.process.engine.service

import com.tencent.devops.common.api.constant.KEY_VERSION
import com.tencent.devops.common.api.util.JsonUtil
import com.tencent.devops.common.pipeline.pojo.element.Element
import com.tencent.devops.common.pipeline.pojo.element.market.MarketBuildAtomElement
import com.tencent.devops.common.pipeline.pojo.element.market.MarketBuildLessAtomElement
import com.tencent.devops.common.redis.RedisOperation
import com.tencent.devops.process.engine.dao.PipelineInfoDao
import com.tencent.devops.store.pojo.common.ATOM_POST_VERSION_TEST_FLAG_KEY_PREFIX
import com.tencent.devops.store.pojo.common.ATOM_SENSITIVE_PARAM_KEY_PREFIX
import com.tencent.devops.store.pojo.common.STORE_NORMAL_PROJECT_RUN_INFO_KEY_PREFIX
import com.tencent.devops.store.pojo.common.enums.StoreTypeEnum
import org.jooq.DSLContext
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

@Service
class PipelineInfoService @Autowired constructor(
private val dslContext: DSLContext,
private val pipelineInfoDao: PipelineInfoDao
private val pipelineInfoDao: PipelineInfoDao,
private val redisOperation: RedisOperation
) {

fun getPipelineName(projectId: String, pipelineId: String): String? {
return pipelineInfoDao.getPipelineInfo(dslContext, projectId, pipelineId)?.pipelineName
}

// 敏感入参解析
fun transferSensitiveParam(projectTestAtomCodes: List<String>, element: Element) {
if (element is MarketBuildAtomElement || element is MarketBuildLessAtomElement) {
val atomCode = element.getAtomCode()
val version = element.version
val hashKey = if (version.contains(".*")) {
var latestVersion: String? = null
val atomVersionTestFlag =
Copy link
Collaborator

Choose a reason for hiding this comment

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

store的逻辑挪到store去实现,通过service接口调用,另外redis的key值以后避免跨微服务使用,这样以后利于redis拆分

redisOperation.hget("$ATOM_POST_VERSION_TEST_FLAG_KEY_PREFIX:$atomCode", version)
// 项目下调试插件处理
if (projectTestAtomCodes.contains(atomCode) && (atomVersionTestFlag == "true")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

atomVersionTestFlag转成布尔值再使用比atomVersionTestFlag == "true"可读性更好

latestVersion = version
}
if (latestVersion.isNullOrBlank()) {
val atomRunInfoStr = redisOperation.hget(
key = "$STORE_NORMAL_PROJECT_RUN_INFO_KEY_PREFIX:${StoreTypeEnum.ATOM.name}:$atomCode",
hashKey = version
)
val atomRunInfo = atomRunInfoStr?.let { JsonUtil.toMap(it) }
latestVersion = atomRunInfo?.get(KEY_VERSION).toString()
}
latestVersion
} else {
version
}
val param = redisOperation.hget(
Copy link
Collaborator

Choose a reason for hiding this comment

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

调试项目下的插件版本(可能有测试版本)和一般的项目不一样,你这样缓存到redis有问题,这个逻辑根本不需要写,你通过com.tencent.devops.store.atom.service.impl.MarketAtomEnvServiceImpl#batchGetAtomRunInfos这个接口就可以拿到对应数据

key = "$ATOM_SENSITIVE_PARAM_KEY_PREFIX:$atomCode",
hashKey = hashKey
)
if (!param.isNullOrBlank()) {
element.transferSensitiveParam(param.split(","))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ import com.tencent.devops.process.pojo.pipeline.TemplateInfo
import com.tencent.devops.process.pojo.setting.PipelineModelVersion
import com.tencent.devops.process.service.PipelineAsCodeService
import com.tencent.devops.process.service.PipelineOperationLogService
import com.tencent.devops.process.service.label.PipelineGroupService
import com.tencent.devops.process.service.pipeline.PipelineSettingVersionService
import com.tencent.devops.process.service.pipeline.PipelineTransferYamlService
import com.tencent.devops.process.utils.PIPELINE_MATRIX_CON_RUNNING_SIZE_MAX
Expand All @@ -121,13 +120,14 @@ import com.tencent.devops.process.utils.PIPELINE_SETTING_WAIT_QUEUE_TIME_MINUTE_
import com.tencent.devops.process.utils.PipelineVersionUtils
import com.tencent.devops.process.yaml.utils.NotifyTemplateUtils
import com.tencent.devops.project.api.service.ServiceAllocIdResource
import com.tencent.devops.store.api.atom.ServiceAtomResource
import java.time.LocalDateTime
import java.util.concurrent.atomic.AtomicInteger
import javax.ws.rs.core.Response
import org.jooq.DSLContext
import org.jooq.impl.DSL
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service
import java.time.LocalDateTime
import java.util.concurrent.atomic.AtomicInteger
import javax.ws.rs.core.Response

@Suppress(
"LongParameterList",
Expand Down Expand Up @@ -165,8 +165,8 @@ class PipelineRepositoryService constructor(
private val transferService: PipelineTransferYamlService,
private val redisOperation: RedisOperation,
private val pipelineYamlInfoDao: PipelineYamlInfoDao,
private val pipelineGroupService: PipelineGroupService,
private val pipelineAsCodeService: PipelineAsCodeService
private val pipelineAsCodeService: PipelineAsCodeService,
private val pipelineInfoService: PipelineInfoService
) {

companion object {
Expand Down Expand Up @@ -1305,7 +1305,8 @@ class PipelineRepositoryService constructor(
projectId: String,
pipelineId: String,
version: Int? = null,
includeDraft: Boolean? = false
includeDraft: Boolean? = false,
editPermission: Boolean? = true
): PipelineResourceVersion? {
// TODO 取不到则直接从旧版本表读,待下架
val resource = if (version == null) {
Expand Down Expand Up @@ -1333,6 +1334,7 @@ class PipelineRepositoryService constructor(
// 3 所有插件ENV配置合并历史值,并过滤掉默认值
var randomSeed = 1
val jobIdSet = mutableSetOf<String>()
val testAtomCodes = client.get(ServiceAtomResource::class).getTestAtoms(projectId).data
resource?.model?.stages?.forEachIndexed { index, s ->
if (index == 0) (s.containers[0] as TriggerContainer).params.forEach { param ->
param.name = param.name ?: param.id
Expand All @@ -1349,6 +1351,9 @@ class PipelineRepositoryService constructor(
e.customEnv = (e.customEnv ?: emptyList()).plus(oldCustomEnv)
}
e.additionalOptions?.customEnv = null
if (editPermission != true) {
pipelineInfoService.transferSensitiveParam(testAtomCodes ?: emptyList(), e)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ package com.tencent.devops.process.engine.service.record
import com.tencent.devops.common.api.pojo.ErrorInfo
import com.tencent.devops.common.api.util.Watcher
import com.tencent.devops.common.api.util.timestampmilli
import com.tencent.devops.common.client.Client
import com.tencent.devops.common.event.dispatcher.pipeline.PipelineEventDispatcher
import com.tencent.devops.common.pipeline.Model
import com.tencent.devops.common.pipeline.container.Container
Expand Down Expand Up @@ -66,6 +67,7 @@ import com.tencent.devops.process.engine.dao.PipelineTriggerReviewDao
import com.tencent.devops.process.engine.pojo.BuildInfo
import com.tencent.devops.process.engine.service.PipelineBuildDetailService
import com.tencent.devops.process.engine.service.PipelineElementService
import com.tencent.devops.process.engine.service.PipelineInfoService
import com.tencent.devops.process.engine.service.PipelineRepositoryService
import com.tencent.devops.process.engine.utils.ContainerUtils
import com.tencent.devops.process.pojo.BuildStageStatus
Expand All @@ -78,6 +80,7 @@ import com.tencent.devops.process.service.StageTagService
import com.tencent.devops.process.service.record.PipelineRecordModelService
import com.tencent.devops.process.util.BuildMsgUtils
import com.tencent.devops.process.utils.PipelineVarUtil
import com.tencent.devops.store.api.atom.ServiceAtomResource
import java.time.LocalDateTime
import java.util.concurrent.TimeUnit
import org.jooq.DSLContext
Expand Down Expand Up @@ -105,6 +108,8 @@ class PipelineBuildRecordService @Autowired constructor(
private val recordStageDao: BuildRecordStageDao,
private val recordContainerDao: BuildRecordContainerDao,
private val recordTaskDao: BuildRecordTaskDao,
private val client: Client,
private val pipelineInfoService: PipelineInfoService,
recordModelService: PipelineRecordModelService,
pipelineResourceDao: PipelineResourceDao,
pipelineBuildDao: PipelineBuildDao,
Expand Down Expand Up @@ -164,7 +169,8 @@ class PipelineBuildRecordService @Autowired constructor(
buildInfo: BuildInfo,
executeCount: Int?,
refreshStatus: Boolean = true,
queryDslContext: DSLContext? = null
queryDslContext: DSLContext? = null,
sensitiveFlag: Boolean? = true
): ModelRecord? {
// 直接取构建记录数据,防止接口传错
val projectId = buildInfo.projectId
Expand Down Expand Up @@ -246,7 +252,7 @@ class PipelineBuildRecordService @Autowired constructor(
if (!newVarName.isNullOrBlank()) newParams.add(it.copy(id = newVarName)) else newParams.add(it)
}
triggerContainer.params = newParams

val testAtomCodes = client.get(ServiceAtomResource::class).getTestAtoms(projectId).data ?: emptyList()
// #4531 兼容历史构建的页面显示
model.stages.forEach { stage ->
stage.resetBuildOption()
Expand All @@ -256,6 +262,11 @@ class PipelineBuildRecordService @Autowired constructor(
container.fetchGroupContainers()?.forEach { groupContainer ->
fixContainerDetail(groupContainer)
}
if (sensitiveFlag != true) {
container.elements.forEach { e ->
pipelineInfoService.transferSensitiveParam(testAtomCodes, e)
}
}
}
stage.elapsed = stage.elapsed ?: stage.timeCost?.totalCost
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import com.tencent.devops.common.api.enums.RepositoryType
import com.tencent.devops.common.api.util.Watcher
import com.tencent.devops.common.api.util.YamlUtil
import com.tencent.devops.common.client.Client
import com.tencent.devops.common.pipeline.container.Container
import com.tencent.devops.common.pipeline.pojo.PipelineModelAndSetting
import com.tencent.devops.common.pipeline.pojo.element.Element
import com.tencent.devops.common.pipeline.pojo.transfer.ElementInsertBody
Expand All @@ -48,6 +49,7 @@ import com.tencent.devops.common.pipeline.pojo.transfer.TransferResponse
import com.tencent.devops.common.pipeline.pojo.transfer.YamlWithVersion
import com.tencent.devops.process.engine.dao.PipelineInfoDao
import com.tencent.devops.process.engine.dao.PipelineYamlInfoDao
import com.tencent.devops.process.engine.service.PipelineInfoService
import com.tencent.devops.process.pojo.pipeline.PipelineResourceVersion
import com.tencent.devops.process.yaml.pojo.TemplatePath
import com.tencent.devops.process.yaml.pojo.YamlVersion
Expand All @@ -69,6 +71,7 @@ import com.tencent.devops.process.yaml.v3.parsers.template.YamlTemplateConf
import com.tencent.devops.process.yaml.v3.parsers.template.models.GetTemplateParam
import com.tencent.devops.process.yaml.v3.utils.ScriptYmlUtils
import com.tencent.devops.repository.api.ServiceRepositoryResource
import com.tencent.devops.store.api.atom.ServiceAtomResource
import java.util.LinkedList
import org.jooq.DSLContext
import org.slf4j.LoggerFactory
Expand All @@ -86,7 +89,8 @@ class PipelineTransferYamlService @Autowired constructor(
private val yamlIndexService: YamlIndexService,
private val pipelineYamlInfoDao: PipelineYamlInfoDao,
private val client: Client,
private val yamlSchemaCheck: CodeSchemaCheck
private val yamlSchemaCheck: CodeSchemaCheck,
private val pipelineInfoService: PipelineInfoService
) {

companion object {
Expand All @@ -112,7 +116,8 @@ class PipelineTransferYamlService @Autowired constructor(
pipelineId: String?,
actionType: TransferActionType,
data: TransferBody,
aspects: LinkedList<IPipelineTransferAspect> = LinkedList()
aspects: LinkedList<IPipelineTransferAspect> = LinkedList(),
editPermission: Boolean? = null
): TransferResponse {
val watcher = Watcher(id = "yaml and model transfer watcher")
// #8161 蓝盾PAC默认使用V3版本的YAML语言
Expand All @@ -126,6 +131,13 @@ class PipelineTransferYamlService @Autowired constructor(
aspects
)
}
// 无编辑权限需要对流水线插件敏感参数做处理
if (editPermission == false) {
val projectTestAtomCodes = client.get(ServiceAtomResource::class).getTestAtoms(projectId).data
data.modelAndSetting?.model?.stages?.forEach {
transferElementSensitiveParam(projectTestAtomCodes, it.containers)
}
}
PipelineTransferAspectLoader.sharedEnvTransfer(aspects)
when (actionType) {
TransferActionType.FULL_MODEL2YAML -> {
Expand Down Expand Up @@ -200,7 +212,6 @@ class PipelineTransferYamlService @Autowired constructor(
)
val model = modelTransfer.yaml2Model(input)
val setting = modelTransfer.yaml2Setting(input)

logger.info(watcher.toString())
return TransferResponse(
yamlWithVersion = YamlWithVersion(
Expand All @@ -216,6 +227,17 @@ class PipelineTransferYamlService @Autowired constructor(
return TransferResponse()
}

private fun transferElementSensitiveParam(projectTestAtomCodes: List<String>?, containers: List<Container>) {
containers.forEach {
it.elements.forEach { e ->
pipelineInfoService.transferSensitiveParam(
projectTestAtomCodes = projectTestAtomCodes ?: emptyList(),
element = e
)
}
}
}

fun modelTaskTransfer(
userId: String,
projectId: String,
Expand Down Expand Up @@ -244,7 +266,8 @@ class PipelineTransferYamlService @Autowired constructor(
userId: String,
projectId: String,
pipelineId: String,
resource: PipelineResourceVersion
resource: PipelineResourceVersion,
editPermission: Boolean? = null
): PreviewResponse {
val setting = pipelineSettingVersionService.getPipelineSetting(
userId = userId,
Expand All @@ -261,15 +284,20 @@ class PipelineTransferYamlService @Autowired constructor(
val triggerIndex = mutableListOf<TransferMark>()
val noticeIndex = mutableListOf<TransferMark>()
val settingIndex = mutableListOf<TransferMark>()
val yaml = resource.yaml ?: transfer(
userId = userId,
projectId = projectId,
pipelineId = pipelineId,
actionType = TransferActionType.FULL_MODEL2YAML,
data = TransferBody(modelAndSetting)
).yamlWithVersion?.yamlStr ?: return PreviewResponse("")
val yaml = if (editPermission == false || resource.yaml.isNullOrBlank()) {
transfer(
userId = userId,
projectId = projectId,
pipelineId = pipelineId,
actionType = TransferActionType.FULL_MODEL2YAML,
data = TransferBody(modelAndSetting),
editPermission = editPermission
).yamlWithVersion?.yamlStr ?: return PreviewResponse("")
} else {
resource.yaml
}
try {
TransferMapper.getYamlLevelOneIndex(yaml).forEach { (key, value) ->
TransferMapper.getYamlLevelOneIndex(yaml!!).forEach { (key, value) ->
if (key in pipeline_key) pipelineIndex.add(value)
if (key in trigger_key) triggerIndex.add(value)
if (key in notice_key) noticeIndex.add(value)
Expand All @@ -278,7 +306,7 @@ class PipelineTransferYamlService @Autowired constructor(
} catch (ignore: Throwable) {
logger.warn("TRANSFER_YAML|$projectId|$userId", ignore)
}
return PreviewResponse(yaml, pipelineIndex, triggerIndex, noticeIndex, settingIndex)
return PreviewResponse(yaml!!, pipelineIndex, triggerIndex, noticeIndex, settingIndex)
}

fun position(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,23 @@ class UserPipelineTransferResourceImpl @Autowired constructor(
)
)
}
val editPermission = pipelineId?.let {
pipelinePermissionService.checkPipelinePermission(
userId = userId,
projectId = projectId,
pipelineId = it,
permission = AuthPermission.EDIT
)
}
val response = try {
transferService.transfer(userId, projectId, pipelineId, actionType, data)
transferService.transfer(
userId = userId,
projectId = projectId,
pipelineId = pipelineId,
actionType = actionType,
data = data,
editPermission = editPermission
)
} catch (e: PipelineTransferException) {
val elementMsg = I18nUtil.getCodeLanMessage(
messageCode = e.errorCode,
Expand Down
Loading