Skip to content

ci: specify bash shell for deepin build step - #346

Merged
BLumia merged 1 commit into
linuxdeepin:masterfrom
18202781743:master
Sep 20, 2026
Merged

BLumia merged 1 commit into
linuxdeepin:masterfrom
18202781743:master

Conversation

@18202781743

@18202781743 18202781743 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor
  1. Add explicit shell: bash to the "Build qt5platform-plugins deb packages" step in the Deepin build workflow
  2. The step relies on bash-specific features such as PIPESTATUS and pipefail-style handling of the tee pipeline
  3. Without an explicit shell, GitHub Actions may default to sh on some runners, causing PIPESTATUS to be unavailable and the build status check to fail or behave incorrectly
  4. Ensures consistent behavior across runner environments when capturing the build exit status

Influence:

  1. Trigger the qt5platform-plugins-deepin-build workflow and confirm it starts successfully
  2. Verify the build step runs with bash and that PIPESTATUS is correctly evaluated
  3. Test the failure path by intentionally causing dpkg-buildpackage to fail and confirm /tmp/build.log is printed and the job fails
  4. Verify the success path produces packages without spurious failure
  5. Confirm no regressions on runners where sh was previously used

ci: 为 deepin 构建步骤指定 bash shell

  1. 在 Deepin 构建工作流的 "Build qt5platform-plugins deb packages" 步骤 中显式添加 shell: bash
  2. 该步骤依赖 bash 特有的功能,例如 PIPESTATUS 以及 tee 管道的错误处理
  3. 如果不显式指定 shell,GitHub Actions 在某些运行器上可能默认使用 sh, 导致 PIPESTATUS 不可用,从而使构建状态检查失败或行为异常
  4. 确保在不同运行器环境下捕获构建退出状态时行为一致

Influence:

  1. 触发 qt5platform-plugins-deepin-build 工作流,确认其能正常启动
  2. 验证构建步骤使用 bash 运行,且 PIPESTATUS 能被正确求值
  3. 通过故意让 dpkg-buildpackage 失败来测试失败路径,确认会打印 /tmp/ build.log 并使任务失败
  4. 验证成功路径能正常产出软件包且不会误报失败
  5. 确认在之前使用 sh 的运行器上不会出现回归问题

Summary by Sourcery

Ensure the Deepin package build workflow uses Bash for reliable build status reporting.

Bug Fixes:

  • Run the Deepin Debian package build step with Bash so its pipeline exit-status handling works consistently across GitHub Actions runners.

CI:

  • Specify Bash explicitly for the Deepin build workflow's package compilation step.

1. Add explicit shell: bash to the "Build qt5platform-plugins deb
packages" step in the Deepin build workflow
2. The step relies on bash-specific features such as PIPESTATUS and
pipefail-style handling of the tee pipeline
3. Without an explicit shell, GitHub Actions may default to sh on some
runners, causing PIPESTATUS to be unavailable and the build status check
to fail or behave incorrectly
4. Ensures consistent behavior across runner environments when capturing
the build exit status

Influence:
1. Trigger the qt5platform-plugins-deepin-build workflow and confirm it
starts successfully
2. Verify the build step runs with bash and that PIPESTATUS is correctly
evaluated
3. Test the failure path by intentionally causing dpkg-buildpackage to
fail and confirm /tmp/build.log is printed and the job fails
4. Verify the success path produces packages without spurious failure
5. Confirm no regressions on runners where sh was previously used

ci: 为 deepin 构建步骤指定 bash shell

1. 在 Deepin 构建工作流的 "Build qt5platform-plugins deb packages" 步骤
中显式添加 shell: bash
2. 该步骤依赖 bash 特有的功能,例如 PIPESTATUS 以及 tee 管道的错误处理
3. 如果不显式指定 shell,GitHub Actions 在某些运行器上可能默认使用 sh,
导致 PIPESTATUS 不可用,从而使构建状态检查失败或行为异常
4. 确保在不同运行器环境下捕获构建退出状态时行为一致

Influence:
1. 触发 qt5platform-plugins-deepin-build 工作流,确认其能正常启动
2. 验证构建步骤使用 bash 运行,且 PIPESTATUS 能被正确求值
3. 通过故意让 dpkg-buildpackage 失败来测试失败路径,确认会打印 /tmp/
build.log 并使任务失败
4. 验证成功路径能正常产出软件包且不会误报失败
5. 确认在之前使用 sh 的运行器上不会出现回归问题
@sourcery-ai

