[Bug] 自动格式化工作流只读取第一页,PR 变更超过 30 个文件时会漏掉待格式化文件
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read .github/workflows/pr_clang_format.yml, especially the file-list request around lines 113–125, and check how it handles GitHub REST API pagination and request failures. Reproduce with a PR that changes more than 30 files and has a C or C++ file on a later page. Done when all pages are included, formatting failures are reported clearly, and the later-page file is checked.
Written by the indexing model from the issue text.
Description
RT-Thread Version
RT-Thread Version:master @ fbdb9711;复现 PR #12090,分支提交 8809d3c
Affected area
CI / GitHub Actions
Hardware/BSP vendor
Not applicable / Other
Architecture
Not applicable / Other
Board and hardware details
不涉及开发板或外设
Develop Toolchain
Other
Describe the bug
复现步骤
对一个变更超过 30 个文件的 PR,在 fork 上手动运行 Code Format with Clang-Format。以 RT-Thread/rt-thread#12090(head: 8809d3c)为例,该 PR 有 46 个变更文件。
实际结果
自动格式化日志显示只取到了 30 个文件。第一页里没有 components/drivers/can/utest/can_framework_tc.c,所以此文件根本没有被格式化。工作流最后显示「代码无需格式化」,并跳过提交和推送。与此同时,上游格式检查仍在该文件第 102–112 行报错。
上游的 pr_clang_format.yml也只请求了一次 PR 文件列表,没有读取后续页面。该接口默认每页返回 30 项。
预期结果
获取 PR 的全部文件页,再按现有规则筛选并格式化 C/C++ 文件。如果分页请求失败,应明确报错,不应在文件列表不完整时报告「代码无需格式化」。
Other additional context
建议按 GitHub REST API 的分页信息读取所有页面,不只把每页上限调大。验证时可以找一个变更超过 30 个文件、且待格式化的 C 文件在第二页的 PR,确认该文件被纳入格式化列表。
- Dominant language
- C
- Stars
- 12.4k
- Forks
- 5.5k
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 80
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RT-Thread/rt-thread
-
Arch: ARM/AArch64 BSP BSP: GD32 bug Component component: drivers
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
RT-Thread/rt-thread#12109 · 3 comments ·
Maintainers usually reply within 2 days
-
action bug
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
RT-Thread/rt-thread#12102 · 1 comment ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
RT-Thread/rt-thread#11951 · 2 comments ·
Maintainers usually reply within 2 days
-
[Bug] [libc] timer_gettime 拆秒前将总纳秒截断为 uint32_t,剩余时间查询错误May be free again @Yunlk claimed this 39 days ago, and no pull request is open. Openin progress
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
RT-Thread/rt-thread#11924 · 7 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
[Bug] dfs_v2 tmpfs: ftruncate(fd, 0) frees the file buffer but reports success — use-after-free read/write and double free from a legal POSIX callPossibly taken @remukisama claimed this 43 days ago. Openin progress
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RT-Thread/rt-thread#11902 · 4 comments · 1 assignee ·
Maintainers usually reply within 2 days
All issues in RT-Thread/rt-thread
Similar issues
-
docs
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 61/100
Maintainers usually reply within 13 days
-
threadpool: a failed `pthread_cond_wait` makes Mlucas hang instead of stoppingPossibly taken @leinardi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
primesearch/Mlucas#398 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
slice
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Life-Framework/Life-Framework#6380 · 1 comment ·
Maintainers usually reply within 1 day