Skip to content

Commit

Permalink
Merge pull request #10528 from lockiechen/issue_8125_hotfix
Browse files Browse the repository at this point in the history
Issue 8125 hotfix
  • Loading branch information
bkci-bot authored Jun 19, 2024
2 parents ce21a22 + 6161270 commit 7718de2
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 44 deletions.
16 changes: 12 additions & 4 deletions src/frontend/devops-pipeline/src/components/Outputs/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<template>
<div style="height: 100%;width: 100%;">
<bk-resize-layout :collapsible="true" class="pipeline-exec-outputs" :initial-divide="initWidth" :min="260"
:max="800">
<div style="height: 100%;width: 100%;" v-bkloading="{ isLoading }">
<bk-resize-layout
:collapsible="true"
class="pipeline-exec-outputs"
:initial-divide="initWidth"
:min="260"
:max="800"
>
<aside slot="aside" class="pipeline-exec-outputs-aside">
<div class="pipeline-exec-outputs-filter-input">
<bk-input clearable right-icon="bk-icon icon-search" :placeholder="filterPlaceholder"
Expand Down Expand Up @@ -35,7 +40,7 @@
</div>

</aside>
<section slot="main" v-bkloading="{ isLoading }" class="pipeline-exec-outputs-section">
<section slot="main" class="pipeline-exec-outputs-section">
<iframe-report v-if="isCustomizeReport" ref="iframeReport" :report-name="activeOutput.name"
:index-file-url="activeOutput.indexFileUrl" />
<third-party-report v-else-if="isActiveThirdReport" :report-list="thirdPartyReportList" />
Expand Down Expand Up @@ -430,6 +435,9 @@
},
currentTab: function () {
this.$nextTick(this.init)
},
'$route.params.buildNo' () {
this.$nextTick(this.init)
}
},
mounted () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,9 @@
if (page === 1) {
this.versionList = versions
const releaseVersion = versions.find(item => item.status === VERSION_STATUS_ENUM.RELEASED)
if (releaseVersion.version > this.pipelineInfo.releaseVersion) {
if (releaseVersion?.version > this.pipelineInfo.releaseVersion) {
// HACK: 最新版本变更时,更新当前流水线信息
this.$store.commit(`atom/${UPDATE_PIPELINE_INFO}`, {
version: releaseVersion.version,
versionName: releaseVersion.versionName,
releaseVersion: releaseVersion.version,
releaseVersionName: releaseVersion.versionName
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
>
{{ $t("cancel") }}
</bk-button>

<bk-button
:disabled="saveStatus || !isEditing"
:loading="saveStatus"
Expand Down Expand Up @@ -68,7 +68,7 @@
/>
</span>
</bk-button>

<!-- <more-actions /> -->
<release-button
:can-release="canRelease && !isEditing"
Expand Down Expand Up @@ -266,8 +266,9 @@
this.$store.commit(`atom/${UPDATE_PIPELINE_INFO}`, {
canDebug: true,
canRelease: true,
baseVersion: this.pipelineInfo?.baseVersion ?? this.pipelineInfo?.releaseVersion,
baseVersionName: this.pipelineInfo?.baseVersionName ?? this.pipelineInfo?.releaseVersionName,
baseVersion: this.pipelineInfo?.baseVersion ?? this.pipelineInfo?.releaseVersion ?? this.pipelineInfo?.version,
baseVersionName: this.pipelineInfo?.baseVersionName ?? this.pipelineInfo?.releaseVersionName ?? this.pipelineInfo?.versionName,
baseVersionStatus: this.pipelineInfo?.latestVersionStatus,
version,
versionName
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{{ operateName }}
</RollbackEntry>
<bk-button
v-else-if="onlyBranchPipeline && activePipelineVersion?.version === pipelineInfo?.releaseVersion"
v-else-if="onlyBranchPipeline && activePipelineVersion?.version === releaseVersion"
theme="primary"
outline
v-perm="{
Expand Down Expand Up @@ -164,14 +164,11 @@
return this.isReleaseVersion || !this.pipelineInfo?.baseVersion || this.activePipelineVersion?.baseVersion !== this.pipelineInfo?.baseVersion
},
currentVersion () {
return this.$route.params.version ? parseInt(this.$route.params.version) : this.pipelineInfo.releaseVersion
return this.$route.params.version ? parseInt(this.$route.params.version) : this.releaseVersion
},
releaseVersion () {
return this.pipelineInfo?.releaseVersion
},
releaseVersionName () {
return this.pipelineInfo?.releaseVersionName
},
projectId () {
return this.$route.params.projectId
},
Expand Down Expand Up @@ -228,8 +225,8 @@
name: 'pipelinesEdit'
})
}
if (this.pipelineInfo.releaseVersion !== this.currentVersion) {
this.handleVersionChange(this.pipelineInfo.releaseVersion)
if (this.releaseVersion !== this.currentVersion) {
this.handleVersionChange(this.releaseVersion)
} else {
this.init()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/>
<import-pipeline-popup
:handle-import-success="handleImportModifyPipeline"
:pipeline-id="$route.params.pipelineId"
:pipeline-name="pipelineName"
:is-show.sync="showImportDialog"
></import-pipeline-popup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,30 @@
{{ $t("commitMsgDesc") }}
</span>
</bk-form-item>
<bk-form-item v-if="releaseParams.enablePac" required :label="$t('targetBranch')"
property="targetAction">
<bk-form-item
v-if="releaseParams.enablePac"
required
:label="$t('targetBranch')"
property="targetAction"
>
<bk-radio-group v-model="releaseParams.targetAction">
<bk-radio v-for="option in targetActionOptions" class="pac-pipeline-dest-branch-radio"
:key="option" :value="option">
<bk-radio
v-for="option in targetActionOptions"
class="pac-pipeline-dest-branch-radio"
:key="option"
:value="option"
>
{{ $t(option, [baseVersionBranch]) }}
</bk-radio>
</bk-radio-group>
</bk-form-item>
</div>
</bk-form>
<div v-if="releaseParams.enablePac && !hasOauth" class="pac-oauth-enable"
v-bkloading="{ isLoading: refreshing }">
<div
v-if="releaseParams.enablePac && !hasOauth"
class="pac-oauth-enable"
v-bkloading="{ isLoading: refreshing }"
>
<header>
<bk-button :loading="oauthing" :disabled="oauthing" theme="primary" size="large"
@click="requestOauth">
Expand Down Expand Up @@ -233,7 +244,7 @@
'pipelineSetting'
]),
...mapState('pipelines', ['isManage']),
...mapGetters('atom', ['isBranchVersion', 'pacEnabled', 'yamlInfo']),
...mapGetters('atom', ['pacEnabled', 'yamlInfo']),
...mapState('common', ['pacSupportScmTypeList']),
pacDesc () {
return {
Expand Down Expand Up @@ -286,10 +297,13 @@
]
}
},
isDraftBaseBranchVersion () {
return this.pipelineInfo?.baseVersionStatus === VERSION_STATUS_ENUM.BRANCH
},
targetActionOptions () {
return [
'COMMIT_TO_MASTER',
this.isBranchVersion
this.isDraftBaseBranchVersion
? 'PUSH_BRANCH_AND_REQUEST_MERGE'
: 'CHECKOUT_BRANCH_AND_REQUEST_MERGE'
]
Expand Down Expand Up @@ -377,6 +391,9 @@
if (enablePac) {
this.$nextTick(() => {
this.fetchPacEnableCodelibList(true)
if (this.isDraftBaseBranchVersion) {
this.releaseParams.targetAction = 'PUSH_BRANCH_AND_REQUEST_MERGE'
}
})
}
} catch (error) {
Expand Down Expand Up @@ -482,16 +499,20 @@
}
})
this.$store.commit(`atom/${UPDATE_PIPELINE_INFO}`, {
version,
versionName,
releaseVersion: version,
versionNum,
baseVersion: version,
baseVersionName: versionName,
releaseVersionName: versionName,
...(!targetAction || targetAction === 'COMMIT_TO_MASTER'
? {
releaseVersion: version,
releaseVersionName: versionName,
version,
versionName,
versionNum,
baseVersion: version,
baseVersionName: versionName,
latestVersionStatus: VERSION_STATUS_ENUM.RELEASED
}
: {}),
canDebug: false,
canRelease: false,
latestVersionStatus: VERSION_STATUS_ENUM.RELEASED,
pipelineAsCodeSettings: {
...(this.pipelineInfo.pipelineAsCodeSettings ?? {}),
enable: rest.enablePac
Expand All @@ -505,7 +526,10 @@
const tipsArrayLength = this.releaseParams.enablePac ? 2 : 0
const isPacMR
= this.releaseParams.enablePac
&& this.releaseParams.targetAction === 'CHECKOUT_BRANCH_AND_REQUEST_MERGE'
&& [
'CHECKOUT_BRANCH_AND_REQUEST_MERGE',
'PUSH_BRANCH_AND_REQUEST_MERGE'
].includes(this.releaseParams.targetAction)
const h = this.$createElement
const instance = this.$bkInfo({
width: 600,
Expand Down Expand Up @@ -644,7 +668,7 @@
projectId,
pipelineId,
type: 'pipeline',
version
version: this.pipelineInfo?.releaseVersion
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
title: {
type: String
},
pipelineId: {
type: String
},
pipelineName: {
type: String
},
Expand Down Expand Up @@ -142,11 +145,15 @@
oldYaml: ''
})
} catch (error) {
console.log(error)
this.$showTips({
message: error.message,
theme: 'error'
})
}
this.setPipelineSetting({
...result.setting,
pipelineId: this.pipelineId ?? result.setting.pipelineId,
pipelineName: newPipelineName
})
this.setPipeline(pipeline)
Expand Down
8 changes: 1 addition & 7 deletions src/frontend/devops-pipeline/src/views/subpages/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,12 @@
this.resetHistoryFilterCondition()
this.selectPipelineVersion(null)
this.resetAtomModalMap()
this.setPipeline(null)
this.setPipelineWithoutTrigger(null)
this.setPipelineYaml('')
},
methods: {
...mapActions('pipelines', ['resetHistoryFilterCondition']),
...mapActions('atom', [
'selectPipelineVersion',
'setPipeline',
'setPipelineYaml',
'resetAtomModalMap',
'setPipelineWithoutTrigger'
'resetAtomModalMap'
]),
getNavComponent (type) {
switch (type) {
Expand Down

0 comments on commit 7718de2

Please sign in to comment.