mirror of
https://github.com/aljazceru/goose.git
synced 2026-01-07 00:14:23 +01:00
docs: Goose use case post - resolving CI issues (#439)
This commit is contained in:
@@ -11,6 +11,10 @@ authors:
|
||||
name: Adewale Abati
|
||||
description: Staff Developer Advocate
|
||||
avatar: https://avatars.githubusercontent.com/u/4003538?v=4
|
||||
dalton:
|
||||
name: Dalton Turner
|
||||
description: Software Engineer
|
||||
avatar: https://avatars.githubusercontent.com/u/78099245?v=4
|
||||
tania:
|
||||
name: Tania Chakraborty
|
||||
description: Senior Technical Community Manager
|
||||
@@ -18,4 +22,4 @@ authors:
|
||||
angie:
|
||||
name: Angie Jones
|
||||
description: Head of Developer Relations
|
||||
avatar: https://avatars.githubusercontent.com/u/15972783?v=4
|
||||
avatar: https://avatars.githubusercontent.com/u/15972783?v=4
|
||||
|
||||
BIN
docs/blog/images/resolving-ci-issues/goose-github-ci.png
Normal file
BIN
docs/blog/images/resolving-ci-issues/goose-github-ci.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 835 KiB |
169
docs/blog/posts/2024-12-10-resolving-ci-issues.md
Normal file
169
docs/blog/posts/2024-12-10-resolving-ci-issues.md
Normal file
@@ -0,0 +1,169 @@
|
||||
---
|
||||
draft: false
|
||||
title: "Resolving CI Issues with Goose: A Practical Walkthrough"
|
||||
description: "Leverage Goose to simplify your CI debugging process, fetch detailed information about failed CI runs & annotations directly from GitHub, and even apply fixes directly."
|
||||
date: 2024-12-11
|
||||
authors:
|
||||
- dalton
|
||||
---
|
||||
|
||||

|
||||
|
||||
Running into Continuous Integration (CI) failures in pull requests can be quite frustrating but they happen very often. In this post, we leverage the GitHub CLI (`gh`) using Goose to simplify your CI debugging process, fetch detailed information about failed CI runs & annotations directly from GitHub, and even apply fixes directly.
|
||||
|
||||
<!-- more -->
|
||||
|
||||
|
||||
## Getting Started
|
||||
|
||||
Before diving in, ensure you have the necessary tools set up.
|
||||
|
||||
### 1. Install and Authenticate GitHub CLI (`gh`)
|
||||
|
||||
You'll need the [GitHub CLI](https://cli.github.com/) `gh` to enable Goose's access to CI check run details.
|
||||
|
||||
```bash
|
||||
brew install gh
|
||||
gh auth login
|
||||
```
|
||||
|
||||
Follow the prompts to authenticate your account.
|
||||
|
||||
|
||||
### 2. Configure Goose
|
||||
Ensure Goose is configured and ready to interact with your repository and local tools. Specifically, you will need to configure a goose profile with the GitHub toolkit.
|
||||
|
||||
Update your `profiles.yaml` file in `~/.config/goose` with the necessary toolkits:
|
||||
|
||||
```yaml
|
||||
my-profile:
|
||||
provider: anthropic
|
||||
processor: claude-3-5-sonnet
|
||||
accelerator: claude-3-5-sonnet
|
||||
moderator: truncate
|
||||
toolkits:
|
||||
- name: developer
|
||||
requires: {}
|
||||
- name: github
|
||||
requires: {}
|
||||
```
|
||||
Start a session with the profile:
|
||||
|
||||
```bash
|
||||
goose session start --profile my-profile
|
||||
```
|
||||
If the profile’s toolkits are not correctly configured, Goose might fail to access `gh` commands.
|
||||
|
||||
## Resolving CI Failures with Goose
|
||||
Once everything is set up, we can now use Goose to tackle CI issues with the following steps:
|
||||
|
||||
### Step 1: Fetch CI Failure Details
|
||||
Ask Goose to retrieve information about the CI failures for a specific PR.
|
||||
|
||||
**Example Request:**
|
||||
|
||||
```
|
||||
|
||||
Can you tell me about the CI failures on PR #11111 in the organization/repo repository? The check run ID is 123456.
|
||||
```
|
||||
|
||||
You can access a check run ID by clicking on a PR’s checks tab and selecting a failure. The ID will be available in the URL.
|
||||
|
||||
**Goose's Workflow:**
|
||||
|
||||
Goose will use the `gh` CLI to check run information and provide a detailed summary of the issues. Goose uses the GitHub CLI to:
|
||||
|
||||
- Fetch details about failed CI runs, including logs and annotations.
|
||||
- Provide a clear and actionable summary of issues.
|
||||
|
||||
**Example Command Goose Runs:**
|
||||
|
||||
```curl
|
||||
gh api -H "Accept: application/vnd.github+json" /repos/<owner>/<repo>/check-runs/<check-run-id>/annotations
|
||||
```
|
||||
|
||||
**Example Goose Output:**
|
||||
```mathematica
|
||||
Here are the details for Check Run ID 123456:
|
||||
|
||||
**Name**: CI-Build-All
|
||||
**Status**: completed
|
||||
**Conclusion**: failure
|
||||
|
||||
**Annotations Summary:**
|
||||
1. **ModuleA Test Failure**
|
||||
File: `ModuleATests`
|
||||
Line: 35
|
||||
Error: Mismatched parameter order in function call.
|
||||
|
||||
2. **ModuleB Test Failure**
|
||||
File: `ModuleBTests`
|
||||
Line: 64
|
||||
Error: Unexpected nil value encountered during initialization.
|
||||
|
||||
3. **ModuleC Test Failure**
|
||||
File: `ModuleCTests`
|
||||
Line: 98
|
||||
Error: Type mismatch in returned value. Expected 'String', found 'Int'.
|
||||
```
|
||||
### Step 2: Request Fixes from Goose
|
||||
Once Goose provides the failure details, ask it to resolve the issues directly.
|
||||
|
||||
Example Request:
|
||||
|
||||
```
|
||||
Can you fix these issues and stage the changes so I can review them? Do not add unnecessary code comments.
|
||||
```
|
||||
|
||||
**What Goose Does:**
|
||||
|
||||
- Applies fixes based on error messages.
|
||||
- Stages changes for review.
|
||||
|
||||
|
||||
**Example Goose Response:**
|
||||
```markdown
|
||||
I have fixed the following files and staged them:
|
||||
|
||||
- `ModuleATests`: Corrected the order of parameters in the function call.
|
||||
- `ModuleBTests`: Resolved the unexpected nil value encountered during initialization.
|
||||
- `ModuleCTests`: Adjusted the type mismatch in the returned value.
|
||||
|
||||
You can now review the staged changes.
|
||||
```
|
||||
|
||||
|
||||
### Step 3: Review the Changes
|
||||
Carefully review the staged changes to ensure they address the issues correctly and avoid unintended modifications.
|
||||
|
||||
**Things to Check:**
|
||||
|
||||
- No unnecessary comments (e.g., // Fix xyz).
|
||||
- No alterations to unrelated parts of the code.
|
||||
|
||||
|
||||
If needed, clean up or re-stage the changes before committing.
|
||||
|
||||
## Benefits of Using Goose
|
||||
Using Goose to resolve CI issues streamlines your workflow by:
|
||||
|
||||
- identifying issues and applying fixes with minimal manual effort.
|
||||
- integrating with tools like the GitHub CLI to validate changes.
|
||||
- handling repetitive CI debugging tasks while you focus on code quality.
|
||||
|
||||
Goose allows you to resolve CI failures efficiently, ensuring confidence in your workflow while reducing the effort required for debugging and testing.
|
||||
|
||||
Try it out, and let Goose handle the heavy lifting of CI debugging for you!
|
||||
|
||||
<head>
|
||||
<meta property="og:title" content="Resolving CI Issues with Goose: A Practical Walkthrough">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://block.github.io/goose/blog/2024/12/10/resolving-ci-issues.html">
|
||||
<meta property="og:description" content="Leverage Goose to simplify your CI debugging process, fetch detailed information about failed CI runs & annotations directly from GitHub, and even apply fixes directly.">
|
||||
<meta property="og:image" content="https://block.github.io/goose/blog/images/resolving-ci-issues/goose-github-ci.png">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta property="twitter:domain" content="block.github.io">
|
||||
<meta name="twitter:title" content="Resolving CI Issues with Goose: A Practical Walkthrough">
|
||||
<meta name="twitter:description" content="Leverage Goose to simplify your CI debugging process, fetch detailed information about failed CI runs & annotations directly from GitHub, and even apply fixes directly.">
|
||||
<meta name="twitter:image" content="https://block.github.io/goose/blog/images/resolving-ci-issues/goose-github-ci.png">
|
||||
</head>
|
||||
@@ -140,3 +140,4 @@ nav:
|
||||
- "API Docs": reference/index.md
|
||||
- Blog:
|
||||
- "Blog Home": blog/index.md
|
||||
|
||||
|
||||
Reference in New Issue
Block a user