diff --git a/.secrets.baseline b/.secrets.baseline index 49ed7b576..d6bf54697 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -143,7 +143,7 @@ "filename": "openshift/deployment-backport-agent-c10s.yml", "hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0", "is_verified": false, - "line_number": 82, + "line_number": 83, "is_secret": false } ], @@ -153,7 +153,7 @@ "filename": "openshift/deployment-backport-agent-c9s.yml", "hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0", "is_verified": false, - "line_number": 82, + "line_number": 83, "is_secret": false } ], @@ -163,7 +163,7 @@ "filename": "openshift/deployment-rebase-agent-c10s.yml", "hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0", "is_verified": false, - "line_number": 82, + "line_number": 83, "is_secret": false } ], @@ -173,7 +173,7 @@ "filename": "openshift/deployment-rebase-agent-c9s.yml", "hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0", "is_verified": false, - "line_number": 82, + "line_number": 83, "is_secret": false } ], @@ -183,7 +183,7 @@ "filename": "openshift/deployment-rebuild-agent-c10s.yml", "hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0", "is_verified": false, - "line_number": 82, + "line_number": 83, "is_secret": false } ], @@ -193,7 +193,7 @@ "filename": "openshift/deployment-rebuild-agent-c9s.yml", "hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0", "is_verified": false, - "line_number": 82, + "line_number": 83, "is_secret": false } ], @@ -213,7 +213,7 @@ "filename": "openshift/deployment-triage-agent.yml", "hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0", "is_verified": false, - "line_number": 81, + "line_number": 82, "is_secret": false } ], @@ -308,5 +308,5 @@ } ] }, - "generated_at": "2026-08-03T18:41:55Z" + "generated_at": "2026-08-12T09:21:28Z" } diff --git a/openshift/deployment-backport-agent-c10s.yml b/openshift/deployment-backport-agent-c10s.yml index 4e20f6b2d..92a55a9c2 100644 --- a/openshift/deployment-backport-agent-c10s.yml +++ b/openshift/deployment-backport-agent-c10s.yml @@ -4,7 +4,7 @@ metadata: name: backport-agent-c10s spec: progressDeadlineSeconds: 600 - replicas: 2 + replicas: 4 revisionHistoryLimit: 10 selector: matchLabels: @@ -48,6 +48,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 4Gi requests: memory: 2Gi diff --git a/openshift/deployment-backport-agent-c9s.yml b/openshift/deployment-backport-agent-c9s.yml index 73e822693..68bf26355 100644 --- a/openshift/deployment-backport-agent-c9s.yml +++ b/openshift/deployment-backport-agent-c9s.yml @@ -4,7 +4,7 @@ metadata: name: backport-agent-c9s spec: progressDeadlineSeconds: 600 - replicas: 2 + replicas: 4 revisionHistoryLimit: 10 selector: matchLabels: @@ -48,6 +48,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 4Gi requests: memory: 2Gi diff --git a/openshift/deployment-mr-consolidation-agent-c10s.yml b/openshift/deployment-mr-consolidation-agent-c10s.yml index c8e3e7c04..ae2ca3b80 100644 --- a/openshift/deployment-mr-consolidation-agent-c10s.yml +++ b/openshift/deployment-mr-consolidation-agent-c10s.yml @@ -4,7 +4,7 @@ metadata: name: mr-consolidation-agent-c10s spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -45,6 +45,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 4Gi requests: memory: 2Gi diff --git a/openshift/deployment-mr-consolidation-agent-c9s.yml b/openshift/deployment-mr-consolidation-agent-c9s.yml index 4619bcaa2..e3f8fdbbd 100644 --- a/openshift/deployment-mr-consolidation-agent-c9s.yml +++ b/openshift/deployment-mr-consolidation-agent-c9s.yml @@ -4,7 +4,7 @@ metadata: name: mr-consolidation-agent-c9s spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -45,6 +45,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 4Gi requests: memory: 2Gi diff --git a/openshift/deployment-rebase-agent-c10s.yml b/openshift/deployment-rebase-agent-c10s.yml index f086fde2b..7975219d4 100644 --- a/openshift/deployment-rebase-agent-c10s.yml +++ b/openshift/deployment-rebase-agent-c10s.yml @@ -4,7 +4,7 @@ metadata: name: rebase-agent-c10s spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -48,6 +48,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 3Gi requests: memory: 1536Mi diff --git a/openshift/deployment-rebase-agent-c9s.yml b/openshift/deployment-rebase-agent-c9s.yml index 93cef18ba..fe82f1a2c 100644 --- a/openshift/deployment-rebase-agent-c9s.yml +++ b/openshift/deployment-rebase-agent-c9s.yml @@ -4,7 +4,7 @@ metadata: name: rebase-agent-c9s spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -48,6 +48,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 3Gi requests: memory: 1536Mi diff --git a/openshift/deployment-rebuild-agent-c10s.yml b/openshift/deployment-rebuild-agent-c10s.yml index 0b8897013..04e1aaf96 100644 --- a/openshift/deployment-rebuild-agent-c10s.yml +++ b/openshift/deployment-rebuild-agent-c10s.yml @@ -4,7 +4,7 @@ metadata: name: rebuild-agent-c10s spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -48,6 +48,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 1Gi requests: memory: 512Mi diff --git a/openshift/deployment-rebuild-agent-c9s.yml b/openshift/deployment-rebuild-agent-c9s.yml index 983d394fb..29b28278f 100644 --- a/openshift/deployment-rebuild-agent-c9s.yml +++ b/openshift/deployment-rebuild-agent-c9s.yml @@ -4,7 +4,7 @@ metadata: name: rebuild-agent-c9s spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -48,6 +48,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 1Gi requests: memory: 512Mi diff --git a/openshift/deployment-triage-agent.yml b/openshift/deployment-triage-agent.yml index 340106ae4..3e157e8ce 100644 --- a/openshift/deployment-triage-agent.yml +++ b/openshift/deployment-triage-agent.yml @@ -4,7 +4,7 @@ metadata: name: triage-agent spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -47,6 +47,7 @@ spec: protocol: TCP resources: limits: + cpu: 300m memory: 4Gi requests: memory: 2Gi diff --git a/ymir/agents/backport_agent.py b/ymir/agents/backport_agent.py index e0db591a6..9f3500250 100644 --- a/ymir/agents/backport_agent.py +++ b/ymir/agents/backport_agent.py @@ -372,6 +372,7 @@ async def fork_and_prepare_dist_git(state): package=state.package, dist_git_branch=state.dist_git_branch, available_tools=gateway_tools, + agent_type="Backport", dist_git_namespace=state.dist_git_namespace, ) local_tool_options["working_directory"] = state.local_clone diff --git a/ymir/agents/mr_consolidation_agent.py b/ymir/agents/mr_consolidation_agent.py index ac8bea75f..ac43d7690 100644 --- a/ymir/agents/mr_consolidation_agent.py +++ b/ymir/agents/mr_consolidation_agent.py @@ -515,6 +515,7 @@ async def fork_and_prepare_dist_git(state): package=package, dist_git_branch=dist_git_branch, available_tools=gateway_tools, + agent_type="MRConsolidation", ) local_tool_options["working_directory"] = state.local_clone diff --git a/ymir/agents/rebase_agent.py b/ymir/agents/rebase_agent.py index 1235f352b..5c3fa3be6 100644 --- a/ymir/agents/rebase_agent.py +++ b/ymir/agents/rebase_agent.py @@ -197,6 +197,7 @@ async def fork_and_prepare_dist_git(state): package=state.package, dist_git_branch=state.dist_git_branch, available_tools=gateway_tools, + agent_type="Rebase", with_fedora=True, dist_git_namespace=state.dist_git_namespace, ) diff --git a/ymir/agents/rebuild_agent.py b/ymir/agents/rebuild_agent.py index dc4de1f87..c0a72f64d 100644 --- a/ymir/agents/rebuild_agent.py +++ b/ymir/agents/rebuild_agent.py @@ -109,6 +109,7 @@ async def fork_and_prepare_dist_git(state): package=state.package, dist_git_branch=state.dist_git_branch, available_tools=gateway_tools, + agent_type="Rebuild", dist_git_namespace=state.dist_git_namespace, ) local_tool_options["working_directory"] = state.local_clone diff --git a/ymir/agents/tasks.py b/ymir/agents/tasks.py index 526da13b0..6591a16ca 100644 --- a/ymir/agents/tasks.py +++ b/ymir/agents/tasks.py @@ -228,12 +228,16 @@ async def fork_and_prepare_dist_git( package: str, dist_git_branch: str, available_tools: list[Tool], + agent_type: str, with_fedora: bool = False, dist_git_namespace: str | None = None, ) -> tuple[Path, str, str, Path | None]: if not jira_issue or Path(jira_issue).is_absolute() or ".." in jira_issue: raise ValueError(f"Invalid jira_issue: {jira_issue}") - working_dir = Path(os.environ["GIT_REPO_BASEPATH"]) / jira_issue + # Scoped by agent_type so different agent types processing the same + # jira_issue concurrently (e.g. rebase and backport) never share a + # working directory and can't rm -rf each other's checkout. + working_dir = Path(os.environ["GIT_REPO_BASEPATH"]) / agent_type / jira_issue if working_dir.is_dir(): _force_rmtree(working_dir) working_dir.mkdir(parents=True, exist_ok=True) diff --git a/ymir/agents/tests/unit/test_tasks.py b/ymir/agents/tests/unit/test_tasks.py index ac578033a..a825f0561 100644 --- a/ymir/agents/tests/unit/test_tasks.py +++ b/ymir/agents/tests/unit/test_tasks.py @@ -44,9 +44,10 @@ async def test_fork_and_prepare_dist_git_wipes_stale_working_dir(git_repo_basepa jira_issue = "RHEL-12345" package = "some-package" branch = "rhel-10.0" + agent_type = "Rebase" - working_dir = git_repo_basepath / jira_issue - working_dir.mkdir() + working_dir = git_repo_basepath / agent_type / jira_issue + working_dir.mkdir(parents=True) stale_file = working_dir / "leftover-artifact.txt" stale_file.write_text("stale") @@ -65,6 +66,7 @@ async def test_fork_and_prepare_dist_git_wipes_stale_working_dir(git_repo_basepa package=package, dist_git_branch=branch, available_tools=mock_tools, + agent_type=agent_type, ) assert working_dir.is_dir(), "working_dir should be recreated" @@ -87,6 +89,7 @@ async def test_fork_and_prepare_honors_explicit_centos_stream_namespace(git_repo package="squid", dist_git_branch="stream-squid-4-rhel-8.10.0", available_tools=mock_tools, + agent_type="Rebase", dist_git_namespace="centos-stream", ) @@ -113,6 +116,7 @@ async def test_fork_and_prepare_modular_rhel_skips_create_zstream_branch(git_rep package="squid", dist_git_branch="stream-squid-4-rhel-8.10.0", available_tools=mock_tools, + agent_type="Rebase", dist_git_namespace="rhel", )