Ci/judge commits not pr title - #535
Merged
Merged
Conversation
Fix(zh-Hant): CI 不再檢查 PR 標題與描述,只檢查分支上每一則 commit Fix(en-US): CI no longer checks the PR title and body, only the commits on the branch The title defaults to the branch name — `Fix/version week` — and the body can be empty, so the gate was failing pull requests over two fields nobody wrote. The commits are the thing somebody actually wrote, and they were already being judged. What this gives up has to be said plainly: a squash merge commits the title and body, not those commits, so squashing now writes an unread message to main. The only backstop is main's own push event running the gate again, which is detection after the fact. Merge by rebase and what lands is what was judged — and each commit keeps its own changelog entries and its own snapshot marker instead of collapsing them into one.
Fix(zh-Hant): 修正 Linux 上會誤判「SDK 未安裝」而拒絕執行 Fix(en-US): fix the toolchain guard wrongly refusing to run on Linux `mise exec` runs a binary, not a shell line, and `command` is a shell builtin. macOS happens to ship /usr/bin/command as a real executable and Linux does not, so `mise exec -- command -v flutter` answered correctly on a laptop and answered nothing on every Linux runner — which the guard then reported as "the SDK is not installed", on a runner where mise had installed it. That is exactly the works-here-fails-there this function exists to stop, so it now asks mise directly, and the message says what it probed rather than asserting a cause it did not establish.
|
🔍 OpenCodeReview found 5 issue(s) in this PR.
|
Fix(zh-Hant): Android 與 iOS 的建置改用釘選的 Flutter 版本,不再跟著當日 stable 走 Fix(en-US): the Android and iOS builds now use the pinned Flutter, not whatever stable is today Both jobs used subosito/flutter-action with `channel: stable`, which resolves to whatever stable is on the day. They were the last two places shipping artifacts built against an SDK nobody chose, and nothing in a build log says which SDK produced it — the whole reason the pin exists. They now install mise and call the same tool/ scripts a developer calls. The iOS SPM cache was also pointing at DerivedData, which flutter never uses for packages: it always passes -clonedSourcePackagesDirPath = build/ios/SourcePackages. The cache stored nothing, so every run paid the cold resolve the cache was added to avoid — 19-32 s, measured. `tool/dev/build.sh ios` drops its hardcoded --release, which would have fought the --debug the iOS smoke-test build passes. `flutter build ios` is release by default, so nothing else changes.
Comment on lines
93
to
104
| @@ -102,7 +104,7 @@ jobs: | |||
| EOF | |||
There was a problem hiding this comment.
秘密應透過 env: 區塊傳遞給需要的步驟,而不是直接在 run: 中使用 ${{ secrets.X }}。這可以避免秘密意外洩露到日誌中,並符合安全最佳實踐。
Suggestion:
Suggested change
| - name: Decode keystore | |
| run: | | |
| echo "$KEYSTORE_BASE64" | base64 --decode > android/app/my-release-key.jks | |
| env: | |
| KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} | |
| - name: Create key.properties | |
| run: | | |
| cat > android/key.properties << EOF | |
| storePassword=$KEYSTORE_PASSWORD | |
| keyPassword=$KEY_PASSWORD | |
| keyAlias=$KEY_ALIAS | |
| storeFile=my-release-key.jks | |
| EOF | |
| env: | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} |
Comment on lines
+44
to
+45
| - name: Install toolchain (mise) | ||
| uses: jdx/mise-action@v4 |
There was a problem hiding this comment.
Fix(zh-Hant): 修正更新日誌的署名會在超過 30 則 commit 或被限流時無聲消失 Fix(en-US): release-note attribution no longer disappears silently past 30 commits or under a rate limit Three faults, all of which produced a release note that looked finished and credited nobody. Actions does not put GITHUB_TOKEN in the environment; a step has to ask, and this one never did. So `authors_of` resolved every pull request unauthenticated, at 60 requests an hour shared across everything on that runner's IP. That limit is not theoretical: the API answered 403 while this was being written, with 0 of 60 remaining. The commits endpoint pages at 30 by default and nothing said so, so a pull request with more commits than that lost every author past the thirtieth. The last one had 63. It asks for 100 now, which is the maximum; the endpoint itself stops at 250 whatever is asked for, and past that the co-author trailers are the only record left. And every failure was silent — `2>/dev/null || true` over a body that parses whether it is a commit list or an error object. It now reads the status and says which call failed and why, because a note with no attribution and no complaint is indistinguishable from a release nobody contributed to.
Fix(zh-Hant): 修正換行的更新日誌條目在發布時被從中間截斷 Fix(en-US): a wrapped changelog entry is no longer published cut off mid-sentence The extractor's regex is whole-line and commit.md's own example wraps an entry across two lines, so the indented remainder matched nothing and was dropped in silence. Three English sentences shipped in 26w34b ending mid-clause — "a large event is shown at full extent on the monitor and the" — with "replay map" left behind in the commit nobody reads. Nothing failed. The note built, the release published, and the only symptom was a sentence that stops. So the body is folded before extraction: an indented line continues the one above it, which is what the format already documented and the tool did not implement. A blank line still ends an entry, so the prose an author writes underneath is not swallowed into it.
Comment on lines
+44
to
+45
| - name: Install toolchain (mise) | ||
| uses: jdx/mise-action@v4 |
Comment on lines
+22
to
+27
| final start = script.indexOf("git log -1 --format=%b \"\$sha\" | awk '"); | ||
| expect(start, isNot(-1), reason: 'the fold is no longer where it was'); | ||
| final awk = script.substring( | ||
| script.indexOf("'", start) + 1, | ||
| script.indexOf("')", start), | ||
| ); |
Comment on lines
+42
to
+44
| bool isEntry(String line) => RegExp( | ||
| r'^(New|Optimization|Fix)\(([A-Za-z]{2,3}(-[A-Za-z0-9]+)*)\):\s*(.+)$', | ||
| ).hasMatch(line); |
lowrt
approved these changes
Aug 18, 2026
Only rebase merging is allowed now, so a commit on main is the commit somebody wrote and its author is the author. The path that resolved `(#N)` back to a pull request's own commits existed because a squash sets the author to whoever pressed merge; with squashing off it answers a question nobody asks any more. The cost is taken deliberately, not overlooked: the 282 commits already on main that arrived by squash keep their merge-time author. Trailers still rescue the ones that have them — `41a3c1e8` still credits @PiscesXD — but only 7 of the most recent 40 do, and `c5fdbd31` in the next note will credit the merger for 53 entries somebody else wrote. The comments that still described squashing went with it: the gate's `--message` mode is a draft validator now and says so, and its failure no longer tells anyone to go edit a pull request title.
Comment on lines
+44
to
+45
| - name: Install toolchain (mise) | ||
| uses: jdx/mise-action@v4 |
Comment on lines
+22
to
+27
| final start = script.indexOf("git log -1 --format=%b \"\$sha\" | awk '"); | ||
| expect(start, isNot(-1), reason: 'the fold is no longer where it was'); | ||
| final awk = script.substring( | ||
| script.indexOf("'", start) + 1, | ||
| script.indexOf("')", start), | ||
| ); |
Comment on lines
+85
to
+88
| final body = | ||
| Process.runSync('git', ['log', '-1', '--format=%b', '41a3c1e8']).stdout | ||
| as String; | ||
| if (body.trim().isEmpty) return; // shallow clone |
Comment on lines
+154
to
+155
| status="${body##*$'\n'}" | ||
| body="${body%$'\n'*}" |
There was a problem hiding this comment.
Comment on lines
+257
to
+261
| body="$(git log -1 --format=%b "$sha" | awk ' | ||
| /^[[:space:]]+[^[:space:]]/ && held { sub(/^[[:space:]]+/, " "); printf "%s", $0; next } | ||
| { if (held) printf "\n"; printf "%s", $0; held = 1 } | ||
| END { if (held) printf "\n" } | ||
| ')" |
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 做了什麼
相關 issue
怎麼驗
檢查清單
tool/check/commits.sh origin/main..HEAD通過—— commit 訊息就是更新日誌,格式見 commit.md
mise exec -- flutter analyze與mise exec -- flutter test通過AppLocalizations,沒有寫死AppSpacing/AppRadius/AppMotion,深色模式看過,文字對比度可接受