fix(rust-guard): use correct JSON pointer key for search_repositories response#2407
Merged
Merged
Conversation
… response Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw-mcpg/sessions/5dec785d-967e-45f7-ab2c-878e153c5247
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Fix rust-guard to handle GraphQL-format search results and bot-author filtering
fix(rust-guard): use correct JSON pointer key for search_repositories response
Mar 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes path-based labeling for the search_repositories tool when the response uses a GraphQL-style repositories array instead of the REST-style items array, ensuring RFC 6901 JSON Pointer paths and items_path point at real locations in the response.
Changes:
- Track which collection key was matched (
itemsvsrepositories) and use it when constructing per-item JSON Pointer paths anditems_path. - Add regression tests covering both
repositories(GraphQL-style) anditems(REST-style) response shapes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
guards/github-guard/rust-guard/src/labels/response_paths.rs |
Preserve the matched array key and use it to build correct per-item paths (/{key}/{i}) and items_path (/{key}) for search_repositories. |
guards/github-guard/rust-guard/src/labels/mod.rs |
Add regression tests validating correct path prefixes for both repositories and items response formats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Mar 24, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
search_repositoriesfell back to reading from arepositorieskey (GraphQL-style) but then hardcoded/itemsin both per-item JSON Pointer paths anditems_path, so labels would point at non-existent locations when the response usedrepositories.Changes
response_paths.rs: Replace.or_else()chaining with an explicitif letchain that captures which key was matched ("items"vs"repositories"); use/{key}/{i}for per-item paths and/{key}foritems_path.mod.rs: Two regression tests — one forrepositorieskey producing/repositories/{i}paths, one confirming RESTitemskey still produces/items/{i}.⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.