Repository navigation
[CI] Upload full coverage files to BOS in Coverage workflow - #79920
Open
liuhao2638 wants to merge 1 commit into
Open
liuhao2638 wants to merge 1 commit into
liuhao2638 wants to merge 1 commit into
Conversation
Contributor
Paddle-Bot Review Board (review完成)
可维护性建议(总分 89.7 / 100,只给建议,不影响评审结论)
各维度得分(仅评本 PR 改动,点击展开)
Powered by Nyanpasu claude with Opus 5.5 默认推理级别, please check the suggestions carefully. |
Comment on lines
+434
to
+436
| if [ -f "$f" ]; then | ||
| python ${{ env.bos_file }} $f paddle-github-action/PR/coverage/${PR_ID}/${COMMIT_ID} | ||
| echo "https://paddle-github-action.bj.bcebos.com/PR/coverage/${PR_ID}/${COMMIT_ID}/$f" |
Contributor
There was a problem hiding this comment.
上传失败会被静默吞掉:循环里没有检查
BosClient.py 的退出码,上传失败后第 436 行仍会打印下载 URL;而且这段 bash 的最后一条命令是 done(退出码取自 echo),docker exec 总是返回 0,continue-on-error: true 实际上永远不会生效,步骤在上传失败时仍显示成功。覆盖率平台按 commit 读取这些文件,缺文件时从步骤状态和日志都看不出原因。
建议记录失败、只在成功时打印 URL,并在循环结束后以非零退出(continue-on-error 仍保证不影响覆盖率检查):
rc=0
for f in coverage-full.info python-coverage-full.info python-coverage.xml; do
if [ -f "$f" ]; then
if python ${{ env.bos_file }} "$f" paddle-github-action/PR/coverage/${PR_ID}/${COMMIT_ID}; then
echo "https://paddle-github-action.bj.bcebos.com/PR/coverage/${PR_ID}/${COMMIT_ID}/$f"
else
echo "upload $f failed"; rc=1
fi
else
echo "$f not found, skip"
fi
done
exit $rc
Comment on lines
+423
to
+431
| source ${{ github.workspace }}/../../../proxy | ||
| python -m pip install -q bce-python-sdk==0.8.74 | ||
| export AK=paddle | ||
| export SK=paddle | ||
| if [ ! -f "${{ env.bos_file }}" ]; then | ||
| wget -q --no-proxy -O ${{ env.home_path }}/bos_retry.tar.gz https://xly-devops.bj.bcebos.com/home/bos_retry.tar.gz --no-check-certificate | ||
| mkdir -p ${{ env.home_path }}/bos_retry | ||
| tar xf ${{ env.home_path }}/bos_retry.tar.gz -C ${{ env.home_path }}/bos_retry | ||
| fi |
Contributor
There was a problem hiding this comment.
💡 可维护性建议(抽象适配度,不阻塞合入):第 423-431 行的 BOS 上传引导(source proxy、安装 bce-python-sdk==0.8.74、导出 AK/SK、按需下载并解压 bos_retry)与同文件 build job 的 Upload coverage product(第 225-234 行)几乎逐行重复,且已出现分叉(pip -q、mkdir -p、缺少 ::group::)。建议抽成 ci/ 下的共享脚本或 .github/actions/ 复合 action,两处只传文件列表和目标前缀,后续升级 SDK 版本或下载地址时只需改一处。
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Execute Infrastructure
PR Types
Devs
Description
Coverage.yml的 Coverage test job 新增Upload full coverage to BOS步骤,把check_coverage在build/下生成的全量覆盖率文件按 PR/commit 上传到 BOS,供覆盖率平台按 commit 读取(PaddleFleet 已按同样方式上传):coverage-full.info(C++)python-coverage-full.info(Python)python-coverage.xml(Python)路径:
https://paddle-github-action.bj.bcebos.com/PR/coverage/${PR_ID}/${COMMIT_ID}/<file>,与同 workflow 中 build job 上传 whl 的目录相同,复用其bos_retry/BosClient.py和凭据。步骤放在
Generate coverage information之后、90% 判定之前,带if: always()和continue-on-error: true:文件不存在时跳过,上传失败不影响覆盖率检查结果。是否引起精度变化
否