Skip to content

TestItem by ID resource template#2

Merged
avarabyeu merged 2 commits into
mainfrom
test-item-resource
Jun 6, 2025
Merged

TestItem by ID resource template#2
avarabyeu merged 2 commits into
mainfrom
test-item-resource

Conversation

@avarabyeu
Copy link
Copy Markdown
Member

add resource template for retrieving test items by ID; update parameter extraction in toolGetTestItemById

@avarabyeu avarabyeu requested a review from Copilot June 6, 2025 09:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new resource template for fetching individual test items by ID and updates the existing tool handler to use the correct parameter name.

  • Registers resourceTestItem in the server setup.
  • Renames comments and extracts the test_item_id parameter in toolGetTestItemById.
  • Implements resourceTestItem to parse URIs, fetch a test item, and return its JSON payload.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/reportportal/server.go Added call to register the new resource template
internal/reportportal/items.go Updated parameter extraction and added resource template logic
Comments suppressed due to low confidence (2)

internal/reportportal/items.go:110

  • [nitpick] The variable name uses Id instead of ID, which is inconsistent with the rest of the code (e.g., testItemID). Consider renaming to testItemIDStr for consistency.
testItemIdStr, found := paramValues["testItemId"]

internal/reportportal/items.go:100

  • The new resourceTestItem function is not covered by any tests. Consider adding unit tests for URI matching, missing parameters, and successful JSON output.
func (lr *TestItemResources) resourceTestItem() (mcp.ResourceTemplate, server.ResourceTemplateHandlerFunc) {

Comment thread internal/reportportal/items.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@avarabyeu avarabyeu merged commit 7f283f0 into main Jun 6, 2025
1 check passed
@avarabyeu avarabyeu deleted the test-item-resource branch June 6, 2025 09:37
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