Skip to content

[BugSnag] PLAT-14898: Added the ability to add comments to BugSnag errors#338

Draft
jasonMcCullough wants to merge 1 commit intomainfrom
PLAT-14898-add-ability-to-add-comments-to-errors
Draft

[BugSnag] PLAT-14898: Added the ability to add comments to BugSnag errors#338
jasonMcCullough wants to merge 1 commit intomainfrom
PLAT-14898-add-ability-to-add-comments-to-errors

Conversation

@jasonMcCullough
Copy link
Contributor

Goal

Adds the ability for comments to be added to errors in BugSnag.

Design

This coincides with how comments are normally created via the dashboard. Only with this, we're exposing it for being called via MCP instead.

Changeset

  • createCommentOnError exposes the /comments endpoint and manages the necessary query parameter and header logic.
  • createCommentOnErrorInputSchema contains the Zod logic for defining how interactions should be structured when making calls to the /comments endpoint.

Testing

image image

…rors (#334)

* feat: added ability to add comments to bugsnag errors

* chore: auth token usage cleanup, uses it as an Authorization header value instead of my original idea of using it as a query parameter

* chore: formatting improvements via npm run format command

* basic test coverage for commenting on a bugsnag

* chore: format fixes in test file
@github-actions
Copy link
Contributor

🎯 Coverage Target Met!

📈 Coverage Metrics

Metric Coverage Target Status
Lines 93.1% 80%
Functions 81.0% 80%
Branches 85.6% 80%
Statements 93.1% 80%

📊 Test Statistics

  • Total Lines: 18,685 / 20,076
  • Total Functions: 209 / 258
  • Total Branches: 783 / 915
  • Total Statements: 18685 / 20076

🔍 Files Needing Coverage

File Coverage
src/qmetry/client/testsuite.ts 10.3%
src/qmetry/client/issues.ts 20.1%
src/swagger/client/api.ts 30.0%
src/swagger/config-utils.ts 44.4%
src/qmetry/client/testcase.ts 58.0%

📝 Report generated on Node.js v24.12.0 • View workflow • Coverage by Vitest + v8

@jasonMcCullough
Copy link
Contributor Author

This was originally on a fork, I've since merged the content from my fork branch pull request to here to make finding it a bit easier.

Comment on lines +224 to +238
const url = new URL(
`/projects/${projectId}/errors/${errorId}/comments`,
this.configuration.basePath,
);

const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Bugsnag-Api": "true",
Authorization: this.configuration.apiKey,
},
body: JSON.stringify({ message }),
};

Copy link
Contributor

Choose a reason for hiding this comment

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

we generate the API code from the openAPI spec which should generate the creator for this request.

is how we do that. We should use something like that for this endpoint

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Sachin, the way I did this is a bit rough and ready I have to admit. I'll see if I have enough time to give this a good polish

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll not have time to finish this unfortunately Sachin but hopefully somebody can have a blast at this after I leave SmartBear 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants