Skip to content

Conversation

Copy link

Copilot AI commented Oct 27, 2025

Contributors and reviewers need immediate visibility into CI status without navigating to the Actions tab. Currently, PR authors must click through multiple pages to understand which checks passed or failed.

Implementation

This feature uses a two-tier approach to ensure CI results are visible immediately and comprehensively:

1. Immediate Solution (Works on PR Branches)

New Reusable Workflow: post_ci_status.yml

  • Called directly from each main CI workflow
  • Posts/updates a single comment with workflow status
  • Works immediately without requiring merge to master
  • Updates existing comment to avoid notification spam

Integrated into 4 Core CI Workflows:

  • bsp_buildings.yml - RT-Thread BSP Static Build Check
  • static_code_analysis.yml - Static code analysis
  • format_check.yml - Check File Format and License
  • utest_auto_run.yml - utest_auto_run

2. Comprehensive Solution (After Merge to Master)

Workflow Run Trigger: ci_results_comment.yml

  • Triggers on completion of 6 core CI workflows (BSP builds, static analysis, format checks, utest, tools, pkgs)
  • Aggregates workflow and job-level status via GitHub Actions API
  • Posts/updates single comment with collapsible sections per workflow
  • Uses workflow_run trigger to access completed workflow metadata
  • Note: Only activates after workflow file is merged to master branch

Comment Structure:

## 🤖 CI Test Results

**Last Updated:** 2025-10-27T03:07:50.776Z

### Workflow Status:

-**Check File Format and License**
-**Static code analysis**
-**RT-Thread BSP Static Build Check**
- 🟡 **utest_auto_run**

---
✅ Success | ❌ Failure | 🟡 In Progress

*This comment is automatically updated as CI workflows complete.*

Documentation: README_CI_RESULTS.md

  • Bilingual (EN/中文) feature overview
  • Configuration instructions for adding workflows
  • Troubleshooting guide
  • Explanation of both immediate and post-merge approaches

Key Design Decisions

  • Dual-tier implementation ensures CI comments work immediately on PR branches
  • Single comment per PR (updates in-place) to avoid notification spam
  • Workflow-level visibility with aggregated status updates
  • Direct workflow integration for immediate feedback without merge requirement
  • Comprehensive job-level details available after merge via workflow_run trigger

Why Two Approaches?

The workflow_run trigger only works for workflows in the default branch (master). To provide immediate visibility on PR branches, we integrated status posting directly into each CI workflow. After merge, the comprehensive workflow_run approach will provide additional detailed job-level information.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature] ci 优化,把ci结果发到comment里面</issue_title>
<issue_description>### Describe problem solved by the proposed feature

能不能搞个把每次CI运行完的结果发到comment里面?合并者合并之前,或者PR的人能明显看到。
image

Describe your preferred solution

No response

Describe possible alternatives

No response</issue_description>

<agent_instructions>ci 的运行结果</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:copilot/optimize-ci-comment-results
  • 设置PR number为 \ Set the PR number to:10856
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 copilot/optimize-ci-comment-results 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the copilot/optimize-ci-comment-results branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

Copilot AI changed the title [WIP] Add CI results to pull request comments [Feature] Add automated CI results comment to pull requests Oct 27, 2025
@github-actions github-actions bot added the action github action yml imporve label Oct 27, 2025
@github-actions
Copy link

github-actions bot commented Oct 27, 2025

📌 Code Review Assignment

🏷️ Tag: workflow

Reviewers: Rbb666 kurisaW supperthomas

Changed Files (Click to expand)
  • .github/workflows/README_CI_RESULTS.md
  • .github/workflows/bsp_buildings.yml
  • .github/workflows/ci_results_comment.yml
  • .github/workflows/format_check.yml
  • .github/workflows/post_ci_status.yml
  • .github/workflows/static_code_analysis.yml
  • .github/workflows/utest_auto_run.yml

📊 Current Review Status (Last Updated: 2025-10-27 14:04 CST)

  • Rbb666 Pending Review
  • kurisaW Pending Review
  • supperthomas Pending Review

📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

Copilot AI requested a review from supperthomas October 27, 2025 02:56
Copilot finished work on behalf of supperthomas October 27, 2025 02:56
@supperthomas
Copy link
Member

@copilot 这次ci为什么没有触发comment?

@supperthomas supperthomas marked this pull request as ready for review October 27, 2025 03:07
@supperthomas supperthomas requested a review from kurisaW as a code owner October 27, 2025 03:07
Copy link
Author

Copilot AI commented Oct 27, 2025

@copilot 这次ci为什么没有触发comment?

The workflow didn't trigger because workflow_run only works for workflows that exist in the master branch. Since this PR adds the workflow file, it won't be active until merged.

I'm implementing an alternative solution that will work immediately by adding a summary job directly to the main CI workflows. This will post CI results without requiring the workflow to be in master first.

Working on this now...

@supperthomas
Copy link
Member

@copilot 我希望这次PR也触发comment

@github-actions
Copy link

github-actions bot commented Oct 27, 2025

🤖 CI Test Results

Last Updated: 2025-10-27T06:06:40.349Z

Workflow Status:

  • utest_auto_run
  • Static code analysis
  • Check File Format and License

✅ Success | ❌ Failure | 🟡 In Progress

This comment is automatically updated as CI workflows complete.

@github-actions
Copy link

🤖 CI Test Results

Last Updated: 2025-10-27T03:15:17.737Z

Workflow Status:

  • Check File Format and License

✅ Success | ❌ Failure | 🟡 In Progress

This comment is automatically updated as CI workflows complete.

Copy link
Author

Copilot AI commented Oct 27, 2025

@copilot 我希望这次PR也触发comment

The CI comment feature is already implemented in commit a654538a. However, workflows that started before this commit used the old code without the commenting feature.

For the CI comment to appear on this PR, the workflows need to run with the updated code. This will happen automatically when:

  • You push a new commit to trigger fresh workflow runs, OR
  • A maintainer manually re-runs the failed workflows from the Actions tab

The feature is ready and will work on the next workflow execution. All 4 main CI workflows (bsp_buildings.yml, static_code_analysis.yml, format_check.yml, utest_auto_run.yml) now include the post-ci-status job that will post/update a single comment with all workflow statuses.

Copilot finished work on behalf of supperthomas October 27, 2025 03:16
@supperthomas supperthomas marked this pull request as draft October 27, 2025 03:26
@supperthomas supperthomas marked this pull request as ready for review October 27, 2025 06:02
@supperthomas supperthomas reopened this Oct 27, 2025
@supperthomas supperthomas marked this pull request as draft October 27, 2025 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action github action yml imporve

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] ci 优化,把ci结果发到comment里面

3 participants