fix(ci): notify on jakarta build failures instead of dead main guard - #212
Merged
Merged
Conversation
The failure notification was gated on BRANCH_NAME == 'main', which is never true on the active jakarta line, so build failures never alerted anyone. Gate on branch-api's BRANCH_IS_PRIMARY flag so the guard survives a default branch rename, with a literal jakarta fallback for non-multibranch jobs where that variable is absent. Co-authored-by: Claude Opus 4.8 <[email protected]>
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.
Refs #197 (COR-02 only)
問題
Jenkinsfile的失敗通知守衛寫死在BRANCH_NAME == 'main',但這個 repo 的預設分支與作用線是jakarta,該條件永遠不成立——jakarta上的 build 失敗從來沒有通知過任何人。改動
守衛改為
env.BRANCH_IS_PRIMARY == 'true' || env.BRANCH_NAME == 'jakarta':BRANCH_IS_PRIMARY由 multibranch 的 branch-api 在 SCM 預設分支上設為'true',之後預設分支若改名不必再回來改這裡;Jenkinsfile單檔,+4/-1。與 #206 的關係
本 PR 從 #206 抽出 COR-02 這一項單獨處理。#206 另外兩項經評估後決定不做:
#206 將關閉,理由記錄於該 PR 與 #197。
驗證
Jenkins pipeline 語法無法在本機執行,改動本身是單一條件式重寫、不涉及 Java 原始碼,未跑
make test。實際生效需待合併後由jakarta上一次真實的 build 失敗驗證。