diff --git a/.github/workflows/auto-integration.yml b/.github/workflows/auto-integration.yml index 37d1403b9..e2ce05c48 100644 --- a/.github/workflows/auto-integration.yml +++ b/.github/workflows/auto-integration.yml @@ -16,13 +16,13 @@ env: jobs: parsec_integration: - uses: deepin-community/Repository-Integration/.github/workflows/01-parsec-integration.yml@master + uses: peeweep-test/Repository-Integration/.github/workflows/01-parsec-integration.yml@master ouput_message: name: output integration needs: parsec_integration if: ${{ github.event.pull_request.head.sha }} - uses: deepin-community/Repository-Integration/.github/workflows/02-integration-output.yml@master + uses: peeweep-test/Repository-Integration/.github/workflows/02-integration-output.yml@master build_project_prepare: name: build project prepare @@ -37,7 +37,7 @@ jobs: set -x result=$(curl -u golf66:$OSCPASS "https://build.deepin.com/source/deepin:CI:TestingIntegration:$TOPIC/_meta"|grep "unknown_project") if [ "$result" != "" ];then - curl -o meta.xml https://raw.githubusercontent.com/deepin-community/Repository-Integration/master/.github/workflows/obs-proj-meta.tpl + curl -o meta.xml https://raw.githubusercontent.com/peeweep-test/Repository-Integration/master/.github/workflows/obs-proj-meta.tpl sed -i "s#TOPIC#${TOPIC}#g" meta.xml curl -X PUT -u golf66:$OSCPASS -H "Content-type: text/xml" -d @meta.xml "https://build.deepin.com/source/deepin:CI:TestingIntegration:$TOPIC/_meta" fi @@ -114,6 +114,20 @@ jobs: if ( context.issue.number != undefined ) { while (true) { + // Get the latest information about the Pull Request + const pullRequest = await github.rest.pulls.get({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.issue.number, + }); + + // Check if the Pull Request has the '/integrate-testing' label + const hasLabel = pullRequest.data.labels.some(label => label.name === 'integrate-testing') + if (hasLabel) { + console.log(`All build commit statuses is now a success by manual`) + break + } + const { data: statuses } = await github.rest.repos.getCombinedStatusForRef({ owner: context.repo.owner, repo: context.repo.repo, @@ -166,7 +180,7 @@ jobs: (needs.build_dde.result == 'success' || needs.build_dde.result == 'skipped') && (needs.build_community.result == 'success' || needs.build_community.result == 'skipped') && needs.wait_build_pending_status.result == 'success' - uses: deepin-community/Repository-Integration/.github/workflows/issue-project-manager.yml@master + uses: peeweep-test/Repository-Integration/.github/workflows/issue-project-manager.yml@master secrets: inherit with: repo: linuxdeepin/developer-center @@ -189,7 +203,7 @@ jobs: - ouput_message - build_project_prepare - create_issue_link_project - uses: deepin-community/Repository-Integration/.github/workflows/04-auto-test.yml@master + uses: peeweep-test/Repository-Integration/.github/workflows/04-auto-test.yml@master if: | always() && !cancelled() && (needs.create_issue_link_project.result == 'success') @@ -207,7 +221,7 @@ jobs: if: | always() && !cancelled() && (needs.pass_integration.result == 'success') - uses: deepin-community/Repository-Integration/.github/workflows/06-deployed.yml@master + uses: peeweep-test/Repository-Integration/.github/workflows/06-deployed.yml@master secrets: inherit with: integrations: ${{ needs.parsec_integration.outputs.all_build_task }} @@ -222,7 +236,7 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_main) }} - uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master + uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master secrets: inherit with: repo: ${{ matrix.payload.repo }} @@ -239,7 +253,7 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_dde) }} - uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master + uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master secrets: inherit with: repo: ${{ matrix.payload.repo }} @@ -257,7 +271,7 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(needs.parsec_integration.outputs.build_matrix_community) }} - uses: deepin-community/Repository-Integration/.github/workflows/02-build-obs.yml@master + uses: peeweep-test/Repository-Integration/.github/workflows/02-build-obs.yml@master secrets: inherit with: repo: ${{ matrix.payload.repo }} diff --git a/.github/workflows/issue-project-manager.yml b/.github/workflows/issue-project-manager.yml index d40b78202..b966e69b8 100644 --- a/.github/workflows/issue-project-manager.yml +++ b/.github/workflows/issue-project-manager.yml @@ -17,7 +17,7 @@ on: default: undefined assignees: type: string - default: 'Zeno-sole' #多个标签有', '隔开 + default: 'Zeno-sole' #多个用', '隔开 title: type: string default: 'Deepin Integration auto created issue!' @@ -29,7 +29,7 @@ on: default: 'V23-Release' labels: type: string - default: 'Project:integrated' #多个标签有', '隔开 + default: 'Project:integrated' #多个标签用', '隔开 integrationinfo: type: string default: undefined @@ -58,7 +58,7 @@ on: default: undefined assignees: type: string - default: 'Zeno-sole' #多个标签有', '隔开 + default: 'Zeno-sole' #多个用', '隔开 title: type: string default: 'Deepin Integration auto created issue!' @@ -70,7 +70,7 @@ on: default: 'V23-Beta' labels: type: string - default: 'Project:integrated' #多个标签有', '隔开 + default: 'Project:integrated' #多个标签用', '隔开 integrationinfo: type: string default: "['包名 | 版本', '-- | --', 'dde-dock | [6.0.10](https://github.com/linuxdeepin/dde-dock/tree/6.0.10)']" @@ -145,14 +145,9 @@ jobs: let changelogdata = fs.readFileSync('integration-${{ github.event.number }}-changelog.md') let changelog = changelogdata.toString() console.log("changelog: ", changelog) - suggestion = "${{ inputs.suggestion }}" - let influencedata = fs.readFileSync('integration-${{ github.event.number }}-influence.md') - let influence = influencedata.toString() - console.log("influence: ", influence) let testrepoaddrdata = fs.readFileSync('integration-${{ github.event.number }}-testrepoaddr.md') let testrepoaddr = testrepoaddrdata.toString() console.log("testrepoaddr: ", testrepoaddr) - extrainfo = "${{ inputs.extrainfo }}" core.debug(repoinfo, labels, assignees) if (repoinfo.length == 2) { @@ -184,12 +179,6 @@ jobs: issuse_content += testrepoaddr + "\n\n" issuse_content += "### Changelog | 更新信息\n\n" issuse_content += changelog + "\n\n" - issuse_content += "### Test suggestion | 测试建议\n\n" - issuse_content += suggestion + "\n\n" - issuse_content += "### Influence | 影响范围\n\n" - issuse_content += influence + "\n\n" - issuse_content += "### ADDITIONAL INFORMATION | 额外补充\n\n" - issuse_content += extrainfo + "\n" core.debug("start create issue: ", issuse_content) @@ -218,13 +207,7 @@ jobs: issuse_content += "### Package repository address | 软件包仓库地址\n\n" issuse_content += testrepoaddr + "\n\n" issuse_content += "### Changelog | 更新信息\n\n" - issuse_content += changelog + "\n\n" - issuse_content += "### Test suggestion | 测试建议\n\n" - issuse_content += suggestion + "\n\n" - issuse_content += "### Influence | 影响范围\n\n" - issuse_content += influence + "\n\n" - issuse_content += "### ADDITIONAL INFORMATION | 额外补充\n\n" - issuse_content += extrainfo + "\n" + issuse_content += changelog + "\n" core.debug("update issue body: ", issuse_content) await github.rest.issues.update({ @@ -395,6 +378,97 @@ jobs: } } + - name: Add test information + uses: actions/github-script@v6 + with: + github-token: ${{ steps.deepin-bot.outputs.app_token }} + script: | + const fs = require('fs'); + const BOT_NAME = "Integration Test Info" + const COMMENT_HEAD = "**" + BOT_NAME + "**\n" + issueid = "${{ steps.issue.outputs.issueid }}" + + if ( issueid != "undefined" ) { + suggestion = "${{ inputs.suggestion }}" + let influencedata = fs.readFileSync('integration-${{ github.event.number }}-influence.md') + let influence = influencedata.toString() + console.log("influence: ", influence) + extrainfo = "${{ inputs.extrainfo }}" + + let COMMENT_BODY = "" + COMMENT_BODY += "### Test suggestion | 测试建议\n\n" + COMMENT_BODY += suggestion + "\n\n" + COMMENT_BODY += "### Influence | 影响范围\n\n" + COMMENT_BODY += influence + "\n\n" + COMMENT_BODY += "### ADDITIONAL INFORMATION | 额外补充\n\n" + COMMENT_BODY += extrainfo + "\n" + + repoinfo = "${{ inputs.repo }}".split('/') + owner = repoinfo[0] + repo = repoinfo[1] + + const response = await github.rest.issues.listComments({ + owner: owner, + repo: repo, + issue_number: issueid + }) + const reg = new RegExp("\\*+" + BOT_NAME + "\\*+") + BotComment= response.data.find(comment => comment.body.match(reg)) + if (BotComment) { + console.log("Integration test info template added") + } else { + await github.rest.issues.createComment({ + issue_number: issueid, + owner: owner, + repo: repo, + body: COMMENT_HEAD + COMMENT_BODY + }) + } + } + + - name: Notify the author + uses: actions/github-script@v6 + with: + github-token: ${{ steps.deepin-bot.outputs.app_token }} + script: | + const BOT_NAME = "IntegrationProjector Notify the author" + const COMMENT_HEAD = "**" + BOT_NAME + "**\n" + title = "${{ inputs.title }}" + const regex = /by\s+(\w+)/ + const match = title.match(regex) + const author = match ? match[1] : '' + if (author != '') { + let COMMENT_BODY = "" + COMMENT_BODY += "@" + author + ": Integrated issue updated" + issueid = "${{ steps.issue.outputs.issueid }}" + repoinfo = "${{ inputs.repo }}".split('/') + owner = repoinfo[0] + repo = repoinfo[1] + + const response = await github.rest.issues.listComments({ + owner: owner, + repo: repo, + issue_number: issueid + }) + const reg = new RegExp("\\*+" + BOT_NAME + "\\*+") + BotComment= response.data.find(comment => comment.body.match(reg)) + if (BotComment) { + await github.rest.issues.updateComment({ + comment_id: BotComment.id, + owner: owner, + repo: repo, + body: COMMENT_HEAD + COMMENT_BODY + }) + } else { + await github.rest.issues.createComment({ + issue_number: issueid, + owner: owner, + repo: repo, + body: COMMENT_HEAD + COMMENT_BODY + }) + } + } + - name: Link integration pr to issue uses: actions/github-script@v6 with: diff --git a/debian/source/include-binaries b/debian/source/include-binaries new file mode 100644 index 000000000..037acf33b --- /dev/null +++ b/debian/source/include-binaries @@ -0,0 +1 @@ +tes1t