Add save_job_artifacts utility for CI artifact collection#48
Conversation
|
Warning Review limit reached
More reviews will be available in 11 minutes and 4 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Add save_job_artifacts() and _collect_git_artifacts() to agentic_ci.skill for collecting debugging artifacts (prompt, Claude output, git diff/log) into a work directory for CI artifact upload. This consolidates duplicated artifact collection logic from downstream consumers like jira-autofix. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Emilien Macchi <emacchi@redhat.com>
851b7f4 to
c093d7f
Compare
|
|
||
| def _collect_git_artifacts(work_dir: Path, repo_dir: Path) -> None: | ||
| """Capture git diff and log from repo_dir into work_dir.""" | ||
| from agentic_ci.git import get_default_branch, git_output |
There was a problem hiding this comment.
Move this to be a file-level import.
| for candidate in [repo_dir, work_dir]: | ||
| if candidate is None: | ||
| continue | ||
| output_file = candidate / "claude-output.txt" |
There was a problem hiding this comment.
We should probably make this harness-agnostic. I feel like we should tackle https://redhat.atlassian.net/browse/RHAIFIRST-59 first so we have a standardized way to refer to artifacts and then this function becomes a lot simpler where it copies known files into an artifacts directory instead of hardcoding things like claude-output.txt here.
There was a problem hiding this comment.
nice catch. I think you're right, let's fix that one first and come back to it.
Summary
save_job_artifacts()and_collect_git_artifacts()toagentic_ci.skillTest plan
tests/test_skill.pycovering prompt save, output copy, tail creation, and graceful error handlingsave_job_artifacts