Skip to content

Add temporary_id support to update_project for draft issue references#14331

Merged
mnkiefer merged 5 commits intomainfrom
copilot/fix-draft-issue-update-tool
Feb 7, 2026
Merged

Add temporary_id support to update_project for draft issue references#14331
mnkiefer merged 5 commits intomainfrom
copilot/fix-draft-issue-update-tool

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Fix update_project safe outputs tool: Add temporary_id support for draft issues

Implementation Plan

  • Initial implementation complete
  • Address PR review feedback
    • Fix schema pattern for temporary_id to allow optional # prefix
    • Fix test IDs to use proper hex format (12 hex chars)
    • Use shared helpers from temporary_id.cjs for validation
    • Extract duplicate findExistingDraftByTitle function

Changes Made

1. Schema Updates (Comment 2777532857)

  • Updated temporary_id pattern to ^#?aw_[0-9a-f]{12}$ (allows optional # prefix)
  • Updated examples in descriptions to use valid hex format

2. Test IDs Fixed (Comment 2777532861)

  • Replaced all invalid test IDs with proper 12-hex-character format:
    • aw_smokedraft01aw_9f11121ed7df
    • aw_notfound123aw_aefe5b4b9585
    • aw_notfound456aw_27a9a9bfcc4e
    • aw_missing1234aw_1a2b3c4d5e6f

3. Validation with Shared Helpers (Comment 2777532863)

  • Added imports: isTemporaryId, normalizeTemporaryId from temporary_id.cjs
  • Added format validation for temporary_id and draft_issue_id
  • Use normalizeTemporaryId() for consistent map lookups
  • Clear error messages for invalid ID formats

4. Extract Duplicate Function (Comment 2777532867 - user requested)

  • Extracted findExistingDraftByTitle() as standalone helper function
  • Removed two inline anonymous function duplicates
  • Single consistent GraphQL selection set

Validation

✅ All 52 tests pass
✅ JavaScript formatted and linted


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 7, 2026 13:06
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
…lity

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer marked this pull request as ready for review February 7, 2026 13:09
Copilot AI review requested due to automatic review settings February 7, 2026 13:09
Copy link
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

This PR updates the update_project safe-output tool to better support GitHub Projects v2 draft issue workflows by allowing draft items to be referenced and updated via a stable temporary identifier across steps/messages.

Changes:

  • Added temporary_id and draft_issue_id inputs for draft issues in the update_project tool schema.
  • Updated update_project.cjs to store temporary_id -> draftItemId mappings on creation and to resolve draft_issue_id for updates (with title fallback).
  • Added new unit tests covering creation/update flows, # prefix normalization, fallbacks, and error cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
actions/setup/js/update_project.cjs Adds draft-issue create/update modes using temporary_id / draft_issue_id, including mapping storage and output.
actions/setup/js/update_project.test.cjs Adds test cases validating the new draft-issue reference/update behavior and error handling.
actions/setup/js/safe_outputs_tools.json Extends the update_project input schema to document/validate the new draft-issue parameters.
Comments suppressed due to low confidence (1)

actions/setup/js/safe_outputs_tools.json:639

  • Inconsistent temporary ID format in the schema: draft_issue_id is constrained to ^#?aw_[0-9a-f]{12}$, but the description examples use aw_smokedraft01/#aw_smokedraft01 (non-hex). Please either update the examples to a valid 12-hex ID (e.g., aw_abc123def456) or relax the pattern to match the intended allowed format.
        "draft_issue_id": {
          "type": "string",
          "pattern": "^#?aw_[0-9a-f]{12}$",
          "description": "Temporary ID of an existing draft issue to update (e.g., 'aw_smokedraft01' or '#aw_smokedraft01'). Use this to reference a draft created earlier with a matching temporary_id. When provided, draft_title is not required for updates."
        },

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI changed the title [WIP] Fix update_project tool for draft issue references Add temporary_id support to update_project for draft issue references Feb 7, 2026
Copilot AI requested a review from mnkiefer February 7, 2026 13:15
…act duplicate function, fix test IDs

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
@mnkiefer mnkiefer merged commit 7195ef6 into main Feb 7, 2026
49 of 50 checks passed
@mnkiefer mnkiefer deleted the copilot/fix-draft-issue-update-tool branch February 7, 2026 13: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.

3 participants