fix: Renovate PRのTracking自動更新が動作しない不具合を修正 - #4
Merged
Conversation
GraphQL APIではRenovate botのauthor.loginは"renovate"(Bot型)で返るが、 フィルタが"renovate[bot]"(REST/UI表記)と比較していたため常に不一致となり、 Status=DoneのRenovate PRがあってもTrackingがClosedに更新されず素通りしていた。 両表記にマッチさせ、content=nullの項目でも落ちないよう修正。
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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.
概要
スケジュール実行される Renovate PR の Tracking 自動更新ワークフロー (
update-renovate-tracking.yml) が、対象の Renovate PR を1件も拾えず何もせずに終了していた不具合を修正します。ジョブ自体は成功(緑)で終わるため気づきにくく、ログ上は
Found 0 Renovate PR(s) in project.→Nothing to do.となっていました。失敗時の挙動例(本来 Tracking=Closed にすべき Done の Renovate PR がある状態でも 0件判定):
https://github.com/ut-issl/sw-integration-task-list/actions/runs/30964202428/job/92174496987
原因
Renovate PR の抽出フィルタが author を
renovate[bot]で比較していました:しかし GraphQL API では Renovate bot の
author.loginはrenovate(Bot型) で返ります。renovate[bot]は REST API / GitHub UI 上の表記であって GraphQL とは一致しないため、フィルタが常に false になり全件除外されていました。実測:
{"pullRequest":{"number":109,"author":{"__typename":"Bot","login":"renovate"}}}修正内容
GraphQL 表記 (
renovate) と REST/UI 表記 (renovate[bot]) の両方にマッチさせ、contentが null の項目でも落ちないようにしました:テスト
renovate/renovate[bot]両方の PR がヒット、人間の PR・content:nullの項目は除外、Done→Closed/ それ以外→Trackedのロジックも期待通り。python3 -c yaml.safe_loadおよびactionlintパス。影響範囲
sw-integration-task-listのrenovate-tracking-update.yml) は@main参照のため、main マージ後の次回スケジュール実行(毎日 0:00 UTC)から有効になります。update-tracking-status.ymlは REST のq=フィルタ方式で author 判定を使っておらず、本不具合の影響はありません。