test: cover file_content scope forwarding for Harness Code APIs#604
Draft
cursor[bot] wants to merge 2 commits into
Draft
test: cover file_content scope forwarding for Harness Code APIs#604cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
AI-Session-Id: 103ece16-0d3e-4af0-a493-04e44aa113c9 AI-Tool: claude-code AI-Model: unknown
Add registry dispatch tests for file_content get and blame execute actions to guard #602 — orgIdentifier/projectIdentifier must be forwarded when org_id/project_id are provided, and omitted for account-scoped repos when scope is not specified. Co-authored-by: Rohan Gupta <thisrohangupta@users.noreply.github.com>
|
|
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.
Description
Adds registry dispatch tests for the
file_contentresource introduced in #602. That fix forwardsorgIdentifier/projectIdentifierquery parameters on file content and blame requests so Harness Code can resolve project-scoped repositories.Risky behavior now covered
file_contentget:org_id/project_idinputs are forwarded asorgIdentifier/projectIdentifierquery params; omitted when not provided (account-scoped repos).file_contentblame execute: same scope forwarding for the blame action, including optionalgit_refand line range params.queryParamsmaps use snake_case input keys (org_id,project_id) and thatscopeOptionalprevents silent config-default injection.Test files added/updated
tests/registry/repositories.test.ts(new, 7 tests)Why these tests materially reduce regression risk
Without scope forwarding,
harness_get(resource_type="file_content")andharness_execute(..., action="blame")silently hit the wrong repository scope — the run succeeds but returns content from an account-level repo or 404s on project-scoped repos. This is the same class of silent-failure bug fixed in #579 (git context for input sets). The tests lock the dispatch contract so future refactors to scope injection or query param mapping cannot drop these params again.Type of Change
Checklist
pnpm testpasses (targeted:tests/registry/repositories.test.ts)pnpm typecheckpassespnpm buildpassespnpm standards:checkpassespnpm docs:checkpasses