wopee-mcp 1.30.2 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -344,6 +344,26 @@ Fetch test results for suite <suiteUuid>
344
344
  Show me the executed test cases for my latest analysis suite
345
345
  ```
346
346
 
347
+ ### Reporting
348
+
349
+ #### `wopee_create_github_issue`
350
+
351
+ Files a GitHub issue into the repository linked to the current project. Given a failed run's `executedTestCaseUuid`, Wopee.io adds what it knows about that run below your text: the failing step, expected vs actual, the failing step's screenshot and a link to the run in Commander.
352
+
353
+ - **Parameters:**
354
+ - `title` - The issue title
355
+ - `body` _(optional)_ - Markdown, kept verbatim above the run evidence
356
+ - `labels` _(optional)_ - Labels to apply, e.g. `["bug"]`. GitHub may skip labels the repository doesn't have; the result says which were applied
357
+ - `executedTestCaseUuid` _(optional)_ - The run to attach evidence from, as shown by `wopee_fetch_recent_executions` or `wopee_dispatch_agent`
358
+ - **Returns:** The issue number and URL, plus notes on anything left out (e.g. a screenshot that could not be uploaded)
359
+ - **Requirements:** The issue is created by the Wopee.io GitHub App and names you in its body. The App's installation needs the **Issues: Read & write** repository permission, and **Contents: Read & write** for the screenshot, which is committed to a separate `wopee-issue-assets` branch. That branch has no shared history with your code and is safe to delete; deleting it only breaks the images in existing issues.
360
+
361
+ **Example Usage:**
362
+
363
+ ```
364
+ File the failed checkout test as a GitHub issue
365
+ ```
366
+
347
367
  ## Typical Workflow
348
368
 
349
369
  1. **Start with a suite:**
@@ -369,6 +389,9 @@ Show me the executed test cases for my latest analysis suite
369
389
  - Use `wopee_fetch_executed_test_cases` to check detailed status and reports for a specific suite
370
390
  - Or use the `fetch-test-results` prompt for a formatted summary of all test results
371
391
 
392
+ 6. **Report failures:**
393
+ - Use `wopee_create_github_issue` with the failed run's `executedTestCaseUuid` to file it into your repository
394
+
372
395
  ## Available Prompts
373
396
 
374
397
  ### `fetch-project-summary`
@@ -295,11 +295,26 @@ export const FetchRecentExecutedTestCases = `
295
295
  }
296
296
  `;
297
297
  export const CreateGitHubIssue = `
298
- mutation CreateGitHubIssue($projectUuid: ID!, $title: String!, $body: String!, $labels: [String!]) {
299
- createGitHubIssue(projectUuid: $projectUuid, title: $title, body: $body, labels: $labels) {
298
+ mutation CreateGitHubIssue(
299
+ $projectUuid: ID!
300
+ $title: String!
301
+ $body: String!
302
+ $labels: [String!]
303
+ $executedTestCaseUuid: ID
304
+ ) {
305
+ createGitHubIssue(
306
+ projectUuid: $projectUuid
307
+ title: $title
308
+ body: $body
309
+ labels: $labels
310
+ executedTestCaseUuid: $executedTestCaseUuid
311
+ ) {
300
312
  url
301
313
  number
302
314
  title
315
+ screenshotAttached
316
+ labelsApplied
317
+ warnings
303
318
  }
304
319
  }
305
320
  `;
@@ -0,0 +1,21 @@
1
+ // The text an MCP caller reads back after filing an issue.
2
+ //
3
+ // No runtime imports, which keeps it unit-testable under `node --test`.
4
+ export function formatIssueCreated(issue, { withRunEvidence }) {
5
+ const lines = [
6
+ "GitHub issue created successfully:",
7
+ `- Title: ${issue.title}`,
8
+ `- Number: #${issue.number}`,
9
+ `- URL: ${issue.url}`,
10
+ ];
11
+ if (issue.labelsApplied?.length) {
12
+ lines.push(`- Labels: ${issue.labelsApplied.join(", ")}`);
13
+ }
14
+ if (withRunEvidence) {
15
+ lines.push(`- Run evidence: failing step, expected vs actual and the Commander report link added; screenshot ${issue.screenshotAttached ? "attached" : "not attached"}`);
16
+ }
17
+ for (const warning of issue.warnings ?? []) {
18
+ lines.push(`- Note: ${warning}`);
19
+ }
20
+ return lines.join("\n");
21
+ }
@@ -4,21 +4,27 @@ import { requestClient } from "../../utils/requestClient.js";
4
4
  import { _parseError } from "../shared/helpers.js";
5
5
  import { ToolName } from "../shared/types.js";
6
6
  import { CreateGitHubIssue } from "../shared/gql-queries.js";
