From 7f113b08bdb9db135166164cc6e03f2db5e81c72 Mon Sep 17 00:00:00 2001 From: hudeng Date: Thu, 14 Mar 2024 21:29:48 +0800 Subject: [PATCH 1/6] fix: some typos --- .github/workflows/issue-project-manager.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/issue-project-manager.yml b/.github/workflows/issue-project-manager.yml index d40b78202..9675ca1d6 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)']" From 491bfd3706d40ce7bcb9702d07789e17c3de2b64 Mon Sep 17 00:00:00 2001 From: hudeng Date: Thu, 14 Mar 2024 21:51:48 +0800 Subject: [PATCH 2/6] feat: Add integrated notifications for author MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 并且添加默认的测试信息填写模板 --- .github/workflows/issue-project-manager.yml | 101 +++++++++++++++++--- 1 file changed, 90 insertions(+), 11 deletions(-) diff --git a/.github/workflows/issue-project-manager.yml b/.github/workflows/issue-project-manager.yml index 9675ca1d6..2bef6cb38 100644 --- a/.github/workflows/issue-project-manager.yml +++ b/.github/workflows/issue-project-manager.yml @@ -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) @@ -395,6 +384,96 @@ jobs: } } + - name: Add test information + uses: actions/github-script@v6 + with: + github-token: ${{ steps.deepin-bot.outputs.app_token }} + script: | + 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: From 21c4a4f779a7f70c0d6b41b0a3336e0ecfe4b438 Mon Sep 17 00:00:00 2001 From: hudeng Date: Fri, 15 Mar 2024 15:55:50 +0800 Subject: [PATCH 3/6] feat: Pass waiting when add integrate-testing label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 构建状态同步目前还是不太稳定,并且很多包不能做到全架构的构建支持,需要手动确定,可以通过添加integrate-testing标签的方式手动确认构建通过 --- .github/workflows/auto-integration.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/auto-integration.yml b/.github/workflows/auto-integration.yml index 37d1403b9..05be2fc2c 100644 --- a/.github/workflows/auto-integration.yml +++ b/.github/workflows/auto-integration.yml @@ -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, From bd43a6739e749491fa081bc12b4b2016fcd2ea51 Mon Sep 17 00:00:00 2001 From: hudeng Date: Fri, 15 Mar 2024 15:56:53 +0800 Subject: [PATCH 4/6] save: for test --- .github/workflows/auto-integration.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-integration.yml b/.github/workflows/auto-integration.yml index 05be2fc2c..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 @@ -180,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 @@ -203,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') @@ -221,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 }} @@ -236,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 }} @@ -253,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 }} @@ -271,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 }} From fc1dce53adbc872fe352f7a113bdf605270db9f2 Mon Sep 17 00:00:00 2001 From: hudeng Date: Fri, 15 Mar 2024 16:03:06 +0800 Subject: [PATCH 5/6] save: for test --- .github/workflows/issue-project-manager.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/issue-project-manager.yml b/.github/workflows/issue-project-manager.yml index 2bef6cb38..b966e69b8 100644 --- a/.github/workflows/issue-project-manager.yml +++ b/.github/workflows/issue-project-manager.yml @@ -207,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({ @@ -389,6 +383,7 @@ jobs: 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 }}" From 4d2d577462b5caa5e8ae0445f31165ceb54dc334 Mon Sep 17 00:00:00 2001 From: hudeng Date: Tue, 19 Mar 2024 16:15:50 +0800 Subject: [PATCH 6/6] test include-binaries --- debian/source/include-binaries | 1 + 1 file changed, 1 insertion(+) create mode 100644 debian/source/include-binaries 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