Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
593 lines (506 loc) · 20.6 KB
/
Copy pathMakefile
File metadata and controls
593 lines (506 loc) · 20.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
IMAGE_NAME ?= beeai-agent
COMPOSE_FILE ?= compose.yaml
DRY_RUN ?= false
MOCK_JIRA ?= false
JIRA_DRY_RUN ?= false
JIRA_ALLOW_STATUS_CHANGES ?= false
ERRATA_ALLOW_STATUS_CHANGES ?= false
AUTO_CHAIN ?= true
SHARED_RULES_ENABLED ?= true
FORCE_CVE_TRIAGE ?= false
RUN_LLM_JUDGE ?= true
BACKPORT_E2E_EXCLUDE_ISSUES ?=
COMPOSE ?= $(shell if podman compose ls >/dev/null 2>&1; then echo "podman compose"; elif command -v podman-compose >/dev/null 2>&1; then echo "podman-compose"; else echo "docker-compose"; fi)
COMPOSE_AGENTS=$(COMPOSE) -f $(COMPOSE_FILE) --profile=agents
COMPOSE_SUPERVISOR=$(COMPOSE) -f $(COMPOSE_FILE) --profile=supervisor
# Extract container tool (podman or docker) from COMPOSE
CONTAINER_TOOL ?= $(shell command -v podman >/dev/null 2>&1 && echo "podman" || echo "docker")
REGISTRY ?= quay.io/jotnar
.PHONY: deploy changelog
REMOTE ?= upstream
deploy:
$(MAKE) -C openshift deploy REMOTE="$(REMOTE)"
changelog:
$(MAKE) -C openshift changelog REMOTE="$(REMOTE)" CHANGELOG_BASE="$(CHANGELOG_BASE)" CHANGELOG_HEAD="$(CHANGELOG_HEAD)"
.PHONY: build
build:
@if [ -f .secrets/build.env ]; then echo "Warning: .secrets/build.env is deprecated, please move its contents to .env"; fi
if [ -f .secrets/build.env ] && [ ! -f .env ]; then set -a && . ./.secrets/build.env && set +a; fi && \
$(COMPOSE) -f $(COMPOSE_FILE) --profile=agents --profile=supervisor build
.PHONY: push
push:
@echo "Pushing images to $(REGISTRY)..."
$(CONTAINER_TOOL) push $(REGISTRY)/phoenix:latest
$(CONTAINER_TOOL) push $(REGISTRY)/redis-commander:latest
@echo "All images pushed successfully!"
.PHONY: build-and-push
build-and-push: build push
.PHONY: konflux-token
# Refresh the local Konflux backend token from your current `oc` login.
# Run this before local konflux builds, and again whenever a build 401s.
konflux-token:
scripts/refresh-konflux-token.sh
.PHONY: run-beeai-bash
run-beeai-bash:
$(COMPOSE_AGENTS) run --rm triage-agent /bin/bash
.PHONY: run-triage-agent-standalone
run-triage-agent-standalone:
$(COMPOSE_AGENTS) run --rm \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e DRY_RUN=$(DRY_RUN) \
-e MOCK_JIRA=$(MOCK_JIRA) \
-e JIRA_DRY_RUN=$(JIRA_DRY_RUN) \
-e FORCE_CVE_TRIAGE=$(FORCE_CVE_TRIAGE) \
triage-agent
.PHONY: run-triage-agent-e2e-tests list-triage-agent-e2e-tests
run-triage-agent-e2e-tests:
@if [ -n "$(TMT_PLAN_DATA)" ]; then \
mv $(TMT_PLAN_DATA)/mock_repos/* ymir/agents/tests/e2e/mock_repos/; \
mv $(TMT_PLAN_DATA)/jiras/* ymir/tools/privileged/tests/data/; \
mv $(TMT_PLAN_DATA)/.secrets .secrets; \
mv .secrets/.env ./; \
else \
touch .tmt/results.yaml; \
fi
# SAFETY: MOCK_JIRA=true and DRY_RUN=true prevent writes to production Jira.
# These are REQUIRED — tests use real issue keys and would otherwise post
# comments to production. Setting them in the environment (not just -e flags)
# ensures dependent services like mcp-gateway pick them up via ${VAR:-default}.
# The conftest.py enforces this in the test container itself.
MOCK_JIRA=true DRY_RUN=true ALLOW_RHEL_CONFIG_OVERRIDE=true $(COMPOSE) -f $(COMPOSE_FILE) --profile=e2e-test run --rm \
-e MOCK_JIRA="true" \
-e DRY_RUN="true" \
triage-agent-e2e-tests
list-triage-agent-e2e-tests:
MOCK_JIRA=true DRY_RUN=true ALLOW_RHEL_CONFIG_OVERRIDE=true $(COMPOSE) -f $(COMPOSE_FILE) --profile=e2e-test run --rm \
-e MOCK_JIRA="true" \
-e DRY_RUN="true" \
triage-agent-e2e-tests pytest ymir/agents/tests/e2e/test_triage.py --collect-only
.PHONY: run-backport-agent-e2e-tests
run-backport-agent-e2e-tests:
# SAFETY: MOCK_JIRA=true and DRY_RUN=true prevent writes to production Jira.
# Setting them in the environment ensures mcp-gateway picks them up.
MOCK_JIRA=true DRY_RUN=true ALLOW_RHEL_CONFIG_OVERRIDE=true $(COMPOSE) -f $(COMPOSE_FILE) --profile=e2e-test run --rm \
-e MOCK_JIRA="true" \
-e DRY_RUN="true" \
-e RUN_LLM_JUDGE=$(RUN_LLM_JUDGE) \
-e BACKPORT_E2E_EXCLUDE_ISSUES="$(BACKPORT_E2E_EXCLUDE_ISSUES)" \
backport-agent-e2e-tests
.PHONY: run-backport-agent-konflux-e2e-tests
run-backport-agent-konflux-e2e-tests:
# Konflux build backend variant of the backport e2e. Unlike Copr (which
# builds from a local SRPM), Konflux builds from a real pushed fork ref:
# even under DRY_RUN the workflow creates the fork under FORK_NAMESPACE,
# pushes a temporary build branch, and submits a real Konflux build. It
# deletes the temporary branch after validation and skips MR/Jira writes.
# The dist-git SOURCE stays mocked (local bare clones via insteadOf).
# Requires FORK_NAMESPACE + GITLAB_TOKEN + KONFLUX_* in the environment /
# .secrets/mcp-gateway.env and a reachable Konflux cluster.
MOCK_JIRA=true DRY_RUN=true BUILD_BACKEND=konflux FORK_NAMESPACE="$(FORK_NAMESPACE)" \
$(COMPOSE) -f $(COMPOSE_FILE) --profile=e2e-test run --rm \
-e MOCK_JIRA="true" \
-e DRY_RUN="true" \
-e BUILD_BACKEND="konflux" \
-e RUN_LLM_JUDGE=$(RUN_LLM_JUDGE) \
-e BACKPORT_E2E_EXCLUDE_ISSUES="$(BACKPORT_E2E_EXCLUDE_ISSUES)" \
backport-agent-e2e-tests
.PHONY: run-reproducer-agent-e2e-tests
run-reproducer-agent-e2e-tests:
ALLOW_RHEL_CONFIG_OVERRIDE=true $(COMPOSE) -f $(COMPOSE_FILE) --profile=e2e-test run --rm \
-e MOCK_JIRA="true" \
-e DRY_RUN="true" \
-e TESTING_FARM_DRY_RUN="false" \
reproducer-agent-e2e-tests
.PHONY: run-reproducer-agent-standalone
run-reproducer-agent-standalone:
$(COMPOSE_AGENTS) run --rm \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e DRY_RUN=$(DRY_RUN) \
-e MOCK_JIRA=$(MOCK_JIRA) \
-e JIRA_DRY_RUN=$(JIRA_DRY_RUN) \
reproducer-agent
.PHONY: run-rebase-agent-c9s-standalone
run-rebase-agent-c9s-standalone:
$(COMPOSE_AGENTS) run --rm \
-e PACKAGE=$(PACKAGE) \
-e VERSION=$(VERSION) \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e BRANCH=$(BRANCH) \
-e DRY_RUN=$(DRY_RUN) \
-e MOCK_JIRA=$(MOCK_JIRA) \
-e JIRA_DRY_RUN=$(JIRA_DRY_RUN) \
-e "JUSTIFICATION=$(JUSTIFICATION)" \
rebase-agent-c9s
.PHONY: run-rebase-agent-c10s-standalone
run-rebase-agent-c10s-standalone:
$(COMPOSE_AGENTS) run --rm \
-e PACKAGE=$(PACKAGE) \
-e VERSION=$(VERSION) \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e BRANCH=$(BRANCH) \
-e DRY_RUN=$(DRY_RUN) \
-e MOCK_JIRA=$(MOCK_JIRA) \
-e JIRA_DRY_RUN=$(JIRA_DRY_RUN) \
-e "JUSTIFICATION=$(JUSTIFICATION)" \
rebase-agent-c10s
.PHONY: run-rebase-agent-standalone
run-rebase-agent-standalone: run-rebase-agent-c10s-standalone
.PHONY: run-backport-agent-c9s-standalone
run-backport-agent-c9s-standalone:
$(COMPOSE_AGENTS) run --rm \
-e PACKAGE=$(PACKAGE) \
-e UPSTREAM_PATCHES=$(UPSTREAM_PATCHES) \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e BRANCH=$(BRANCH) \
-e DRY_RUN=$(DRY_RUN) \
-e MOCK_JIRA=$(MOCK_JIRA) \
-e JIRA_DRY_RUN=$(JIRA_DRY_RUN) \
-e CVE_ID=$(CVE_ID) \
-e "JUSTIFICATION=$(JUSTIFICATION)" \
backport-agent-c9s
.PHONY: run-backport-agent-c10s-standalone
run-backport-agent-c10s-standalone:
$(COMPOSE_AGENTS) run --rm \
-e PACKAGE=$(PACKAGE) \
-e UPSTREAM_PATCHES=$(UPSTREAM_PATCHES) \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e BRANCH=$(BRANCH) \
-e DRY_RUN=$(DRY_RUN) \
-e MOCK_JIRA=$(MOCK_JIRA) \
-e JIRA_DRY_RUN=$(JIRA_DRY_RUN) \
-e CVE_ID=$(CVE_ID) \
-e "JUSTIFICATION=$(JUSTIFICATION)" \
backport-agent-c10s
.PHONY: run-backport-agent-standalone
run-backport-agent-standalone: run-backport-agent-c10s-standalone
.PHONY: run-rebuild-agent-c9s-standalone
run-rebuild-agent-c9s-standalone:
$(COMPOSE_AGENTS) run --rm \
-e PACKAGE=$(PACKAGE) \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e BRANCH=$(BRANCH) \
-e DRY_RUN=$(DRY_RUN) \
-e MOCK_JIRA=$(MOCK_JIRA) \
-e DEPENDENCY_ISSUE=$(DEPENDENCY_ISSUE) \
-e DEPENDENCY_COMPONENT=$(DEPENDENCY_COMPONENT) \
-e CONSOLIDATED_ISSUES=$(CONSOLIDATED_ISSUES) \
-e JIRA_DRY_RUN=$(JIRA_DRY_RUN) \
-e "JUSTIFICATION=$(JUSTIFICATION)" \
rebuild-agent-c9s
.PHONY: run-rebuild-agent-c10s-standalone
run-rebuild-agent-c10s-standalone:
$(COMPOSE_AGENTS) run --rm \
-e PACKAGE=$(PACKAGE) \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e BRANCH=$(BRANCH) \
-e DRY_RUN=$(DRY_RUN) \
-e MOCK_JIRA=$(MOCK_JIRA) \
-e DEPENDENCY_ISSUE=$(DEPENDENCY_ISSUE) \
-e DEPENDENCY_COMPONENT=$(DEPENDENCY_COMPONENT) \
-e CONSOLIDATED_ISSUES=$(CONSOLIDATED_ISSUES) \
-e JIRA_DRY_RUN=$(JIRA_DRY_RUN) \
-e "JUSTIFICATION=$(JUSTIFICATION)" \
rebuild-agent-c10s
.PHONY: run-rebuild-agent-standalone
run-rebuild-agent-standalone: run-rebuild-agent-c10s-standalone
.PHONY: run-mr-agent-c9s-standalone
run-mr-agent-c9s-standalone:
$(COMPOSE_AGENTS) run --rm \
-e MERGE_REQUEST_URL=$(MERGE_REQUEST_URL) \
mr-agent-c9s
.PHONY: run-mr-agent-c10s-standalone
run-mr-agent-c10s-standalone:
$(COMPOSE_AGENTS) run --rm \
-e MERGE_REQUEST_URL=$(MERGE_REQUEST_URL) \
mr-agent-c10s
.PHONY: run-mr-agent-standalone
run-mr-agent-standalone: run-mr-agent-c10s-standalone
.PHONY: run-mr-consolidation-agent-standalone
run-mr-consolidation-agent-standalone:
$(COMPOSE_AGENTS) run --rm \
-e PACKAGE=$(PACKAGE) \
-e BRANCH=$(BRANCH) \
-e RELEASE_STRATEGY=$(RELEASE_STRATEGY) \
-e DRY_RUN=$(DRY_RUN) \
mr-consolidation-agent-c10s
.PHONY: run-mr-consolidation-agent-e2e-tests
run-mr-consolidation-agent-e2e-tests:
ALLOW_RHEL_CONFIG_OVERRIDE=true $(COMPOSE) -f $(COMPOSE_FILE) --profile=e2e-test run --rm \
-e MOCK_JIRA="true" \
-e DRY_RUN="true" \
-e RUN_LLM_JUDGE=$(RUN_LLM_JUDGE) \
mr-consolidation-agent-e2e-tests
.PHONY: run-mr-consolidation-agent-konflux-e2e-tests
run-mr-consolidation-agent-konflux-e2e-tests:
# Konflux build backend variant of the MR-consolidation e2e. Unlike Copr
# (which builds from a local SRPM), Konflux builds from a real pushed fork
# ref: even under DRY_RUN the workflow creates the fork under FORK_NAMESPACE,
# commits the consolidated work, pushes it, and submits a real Konflux build;
# only the MR/Jira writes stay suppressed. The dist-git SOURCE stays mocked
# (local bare clones via insteadOf). Requires FORK_NAMESPACE + GITLAB_TOKEN +
# KONFLUX_* in the environment / .secrets/mcp-gateway.env and a reachable
# Konflux cluster.
MOCK_JIRA=true DRY_RUN=true BUILD_BACKEND=konflux FORK_NAMESPACE="$(FORK_NAMESPACE)" \
$(COMPOSE) -f $(COMPOSE_FILE) --profile=e2e-test run --rm \
-e MOCK_JIRA="true" \
-e DRY_RUN="true" \
-e BUILD_BACKEND="konflux" \
-e RUN_LLM_JUDGE=$(RUN_LLM_JUDGE) \
mr-consolidation-agent-e2e-tests
.PHONY: run-jira-issue-fetcher
run-jira-issue-fetcher:
@echo "Running Jira Issue Fetcher..."
@if [ ! -f .secrets/jira-issue-fetcher.env ]; then \
echo "Error: .secrets/jira-issue-fetcher.env not found"; \
echo "Copy the template: cp templates/jira-issue-fetcher.env .secrets/jira-issue-fetcher.env"; \
echo "Then edit it with your credentials"; \
exit 1; \
fi
@echo "Ensuring Redis is available (don't use depends_on otherwise it will kill agents already running)..."
@$(COMPOSE) -f $(COMPOSE_FILE) up -d valkey || true # Don't fail if valkey is already running
@echo "Running jira-issue-fetcher..."
$(COMPOSE) -f $(COMPOSE_FILE) --profile manual run --rm jira-issue-fetcher
.PHONY: build-jira-issue-fetcher
build-jira-issue-fetcher:
$(COMPOSE) --profile manual build jira-issue-fetcher
.PHONY: build-mr-cleanup
build-mr-cleanup:
$(COMPOSE) --profile manual build mr-cleanup
.PHONY: build-sweep
build-sweep:
$(CONTAINER_TOOL) build -f Containerfile.sweep -t sweep:latest .
.PHONY: run-sweep
run-sweep:
@if [ -z "$(STRATEGY)" ]; then \
echo "Usage: make run-sweep STRATEGY=dependency|y_stream|pr_pending|no_patch"; \
exit 1; \
fi
@if [ ! -f .secrets/sweep.env ]; then \
echo "Error: .secrets/sweep.env not found"; \
echo "Copy the template: cp templates/sweep.env .secrets/sweep.env"; \
echo "Then edit it with your credentials"; \
exit 1; \
fi
$(COMPOSE) -f $(COMPOSE_FILE) --profile manual run --rm sweep python3 -m ymir.sweep --strategy $(STRATEGY)
# Usage:
# make run-mr-cleanup-dry-run # dry run, lists what would be changed
# make run-mr-cleanup # live run
define mr-cleanup-check-env
@if [ ! -f .secrets/mr-cleanup.env ]; then \
echo "Error: .secrets/mr-cleanup.env not found"; \
echo "Copy the template: cp templates/mr-cleanup.env .secrets/mr-cleanup.env"; \
echo "Then edit it with your credentials"; \
exit 1; \
fi
endef
.PHONY: run-mr-cleanup-dry-run
run-mr-cleanup-dry-run:
$(mr-cleanup-check-env)
@echo "Running MR Cleanup (dry run)..."
$(COMPOSE) -f $(COMPOSE_FILE) --profile manual run --rm \
-e DRY_RUN=true \
mr-cleanup
.PHONY: run-mr-cleanup
run-mr-cleanup:
$(mr-cleanup-check-env)
@echo "Running MR Cleanup (LIVE — will close MRs and post comments)..."
$(COMPOSE) -f $(COMPOSE_FILE) --profile manual run --rm \
-e DRY_RUN=false \
mr-cleanup
# Essential 3-Agent Architecture Targets
.PHONY: start
start:
DRY_RUN=$(DRY_RUN) MOCK_JIRA=$(MOCK_JIRA) JIRA_DRY_RUN=$(JIRA_DRY_RUN) JIRA_ALLOW_STATUS_CHANGES=$(JIRA_ALLOW_STATUS_CHANGES) ERRATA_ALLOW_STATUS_CHANGES=$(ERRATA_ALLOW_STATUS_CHANGES) AUTO_CHAIN=$(AUTO_CHAIN) SHARED_RULES_ENABLED=$(SHARED_RULES_ENABLED) $(COMPOSE_AGENTS) up
.PHONY: start-detached
start-detached:
DRY_RUN=$(DRY_RUN) MOCK_JIRA=$(MOCK_JIRA) JIRA_DRY_RUN=$(JIRA_DRY_RUN) JIRA_ALLOW_STATUS_CHANGES=$(JIRA_ALLOW_STATUS_CHANGES) ERRATA_ALLOW_STATUS_CHANGES=$(ERRATA_ALLOW_STATUS_CHANGES) AUTO_CHAIN=$(AUTO_CHAIN) SHARED_RULES_ENABLED=$(SHARED_RULES_ENABLED) $(COMPOSE_AGENTS) up -d
.PHONY: stop
stop:
$(COMPOSE_AGENTS) stop
$(COMPOSE_AGENTS) down
.PHONY: clean
clean:
$(COMPOSE) -f $(COMPOSE_FILE) down --volumes
.PHONY: logs-triage
logs-triage:
$(COMPOSE_AGENTS) logs -f triage-agent
.PHONY: logs-backport
logs-backport:
$(COMPOSE_AGENTS) logs -f backport-agent
.PHONY: logs-rebase
logs-rebase:
$(COMPOSE_AGENTS) logs -f rebase-agent
.PHONY: logs-rebuild
logs-rebuild:
$(COMPOSE_AGENTS) logs -f rebuild-agent
.PHONY: logs-mr-consolidation
logs-mr-consolidation:
$(COMPOSE_AGENTS) logs -f mr-consolidation-agent-c9s mr-consolidation-agent-c10s
.PHONY: logs-jira-issue-fetcher
logs-jira-issue-fetcher:
$(COMPOSE) -f $(COMPOSE_FILE) --profile manual logs -f jira-issue-fetcher
.PHONY: trigger-pipeline
trigger-pipeline:
@if [ -z "$(JIRA_ISSUE)" ]; then \
echo "Usage: make trigger-pipeline JIRA_ISSUE=RHEL-12345 [FORCE_CVE_TRIAGE=true]"; \
exit 1; \
fi
@echo "Triggering pipeline for issue: $(JIRA_ISSUE) (force_cve_triage=$(FORCE_CVE_TRIAGE))"
$(COMPOSE_AGENTS) exec valkey redis-cli LPUSH triage_queue '{"metadata": {"issue": "$(JIRA_ISSUE)", "force_cve_triage": $(FORCE_CVE_TRIAGE)}}'
# Manually enqueue a reproducer job (also when TRIAGE_ENQUEUE_REPRODUCER=false).
# Required: JIRA_ISSUE, PACKAGE
# Optional: CVE_ID, FIX_VERSION, TARGET_BRANCH, TRIAGE_SUMMARY, USER_TRIGGERED=true
.PHONY: trigger-reproducer
trigger-reproducer:
@if [ -z "$(JIRA_ISSUE)" ] || [ -z "$(PACKAGE)" ]; then \
echo "Usage: make trigger-reproducer JIRA_ISSUE=RHEL-12345 PACKAGE=bind \\"; \
echo " [CVE_ID=CVE-2025-12345] [FIX_VERSION=rhel-10.1] [TARGET_BRANCH=c10s] \\"; \
echo " [TRIAGE_SUMMARY='…'] [USER_TRIGGERED=true]"; \
exit 1; \
fi
@echo "Enqueueing reproducer for $(JIRA_ISSUE) (package=$(PACKAGE), user_triggered=$(or $(USER_TRIGGERED),false))"
@payload=$$( \
JIRA_ISSUE="$(JIRA_ISSUE)" \
PACKAGE="$(PACKAGE)" \
CVE_ID="$(CVE_ID)" \
FIX_VERSION="$(FIX_VERSION)" \
TARGET_BRANCH="$(TARGET_BRANCH)" \
TRIAGE_SUMMARY="$(TRIAGE_SUMMARY)" \
USER_TRIGGERED="$(or $(USER_TRIGGERED),false)" \
python3 -c 'import json, os; \
meta = {"jira_issue": os.environ["JIRA_ISSUE"], "package": os.environ["PACKAGE"]}; \
[meta.__setitem__(k, v) for k, e in ( \
("cve_id", "CVE_ID"), \
("fix_version", "FIX_VERSION"), \
("target_branch", "TARGET_BRANCH"), \
("triage_summary", "TRIAGE_SUMMARY"), \
) if (v := (os.environ.get(e) or "").strip())]; \
print(json.dumps({ \
"metadata": meta, \
"attempts": 0, \
"user_triggered": os.environ.get("USER_TRIGGERED", "false").lower() == "true", \
}))' \
) && \
queue=$$(if [ "$(or $(USER_TRIGGERED),false)" = "true" ]; then echo reproducer_queue_todo; else echo reproducer_queue; fi) && \
$(COMPOSE_AGENTS) exec -T valkey redis-cli LPUSH $$queue "$$payload" && \
echo "Pushed to $$queue"
# Testing and Release Supervisor
DEBUG_LOWER := $(shell echo $(DEBUG) | tr '[:upper:]' '[:lower:]')
ifeq ($(DEBUG_LOWER),true)
DEBUG_FLAG := --debug
else
DEBUG_FLAG :=
endif
DRY_RUN_LOWER := $(shell echo $(DRY_RUN) | tr '[:upper:]' '[:lower:]')
ifeq ($(DRY_RUN_LOWER),true)
DRY_RUN_FLAG := --dry-run
else
DRY_RUN_FLAG :=
endif
IGNORE_NEEDS_ATTENTION_LOWER := $(shell echo $(IGNORE_NEEDS_ATTENTION) | tr '[:upper:]' '[:lower:]')
ifeq ($(IGNORE_NEEDS_ATTENTION_LOWER),true)
IGNORE_NEEDS_ATTENTION_FLAG := --ignore-needs-attention
else
IGNORE_NEEDS_ATTENTION_FLAG :=
endif
.PHONY: supervisor-clear-queue
supervisor-clear-queue:
$(COMPOSE_SUPERVISOR) run --rm \
supervisor python -m ymir.supervisor.main $(DEBUG_FLAG) clear-queue
.PHONY: supervisor-collect
supervisor-collect:
$(COMPOSE_SUPERVISOR) run --rm \
supervisor python -m ymir.supervisor.main $(DEBUG_FLAG) collect --no-repeat
.PHONY: triage-issue
triage-issue:
@if [ -z "$(JIRA_ISSUE)" ]; then \
echo "Usage: make triage-issue JIRA_ISSUE=RHEL-12345 [DRY_RUN=true]"; \
exit 1; \
fi
$(COMPOSE_AGENTS) run --rm \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e DRY_RUN=$(DRY_RUN) \
-e AUTO_CHAIN=false \
triage-agent
.PHONY: process
process:
@if [ -z "$(JIRA_ISSUE)" ]; then \
echo "Usage: make process JIRA_ISSUE=RHEL-12345 [DRY_RUN=true]"; \
exit 1; \
fi
$(COMPOSE_AGENTS) run --rm \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e DRY_RUN=$(DRY_RUN) \
-e AUTO_CHAIN=true \
triage-agent
.PHONY: process-issue
process-issue:
$(COMPOSE_SUPERVISOR) run --rm \
supervisor python -m ymir.supervisor.main $(DEBUG_FLAG) $(IGNORE_NEEDS_ATTENTION_FLAG) $(DRY_RUN_FLAG) process-issue $(JIRA_ISSUE)
.PHONY: process-erratum
process-erratum:
$(COMPOSE_SUPERVISOR) run --rm \
supervisor python -m ymir.supervisor.main $(DEBUG_FLAG) $(IGNORE_NEEDS_ATTENTION_FLAG) $(DRY_RUN_FLAG) process-erratum $(ERRATA_ID)
.PHONY: run-issue-verification-agent-standalone
run-issue-verification-agent-standalone:
$(COMPOSE_AGENTS) run --rm \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e DRY_RUN=$(DRY_RUN) \
-e IGNORE_NEEDS_ATTENTION=$(IGNORE_NEEDS_ATTENTION) \
issue-verification-agent
.PHONY: run-errata-workflow-agent-standalone
run-errata-workflow-agent-standalone:
$(COMPOSE_AGENTS) run --rm \
-e ERRATUM_ID=$(ERRATUM_ID) \
-e DRY_RUN=$(DRY_RUN) \
-e IGNORE_NEEDS_ATTENTION=$(IGNORE_NEEDS_ATTENTION) \
-e ERRATA_ALLOW_STATUS_CHANGES=$(ERRATA_ALLOW_STATUS_CHANGES) \
errata-workflow-agent
.PHONY: run-preliminary-testing-agent-standalone
run-preliminary-testing-agent-standalone:
$(COMPOSE_AGENTS) run --rm \
-e JIRA_ISSUE=$(JIRA_ISSUE) \
-e DRY_RUN=$(DRY_RUN) \
-e IGNORE_NEEDS_ATTENTION=$(IGNORE_NEEDS_ATTENTION) \
preliminary-testing-agent
# Common utility targets
.PHONY: status
status:
$(COMPOSE) -f $(COMPOSE_FILE) ps
.PHONY: redis-cli
redis-cli:
$(COMPOSE_AGENTS) exec valkey redis-cli
.PHONY: build-test-image
build-test-image:
$(MAKE) -f Makefile.tests build-test-image
.PHONY: check-in-container check-agents-in-container check-tools-general-in-container check-unprivileged-tools-in-container check-privileged-tools-in-container check-jira-issue-fetcher-in-container check-ymir-common-in-container check-supervisor-in-container check-mcp-install-in-container check-cli-in-container check-sweep-in-container check-sweep-integration-in-container check-deployment-scripts-in-container check-mr-cleanup-in-container check-api-in-container
check-in-container: build-test-image
$(MAKE) -f Makefile.tests check-in-container
check-agents-in-container: build-test-image
$(MAKE) -f Makefile.tests check-agents-in-container
check-tools-general-in-container: build-test-image
$(MAKE) -f Makefile.tests check-tools-general-in-container
check-unprivileged-tools-in-container: build-test-image
$(MAKE) -f Makefile.tests check-unprivileged-tools-in-container
check-privileged-tools-in-container: build-test-image
$(MAKE) -f Makefile.tests check-privileged-tools-in-container
check-jira-issue-fetcher-in-container: build-test-image
$(MAKE) -f Makefile.tests check-jira-issue-fetcher-in-container
check-ymir-common-in-container: build-test-image
$(MAKE) -f Makefile.tests check-ymir-common-in-container
check-supervisor-in-container: build-test-image
$(MAKE) -f Makefile.tests check-supervisor-in-container
check-deployment-scripts-in-container: build-test-image
$(MAKE) -f Makefile.tests check-deployment-scripts-in-container
check-mr-cleanup-in-container: build-test-image
$(MAKE) -f Makefile.tests check-mr-cleanup-in-container
check-sweep-in-container: build-test-image
$(MAKE) -f Makefile.tests check-sweep-in-container
check-sweep-integration-in-container: build-test-image
$(MAKE) -f Makefile.tests check-sweep-integration-in-container
check-mcp-install-in-container: build-test-image
$(MAKE) -f Makefile.tests check-mcp-install-in-container
check-cli-in-container: build-test-image
$(MAKE) -f Makefile.tests check-cli-in-container
check-api-in-container: build-test-image
$(MAKE) -f Makefile.tests check-api-in-container