7
+ import { formatIssueCreated } from "./format.js";
7
8
  const InputSchema = z.object({
8
9
  title: z.string().describe("The title of the GitHub issue"),
9
10
  body: z
10
11
  .string()
11
- .describe("The body/description of the GitHub issue (supports Markdown)"),
12
+ .optional()
13
+ .describe("The body/description of the GitHub issue (supports Markdown). Kept verbatim, above anything Wopee.io adds from the test run."),
12
14
  labels: z
13
15
  .array(z.string())
14
16
  .optional()
15
17
  .describe("Optional labels to apply to the issue (e.g., ['bug', 'testing'])"),
18
+ executedTestCaseUuid: z
19
+ .string()
20
+ .optional()
21
+ .describe("UUID of the executed test case the issue is about (the executedTestCaseUuid shown by wopee_fetch_recent_executions and wopee_dispatch_agent, or uuid in wopee_fetch_executed_test_cases). When set, Wopee.io adds the failing step, expected vs actual, the failing step's screenshot and a link to the run in Commander, so the body only needs your own analysis."),
16
22
  });
17
23
  export const wopeeCreateGithubIssue = {
18
24
  name: ToolName.WOPEE_CREATE_GITHUB_ISSUE,
19
25
  config: {
20
26
  title: "Create GitHub issue",
21
- description: "Create a new GitHub issue in the project's connected repository. Use this to report bugs found during testing, track test failures, or create action items from chat discussions. The issue will be created in the GitHub repository linked to the current project. Requires the project to have GitHub integration configured and WOPEE_PROJECT_UUID to be set.",
27
+ description: "Create a new GitHub issue in the project's connected repository. Use this to report bugs found during testing, track test failures, or create action items from chat discussions. For a failed test, pass its executedTestCaseUuid so the issue carries the run's evidence (failing step, expected vs actual, screenshot, report link). The issue is created by the Wopee.io GitHub App and names the requester in its body. Requires a GitHub repository linked to the project and WOPEE_PROJECT_UUID to be set.",
22
28
  inputSchema: InputSchema.shape,
23
29
  },
24
30
  handler: async (input) => {
@@ -33,15 +39,18 @@ export const wopeeCreateGithubIssue = {
33
39
  const result = await requestClient(CreateGitHubIssue, {
34
40
  projectUuid: WOPEE_PROJECT_UUID,
35
41
  title: input.title,
36
- body: input.body,
42
+ body: input.body ?? "",
37
43
  labels: input.labels || [],
44
+ ...(input.executedTestCaseUuid && {
45
+ executedTestCaseUuid: input.executedTestCaseUuid,
46
+ }),
38
47
  });
39
48
  if (!result?.createGitHubIssue)
40
49
  return {
41
50
  content: [
42
51
  {
43
52
  type: "text",
44
- text: "Failed to create GitHub issue. Make sure the project has GitHub integration configured.",
53
+ text: "Failed to create GitHub issue. Make sure the project has a GitHub repository linked.",
45
54
  },
46
55
  ],
47
56
  };
@@ -49,7 +58,9 @@ export const wopeeCreateGithubIssue = {
49
58
  content: [
50
59
  {
51
60
  type: "text",
52
- text: `GitHub issue created successfully:\n- Title: ${result.createGitHubIssue.title}\n- Number: #${result.createGitHubIssue.number}\n- URL: ${result.createGitHubIssue.url}`,
61
+ text: formatIssueCreated(result.createGitHubIssue, {
62
+ withRunEvidence: !!input.executedTestCaseUuid,
63
+ }),
53
64
  },
54
65
  ],
55
66
  };
@@ -52,6 +52,8 @@ export const wopeeFetchRecentExecutions = {
52
52
  // INCOMPLETE on top, and reporting it as FAILED tells the user their app is broken.
53
53
  const status = tc.agentReportStatus ?? tc.executionStatus;
54
54
  lines.push(`- ${tc.userStoryId}:${tc.testCaseId} [${tc.analysisIdentifier}] → ${status} (${tc.updatedAt})`);
55
+ // The handle wopee_create_github_issue takes to attach this run's evidence.
56
+ lines.push(` executedTestCaseUuid: ${tc.uuid}`);
55
57
  // Any report, not only a FINISHED run's: an incomplete run's report is what names the
56
58
  // infrastructure error behind it.
57
59
  if (tc.agentReport) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "bin": {
5
5
  "wopee-mcp": "./build/index.js"
6
6
  },
7
- "version": "1.30.2",
7
+ "version": "1.31.0",
8
8
  "mcpName": "io.github.Wopee-io/wopee-mcp",
9
9
  "description": "Wopee.io MCP server for autonomous testing platform",
10
10
  "main": "./build/index.js",