merge-steward 0.14.2 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,8 @@ export declare class MergeStewardRuntime {
22
22
  private lastTickOutcome;
23
23
  private lastTickError;
24
24
  private currentQueueBlock;
25
+ private readonly waitingMainInfoAt;
26
+ private static readonly WAITING_MAIN_INFO_INTERVAL_MS;
25
27
  constructor(config: StewardConfig, policy: GitHubPolicyCache, store: QueueStore, git: GitOperations, ci: CIRunner, github: GitHubPRApi, eviction: EvictionReporter, specBuilder: SpeculativeBranchBuilder, logger: Logger, beforeTick?: (() => Promise<void>) | undefined);
26
28
  start(): Promise<void>;
27
29
  stop(): Promise<void>;
@@ -17,6 +17,12 @@ export class MergeStewardRuntime {
17
17
  lastTickOutcome = "idle";
18
18
  lastTickError = null;
19
19
  currentQueueBlock = null;
20
+ // Per-entry timestamp of the last info-level `merge_waiting_main` log.
21
+ // The event fires every tick while the gate waits, so subsequent ticks
22
+ // log at debug to avoid spamming; a re-emission of info every ~5 min keeps
23
+ // long waits visible in `service logs` without drowning it out.
24
+ waitingMainInfoAt = new Map();
25
+ static WAITING_MAIN_INFO_INTERVAL_MS = 5 * 60 * 1000;
20
26
  constructor(config, policy, store, git, ci, github, eviction, specBuilder, logger, beforeTick) {
21
27
  this.config = config;
22
28
  this.policy = policy;
@@ -101,8 +107,23 @@ export class MergeStewardRuntime {
101
107
  || event.action === "ci_failed"
102
108
  || event.action === "merge_rejected" || event.action === "budget_exhausted";
103
109
  const isDebug = event.action === "ci_pending" || event.action === "retry_gated"
104
- || event.action === "fetch_started" || event.action === "merge_waiting_main";
105
- const level = isWarn ? "warn" : isDebug ? "debug" : "info";
110
+ || event.action === "fetch_started";
111
+ let level = isWarn ? "warn" : isDebug ? "debug" : "info";
112
+ if (event.action === "merge_waiting_main") {
113
+ // The event fires every ~tick while the gate waits on main's own
114
+ // CI. Log at info the first time (so an operator can see *why*
115
+ // the head entry is parked in merging) and once every interval
116
+ // after, debug on the intermediate ticks to avoid spamming.
117
+ const last = this.waitingMainInfoAt.get(event.entryId);
118
+ const now = Date.now();
119
+ if (last === undefined || now - last >= MergeStewardRuntime.WAITING_MAIN_INFO_INTERVAL_MS) {
120
+ level = "info";
121
+ this.waitingMainInfoAt.set(event.entryId, now);
122
+ }
123
+ else {
124
+ level = "debug";
125
+ }
126
+ }
106
127
  this.logger[level]({ ...event }, `Queue: ${event.action} PR #${event.prNumber}`);
107
128
  if (event.action === "main_broken" && tickQueueBlockEvent === null) {
108
129
  tickQueueBlockEvent = event;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merge-steward",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "description": "Serial merge queue for GitHub — rebase, CI-gate, and merge PRs one at a time",
5
5
  "type": "module",
6
6
  "repository": {