Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .secrets.baseline

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion openshift/deployment-backport-agent-c10s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: backport-agent-c10s
spec:
progressDeadlineSeconds: 600
replicas: 2
replicas: 4
Comment thread
qodo-for-packit[bot] marked this conversation as resolved.
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -48,6 +48,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 4Gi
requests:
memory: 2Gi
Expand Down
3 changes: 2 additions & 1 deletion openshift/deployment-backport-agent-c9s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: backport-agent-c9s
spec:
progressDeadlineSeconds: 600
replicas: 2
replicas: 4
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -48,6 +48,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 4Gi
requests:
memory: 2Gi
Expand Down
3 changes: 2 additions & 1 deletion openshift/deployment-mr-consolidation-agent-c10s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: mr-consolidation-agent-c10s
spec:
progressDeadlineSeconds: 600
replicas: 1
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -45,6 +45,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 4Gi
requests:
memory: 2Gi
Expand Down
3 changes: 2 additions & 1 deletion openshift/deployment-mr-consolidation-agent-c9s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: mr-consolidation-agent-c9s
spec:
progressDeadlineSeconds: 600
replicas: 1
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -45,6 +45,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 4Gi
requests:
memory: 2Gi
Expand Down
3 changes: 2 additions & 1 deletion openshift/deployment-rebase-agent-c10s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: rebase-agent-c10s
spec:
progressDeadlineSeconds: 600
replicas: 1
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -48,6 +48,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 3Gi
requests:
memory: 1536Mi
Expand Down
3 changes: 2 additions & 1 deletion openshift/deployment-rebase-agent-c9s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: rebase-agent-c9s
spec:
progressDeadlineSeconds: 600
replicas: 1
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -48,6 +48,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 3Gi
requests:
memory: 1536Mi
Expand Down
3 changes: 2 additions & 1 deletion openshift/deployment-rebuild-agent-c10s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: rebuild-agent-c10s
spec:
progressDeadlineSeconds: 600
replicas: 1
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -48,6 +48,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 1Gi
requests:
memory: 512Mi
Expand Down
3 changes: 2 additions & 1 deletion openshift/deployment-rebuild-agent-c9s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: rebuild-agent-c9s
spec:
progressDeadlineSeconds: 600
replicas: 1
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -48,6 +48,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 1Gi
requests:
memory: 512Mi
Expand Down
3 changes: 2 additions & 1 deletion openshift/deployment-triage-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: triage-agent
spec:
progressDeadlineSeconds: 600
replicas: 1
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
Expand Down Expand Up @@ -47,6 +47,7 @@ spec:
protocol: TCP
resources:
limits:
cpu: 300m
memory: 4Gi
requests:
memory: 2Gi
Expand Down
1 change: 1 addition & 0 deletions ymir/agents/backport_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ymir/agents/mr_consolidation_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions ymir/agents/rebase_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
1 change: 1 addition & 0 deletions ymir/agents/rebuild_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion ymir/agents/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
nforro marked this conversation as resolved.
if working_dir.is_dir():
_force_rmtree(working_dir)
working_dir.mkdir(parents=True, exist_ok=True)
Expand Down
8 changes: 6 additions & 2 deletions ymir/agents/tests/unit/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomasKorbar just a headsup about this as I saw a method for removing the directory in the #610

working_dir.mkdir(parents=True)
stale_file = working_dir / "leftover-artifact.txt"
stale_file.write_text("stale")

Expand All @@ -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"
Expand All @@ -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",
)

Expand All @@ -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",
)

Expand Down
Loading