sourcery-ai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The Deepin CI workflow now explicitly runs the Debian package build step with Bash, ensuring PIPESTATUS-based failure detection works consistently across GitHub Actions runners while retaining build-log capture and failure reporting.

Sequence diagram for the Bash-controlled Deepin package build

sequenceDiagram
    participant Actions as GitHubActions
    participant Bash
    participant Builder as dpkg-buildpackage
    participant Tee as tee
    participant Log as build.log

    Actions->>Bash: run build step
    Bash->>Builder: dpkg-buildpackage -uc -us -b
    Builder-->>Tee: build output and exit status
    Tee->>Log: write /tmp/build.log
    Bash->>Bash: PIPESTATUS[0]
    alt build failed
        Bash->>Log: print /tmp/build.log
        Bash-->>Actions: fail job
    else build succeeded
        Bash-->>Actions: continue successfully
    end
Loading

File-Level Changes

Change Details Files
Make the Deepin package build step explicitly use Bash so its pipeline status handling is portable and reliable.
  • Set shell: bash on the package build step.
  • Preserve use of PIPESTATUS to capture dpkg-buildpackage’s exit status while logging output through tee.
.github/workflows/qt5platform-plugins-deepin-build.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@18202781743
18202781743 requested a review from BLumia September 20, 2026 06:25
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次变更在 .github/workflows/qt5platform-plugins-deepin-build.yml 的 "Build qt5platform-plugins deb packages" 步骤中显式添加 shell: bash,修复了依赖 bash 特有变量 PIPESTATUS 的构建状态捕获逻辑在不保证 bash 的运行器环境(sh/dash 回退)下失效的问题。变更最小化、目的明确、与 commit message 描述完全一致,四维度均无问题,未发现安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

变更分析: .github/workflows/qt5platform-plugins-deepin-build.yml 第 41 行,在 Build qt5platform-plugins deb packages 步骤中新增 shell: bash。该修复有效:当运行器/容器环境回退到 sh(dash) 时,第 43 行的 ${PIPESTATUS[0]} 会展开为空,导致 [ $BUILD_STATUS -ne 0 ] 因缺少操作数而报错、构建状态判断失效;显式指定 bash 后 PIPESTATUS 可正确求值。YAML 语法正确,shell 是 step 的合法键。

潜在问题:
1.未发现语法或逻辑问题。shell: bash 与 run 块配合位置正确,且 deepin:crimson 容器镜像内含 bash,不会引入新的失败点。

建议: 无需修改。现有实现已通过 tee 管道 + PIPESTATUS[0] + exit $BUILD_STATUS 正确传播构建退出码。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

变更分析: 变更最小化(单文件、单行、单一目的),不影响工作流中其他步骤;commit message 以中英文详细说明变更原因(bash 特有的 PIPESTATUS)、风险场景及验证方案(成功/失败路径、回归确认),可维护性良好。

潜在问题:
1.未发现质量问题。

建议: 无需修改。可选优化:后续维护该工作流时,可在其他同样使用 bash 特性的步骤中统一显式声明 shell: bash,保持风格一致。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

变更分析: 单行配置变更,不增加任何构建开销;显式指定 bash 反而避免了 sh 回退环境下构建状态判断失效导致的无效重跑。

潜在问题:
1.未发现性能问题。

建议: 无需修改。


4. 代码安全 🔒

评价: 存在0个安全漏洞 优秀 ✅ 通过

变更分析: 本次变更不涉及用户输入处理、密钥、权限(permissions)变更或外部命令注入面,未引入任何新的攻击面。

🔐 存在 0 个安全漏洞

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无需修改。存量提示(非本次变更引入,不计入评分):工作流中 apt 源使用 [trusted=yes] 与 http 明文镜像,建议后续迭代评估切换为带签名校验的 https 源。


💡 改进建议代码示例

# .github/workflows/qt5platform-plugins-deepin-build.yml
# 显式指定 bash,保证 PIPESTATUS 在所有运行器/容器环境下可用

      - name: Build qt5platform-plugins deb packages
        shell: bash
        run: |
          dpkg-buildpackage -uc -us -b 2>&1 | tee /tmp/build.log; BUILD_STATUS=${PIPESTATUS[0]}
          if [ $BUILD_STATUS -ne 0 ]; then
            echo "❌ Build failed! Last 200 lines of build log:"
            tail -200 /tmp/build.log
            exit $BUILD_STATUS
          fi
          echo "✅ qt5platform-plugins deb packages built successfully!"
          ls -la ../

本报告由 AI 代码审查工具自动生成

@BLumia
BLumia merged commit 542e55a into linuxdeepin:master Sep 20, 2026
9 checks passed
@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants