Skip to content

Fix update_project: Add type mismatch detection - #8920

Merged
mnkiefer merged 3 commits into
mainfrom
copilot/fix-errors-in-update-project-step
Jan 4, 2026
Merged

Fix update_project: Add type mismatch detection#8920
mnkiefer merged 3 commits into
mainfrom
copilot/fix-errors-in-update-project-step

Conversation

CopilotAI commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

The code attempted to use updateProjectV2Field mutation to add options to single-select fields. This mutation does not exist in GitHub's GraphQL API.

Changes

  • Removed non-existent mutation calls: Replaced attempts to call updateProjectV2Field with warnings that guide users to manually add options via GitHub Projects UI
  • Added field type mismatch detection: Detects when existing fields have incorrect types (DATE/TEXT/SINGLE_SELECT) based on field name heuristics and values, warns users to recreate fields with correct type

Type Detection Heuristics

// Determines expected field type from field name and valueconstisDateField=fieldName.toLowerCase().includes("date")&&/^\d{4}-\d{2}-\d{2}$/.test(fieldValue);constisTextField=fieldName.toLowerCase()==="classification"||fieldValue.includes("|");// Otherwise expects SINGLE_SELECT// Warns when actual type doesn't match expectedif(field.dataType!==expectedDataType){core.warning(`Field type mismatch: Expected ${expectedDataType} but found ${field.dataType}`);}

API Limitations

Per GitHub's documentation:

  • createProjectV2Field - Creates fields with initial options
  • updateProjectV2ItemFieldValue - Updates item field values
  • updateProjectV2Field - Does not exist; cannot modify field options via API

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:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login -json GO111MODULE 0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE 0.1-go1.25.0.lin--jq env -json GO111MODULE 0.1-go1.25.0.linux-amd64/bin/go GOINSECURE GOMOD GOMODCACHE rg/toolchain@v0.REDACTED (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login /home/REDACTED/work/gh-aw/gh-aw/.github/workflows rev-parse /home/REDACTED/.local/share/gh/extensions/gh-aw/gh-aw -json GO111MODULE rg/toolchain@v0.xterm-color /home/REDACTED/.local/share/gh/extInitial commit stat�� /ref/tags/v8 rg/toolchain@v0.--jq /usr/bin/git -json GO111MODULE .cfg git (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login /ref/tags/v8 --jq /usr/bin/git -json GO111MODULE pkg/mod/golang.oxterm-color git -C ithub-script/git/ref/tags/v8 rev-parse /usr/bin/git se 0930335/b034/vetapi .cfg git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Fix errors in update project step:
https://github.com/githubnext/gh-aw/actions/runs/20696858098/job/59413490565
See this guide for GraphQL reference:
https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/using-the-api-to-manage-projects#updating-projects


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

CopilotAIand others added 2 commits January 4, 2026 18:15
…tion
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix errors in update project stepFix update_project: Remove non-existent updateProjectV2Field mutation and add type mismatch detectionJan 4, 2026
CopilotAI requested a review from mnkieferJanuary 4, 2026 18:30
@mnkiefermnkiefer changed the title Fix update_project: Remove non-existent updateProjectV2Field mutation and add type mismatch detectionFix update_project: Add type mismatch detectionJan 4, 2026
@mnkiefer
mnkiefer marked this pull request as ready for review January 4, 2026 18:34
@mnkiefer
mnkiefer merged commit 7ab9710 into mainJan 4, 2026
201 of 202 checks passed
@mnkiefer
mnkiefer deleted the copilot/fix-errors-in-update-project-step branch January 4, 2026 18:39
Sign up for freeto 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

@mnkiefer