fix(elixir): auto-merge lock file maintenance, and narrow its window - #166
Conversation
A lock file refresh carries no datasource, so matchDatasources on the rule above -- which is deliberate, keeping git dependencies out of the auto-merged lane -- never let lockFileMaintenance match it. Naming lockFileMaintenance in that rule's matchUpdateTypes did nothing, and the mix lock refreshes have sat unmerged since 2026-08-30 while the npm ones, whose rule carries no datasource filter, merged the same week. Give it its own rule rather than widening the existing one. Narrow the window to one day for the reason recorded in #157 and applied to latex.json in #158: lock file maintenance is not an item a job can exhaust but the difference between the committed lock file and the registry, so merging it restores that difference within hours and the next job inside a two-day window has something to create again. That did not surface here only because nothing was merging. Five hours still exceeds the four-hour job interval, so the window cannot fall between two jobs. Refs #157
| "description": "Auto-merge lock file maintenance too. It cannot ride on the rule above: a lock file refresh carries no datasource, so matchDatasources there -- which is deliberate, keeping git dependencies out of the auto-merged lane -- excludes it. Naming lockFileMaintenance in that rule's matchUpdateTypes therefore did nothing, and the mix lock refreshes sat unmerged from 2026-08-30 while the npm ones, whose rule has no datasource filter, merged the same week.", | ||
| "matchManagers": ["mix"], | ||
| "matchUpdateTypes": ["lockFileMaintenance"], | ||
| "automerge": true |
There was a problem hiding this comment.
matchDatasources が存在しないことは意図的(lockFileMaintenance はデータソースを持たないため)ですが、matchPackagePatterns や matchDepTypes などの追加フィルタも一切ないため、mix マネージャーが管理するすべてのリポジトリの lockFileMaintenance PR が無条件に automerge されます。
PR 本文では「git 依存を自動マージ対象から外す意図」に言及していますが、lockFileMaintenance の場合は git 依存のバージョン固定も lock ファイルに含まれます。git 依存が含まれるリポジトリで lock ファイルが更新された場合、その変更も自動マージされることになります。
意図的にそれを許容するのであれば、description にその旨を明記しておくと、将来の読者が誤解しにくくなります。
DNS 系からの実測データ
1. 窓を狭めても不利益がない2 日窓の状態で、過去に作られた lockfile PR は 8/16 の 1 回だけです。 Elixir 側は依存本数が少なく transitive の入れ替わりもほとんどないため、週 1 本で困る事情はないとのことです。npm 系(textlint 9 パッケージ+その transitive)とは規模が違います。 2. DNS 系でも automerge は効いていませんでした上の merge 時刻がそれを示しています。4 リポジトリのマージが 01:53:32 / 01:53:37 / 01:55:22 / 01:55:26 と 2 分間に集中している一方、作成からは 8〜9 時間空いています。 Renovate の job による自動マージなら各リポジトリの job タイミングに散るはずで、この集中は人が続けて操作した形です。 つまりこの PR は、Elixir 系 4 ツールの停止を解くだけでなく、DNS 系で毎回発生していた手動マージも不要にします。 3. 差分ゼロの PR が実在しました
lockfile に差がない状態でも lock file maintenance の PR が作られたことになります。#157 に書いた「マージすると差が復活し、窓の中の次の job がまた作る」の裏返しで、差がなくても作るなら窓を狭める理由がもう一つ増えます。 ただし作成の 8 時間後にマージされているので、作成時点では差があり、その間に別経路で同じ状態になった可能性も残ります。断定はできません。 窓を狭める判断はこれに依存しないので、深追いはしていません。 |
The window moved in #166 and again here, and neither change left a trace in this file: description[3] explains the two-day top-level window and says nothing about the one lockFileMaintenance carries. Reading elixir.json alone gave no reason for `after 6am and before 12pm on sunday`. Split across two entries -- why it is narrower than the window above, and why it sits in daylight -- rather than one, which would have run half again as long as anything else here. Refs #157
* fix: move the lock file maintenance windows into daylight The five-hour window from midnight caught nothing. On 2026-09-04 texlive-ja-textlint's jobs completed at 07:57, 11:57, 14:57, 17:57 and 21:57 in Tokyo, and the one before 07:57 was the previous day: the interval is three to four hours through the day but stretches overnight, so a window running 00:00-05:00 sits in the gap. The update spent the whole of Friday under Awaiting Schedule and no pull request was created. #158 justified five hours by comparing it against a four-hour interval read off the documentation. The average was right and the placement was not, and an average cannot tell you whether a particular five hours is reachable. Six hours from 6am takes in two jobs, which is what one refresh needs: the first creates the pull request, the second merges it once the checks are green. The third -- the job that would start the cycle again, which is what #157 set out to stop -- falls outside. elixir.json carried the same midnight window and gets the same move. Its next window is 2026-09-06, so this needs to be distributed today to be worth anything. Refs #157 * docs(elixir): record why the lock file window sits where it does The window moved in #166 and again here, and neither change left a trace in this file: description[3] explains the two-day top-level window and says nothing about the one lockFileMaintenance carries. Reading elixir.json alone gave no reason for `after 6am and before 12pm on sunday`. Split across two entries -- why it is narrower than the window above, and why it sits in daylight -- rather than one, which would have run half again as long as anything else here. Refs #157
#165 が Elixir 系 8 PR のうち 4 本(elixir dependencies)を止めていた原因を扱うのに対し、こちらは残る 4 本(lock file maintenance)です。原因が別なので分けています。
症状
止まっている 8 本の PR 本文を読み比べると、はっきり分かれます。
後者は設定どおりの挙動で、branch protection を入れても動きません。
原因
{"matchManagers": ["mix"], "matchDatasources": ["hex"], "matchUpdateTypes": ["minor", "patch", "digest", "lockFileMaintenance"], "automerge": true}lock file refresh は datasource を持たないため、
matchDatasourcesがこの rule から締め出しています。matchUpdateTypesにlockFileMaintenanceと書いてあるのに一度も効いていない、自己矛盾した状態でした。npm.jsonの同等ルールにはmatchDatasourcesがなく、だから latex 系では同じ週に lockfile PR が自動マージされています。対応
matchDatasourcesを外すのではなく、rule を分けました。あの絞り込みは git 依存を自動マージの対象から外す意図があるはずで、それを壊さずに lockFileMaintenance だけを通すためです。効かない記述を元の rule に残すと、読んだ人が「lockFileMaintenance も automerge される」と誤解するので削っています。
matchManagersはnpm.jsonと揃えました。窓も同時に狭めます
"lockFileMaintenance": { "enabled": true, - "schedule": ["on sunday and monday"] + "schedule": ["before 5am on sunday"] }automerge を有効にするだけだと、#157 で観測したループが Elixir 系でも始まります。 lock file maintenance は job が汲み尽くせる「項目」ではなく「コミットされた lockfile と registry の差」なので、マージすると数時間で差が復活し、2 日窓の中の次の job がまた PR を作ります。latex 系では 08-27〜08-29 の窓で 7 本作られ、うち 1 本は前の PR のマージ 36 秒後でした。
Elixir 系で今それが起きていないのは、automerge が動いていないからにすぎません。 この PR で automerge を通す以上、窓の修正とセットにする必要があります。#158 が
latex.jsonに施したのと同じ形(1 日・夜明け前、Renovate デフォルトの形を曜日だけ動かす)です。5 時間は Mend の job 間隔 4 時間より広いので、窓が 2 つの job の間に落ちる失敗には戻りません。影響範囲
elixir#v1を extend する 9 リポジトリすべてに届きます。DNS 系 5 リポジトリ(automerge が正常動作中)も対象なので、あちらの lock file maintenance も日曜早朝の 1 窓に変わります。mudan-dns セッションには別途共有します。順序
#165(branch protection)とは独立ですが、#165 を先にマージするのが自然です。protection が入るまでは elixir dependencies 側が動かないので、この PR だけ入れても lockfile の 4 本しか流れません。