Skip to content

Commit 3cf838e

Browse files
authored
chore: add issuelens custom agent (#1544)
* Enhance Triage Agent with critical issue criteria Updated Triage Agent configuration with detailed description and criteria for identifying critical issues. * chore: add issuelens custom agent * chore: add notification action * fix: schedule the workflow
1 parent 8766ee9 commit 3cf838e

File tree

3 files changed

+237
-0
lines changed

3 files changed

+237
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Notification'
2+
description: 'Triggers a notification with a JSON payload via HTTP POST request'
3+
author: 'Microsoft'
4+
5+
inputs:
6+
url:
7+
description: 'Notification URL endpoint'
8+
required: true
9+
payload:
10+
description: 'JSON payload to send to Notification URL'
11+
required: true
12+
13+
runs:
14+
using: 'composite'
15+
steps:
16+
- name: Prepare payload
17+
shell: bash
18+
run: |
19+
PAYLOAD='${{ inputs.payload }}'
20+
echo "$PAYLOAD" > payload.json
21+
echo "Payload prepared:"
22+
cat payload.json
23+
24+
- name: Trigger Logic App
25+
shell: bash
26+
env:
27+
URL: ${{ inputs.url }}
28+
run: |
29+
response=$(curl -X POST "$URL" \
30+
-H "Content-Type: application/json" \
31+
-d @payload.json \
32+
-w "\nHTTP_STATUS:%{http_code}" \
33+
-s)
34+
35+
http_status=$(echo "$response" | grep "HTTP_STATUS:" | cut -d':' -f2)
36+
body=$(echo "$response" | sed '/HTTP_STATUS:/d')
37+
38+
echo "Response Status: $http_status"
39+
echo "Response Body: $body"
40+
41+
if [ "$http_status" -ge 200 ] && [ "$http_status" -lt 300 ]; then
42+
echo "✅ Notification triggered successfully"
43+
else
44+
echo "❌ Failed to trigger Notification with status code: $http_status"
45+
exit 1
46+
fi

.github/agents/issuelens.agent.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
name: IssueLens
3+
description: An agent speciallized in Java Tooling (IDE, extensions, build tools, language servers) area, responsible for triaging GitHub issues.
4+
# version: 2025-12-01a
5+
tools: ['github/list_issues', 'github/issue_read', 'read', 'mcp-datetime/*']
6+
target: github-copilot
7+
---
8+
9+
# Triage Agent
10+
11+
You are an experienced developer specializing in Java tooling (IDEs, extensions, build tools, language servers). Your role is to triage GitHub issues and identify critical ones for the given Java tooling repo.
12+
13+
## Goal
14+
Identify and summarize critical issues updated today related to the given repo.
15+
16+
## Critical Issue Criteria
17+
- **Hot Issues**
18+
- At least 2 similar issues reported by different users (same symptom or error pattern).
19+
- At least 2 users reacted (👍) or commented on the issue.
20+
- More than 3 non-bot comments (exclude comments from automation like "github-action").
21+
- **Blocking Issues**
22+
- A core product function is broken and no workaround exists.
23+
- **Regression Issues**
24+
- A feature that worked in previous releases is broken in the current release.
25+
26+
## Steps
27+
1. Invoke `mcp-datetime`to get the current date.
28+
2. Invoke `github/list_issues` to retrieve issues opened today. Remember the total number of issues retrieved.
29+
3. For each issue:
30+
- Check if it relates to Java tooling. If not, discard it.
31+
- Use `github/issue_read` to get more details if needed.
32+
4. Apply the critical issue criteria to filter the list. Remember the number of critical issues identified.
33+
5. Generate a concise, structured response in JSON format.
34+
- The JSON schema for the summary is as follows:
35+
```json
36+
{
37+
"type": "object",
38+
"properties": {
39+
"title": {
40+
"type": "string"
41+
},
42+
"repoId": {
43+
"type": "string"
44+
},
45+
"timeFrame": {
46+
"type": "string"
47+
},
48+
"totalIssues": {
49+
"type": "integer"
50+
},
51+
"criticalIssues": {
52+
"type": "integer"
53+
},
54+
"criticalIssuesSummary": {
55+
"type": "array",
56+
"items": {
57+
"type": "object",
58+
"properties": {
59+
"issueNumber": {
60+
"type": "integer"
61+
},
62+
"url": {
63+
"type": "string"
64+
},
65+
"title": {
66+
"type": "string"
67+
},
68+
"summary": {
69+
"type": "string"
70+
},
71+
"labels": {
72+
"type": "string"
73+
}
74+
},
75+
"required": [
76+
"issueNumber",
77+
"url",
78+
"title",
79+
"summary",
80+
"labels"
81+
]
82+
}
83+
},
84+
"repoLink": {
85+
"type": "string"
86+
},
87+
"repoIssueLink": {
88+
"type": "string"
89+
}
90+
}
91+
}
92+
```
93+
- An example response:
94+
```
95+
{
96+
"title": "Weekly GitHub Issues Summary",
97+
"repoId": "microsoft/vscode-java-pack",
98+
"timeFrame": "December 4-11, 2025",
99+
"totalIssues": 8,
100+
"criticalIssues": 3,
101+
"criticalIssuesSummary": [
102+
{
103+
"issueNumber": 1234,
104+
"url": "https://github.com/microsoft/vscode-java-pack/issues/1234",
105+
"title": "Java debugger crashes on Windows with JDK 21",
106+
"summary": "Users report debugger crashes when using JDK 21 on Windows. Investigating compatibility issues.",
107+
"labels": "🔴 **High Priority** | 🏷️ bug, debugger"
108+
},
109+
{
110+
"issueNumber": 1256,
111+
"url": "https://github.com/microsoft/vscode-java-pack/issues/1256",
112+
"title": "Add support for Java 22 preview features",
113+
"summary": "Request to add syntax highlighting and IntelliSense for Java 22 preview features.",
114+
"labels": "🟡 **Medium Priority** | 🏷️ enhancement, java-22"
115+
}
116+
],
117+
"repoLink": "https://github.com/microsoft/vscode-java-pack",
118+
"repoIssueLink": "https://github.com/microsoft/vscode-java-pack/issues"
119+
}
120+
```
121+
- Ensure the response is in valid JSON format.
122+
- In 'summary' property, provide a brief description of the issue, including symptoms, and reason for criticality.
123+
- In 'labels' property, include priority level (High, Medium, Low) and relevant issue labels.
124+
125+
## Notes
126+
- Always use available tools to complete the task.
127+
- Output the JSON summary at the very end of your response.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Run IssueLens Agent
2+
3+
on:
4+
schedule:
5+
# Run once daily at 1am UTC
6+
- cron: '0 1 * * *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
run-issuelens:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js 22
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
21+
- name: Install GitHub Copilot CLI
22+
run: npm install -g @github/copilot
23+
24+
- name: Run IssueLens with Copilot CLI
25+
id: issuelens
26+
run: |
27+
# Create MCP config
28+
echo '{"mcpServers": {"mcp-datetime": {"type": "local", "command": "uvx", "args": ["mcp-datetime"], "tools": ["*"]}}}' > mcp-config.json
29+
30+
# Run copilot CLI with issuelens custom agent
31+
output=$(copilot --agent=issuelens --additional-mcp-config @mcp-config.json --prompt "triage issues for repo \"${{ github.repository }}\"" 2>&1 || true)
32+
33+
echo "Raw output:"
34+
echo "$output"
35+
36+
# Extract JSON from output (looking for lines between curly braces)
37+
json_output=$(echo "$output" | sed -n '/^{/,/^}/p' | jq -c '.')
38+
39+
# If no JSON found with that pattern, try to extract any JSON
40+
if [ -z "$json_output" ]; then
41+
json_output=$(echo "$output" | grep -o '{[^}]*}' | jq -c '.' | head -1)
42+
fi
43+
44+
# If still no JSON, create a default payload with the raw output
45+
if [ -z "$json_output" ]; then
46+
json_output=$(jq -n --arg output "$output" '{"message": "IssueLens analysis complete", "output": $output}')
47+
fi
48+
49+
echo "Extracted JSON:"
50+
echo "$json_output"
51+
52+
# Save to output
53+
echo "payload=$json_output" >> $GITHUB_OUTPUT
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
COPILOT_GITHUB_TOKEN: ${{ secrets.PAT }}
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
59+
60+
- name: Trigger Notification
61+
uses: ./.github/actions/notification
62+
with:
63+
url: ${{ secrets.NOTIFICATION_URL }}
64+
payload: ${{ steps.issuelens.outputs.payload }}

0 commit comments

Comments
 (0)