Repository navigation
fix: look up project field by node ID in setFieldValue - #39
Merged
kunwarVivek merged 1 commit intoOct 20, 2026
Merged
Conversation
setFieldValue resolved the field with ProjectV2.field(id:), but that field only accepts `name`, so GitHub rejected every call: Field 'field' is missing required arguments: name Field 'field' doesn't accept argument 'id' This broke manage_project set_field_value (e.g. moving a board item between Status columns) and assignItemsToIteration, which goes through the same path. Query the field with node(id: $fieldId) instead. The unit tests mocked the invalid response shape, so they passed. Reshape the mocks to the real one and add a regression test on the lookup query plus a non-field-node case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kunwarVivek
marked this pull request as ready for review
October 20, 2026 16:01
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.
Summary
set_field_valuecannot update any field: the lookup query usesProjectV2.field(id:), but that field only acceptsname. GitHub rejects the query, so moving a board item between Status columns (or setting any text/number/date/iteration field) always fails.assignItemsToIterationgoes through the same path.The existing unit tests mocked the invalid
{ node: { field } }response shape, which is why they passed. The mocks now use the real shape, and there are two new tests:node(id: $fieldId), notfield(id:, and is sent only{ fieldId }{}) throwsResourceNotFoundErrorwithout attempting the mutationEvidence
Before (v2.3.1, live GitHub, single-select Status field on an org project):
New tests run against the old source: 6 failed (5 existing set cases with corrected mocks + the query regression test).
After:
Ran from this branch's
npm run buildoutput against the live project. A bogus server path was used as a control to confirm the branch build, not an installed copy, served the call.npx vitest run src/__tests__/unit/services/FieldValueService.test.ts: 16 passed.npx vitest run(full suite, afternpm run build): 0 failed, 3063 passed vs 3061 onmain(+2 new tests).npm run build: passes.npx biome checkon the two changed files: 3 findings, the same 3 as onmain(import order, an existingany). None are on changed lines, so I left them alone.Not run: GitNexus impact / detect-changes from
AGENTS.md(needs the GitNexus CLI, which I don't have set up as an outside contributor). I checked callers by text search instead:ProjectManagementService.setFieldValueandIterationService.assignItemsToIteration.Merge Danger
Door: two-way
One query in one method; revert is trivial. The response contract of
setFieldValueis unchanged.Blast Radius: narrow
Only
setFieldValueand its two callers. They were failing on every call, so nothing that works today can regress. Note:assignItemsToIterationgets its field ID fromlistProjectFields, which returns[]in my testing (findByIddoes not load fields). That is a separate bug not fixed here, so iteration assignment may still fail upstream of this change.🤖 Generated with Claude Code