Skip to content

Align update_project temporary ID pattern with schema definition#16101

Merged
mnkiefer merged 2 commits intofix-tmp-idsfrom
copilot/sub-pr-16098
Feb 16, 2026
Merged

Align update_project temporary ID pattern with schema definition#16101
mnkiefer merged 2 commits intofix-tmp-idsfrom
copilot/sub-pr-16098

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

The update_project handler used a hardcoded regex /^aw_[0-9a-f]{12}$/i (12 hex chars) that rejected schema-valid temporary IDs like aw_abc1 or #aw_Test99, causing valid inputs to fail as invalid project URLs.

Changes:

  • Handler alignment: Replace hardcoded pattern with isTemporaryId() and normalizeTemporaryId() from temporary_id.cjs to support canonical format aw_[A-Za-z0-9]{3,8}
  • Test coverage: Add 5 tests covering generated IDs (8 chars), hash-prefixed IDs, minimum length (3 chars), missing ID errors, and URL pass-through

Before:

if (/^aw_[0-9a-f]{12}$/i.test(projectWithoutHash)) {
  const resolved = tempIdMap.get(projectWithoutHash.toLowerCase());
  // ...
}

After:

if (isTemporaryId(projectWithoutHash)) {
  const normalizedId = normalizeTemporaryId(projectWithoutHash);
  const resolved = tempIdMap.get(normalizedId);
  // ...
}

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



✨ PR Review Safe Output Test - Run 22063204730

💥 [THE END] — Illustrated by Smoke Claude

Update update_project handler to use canonical temporary ID pattern (aw_[A-Za-z0-9]{3,8}) instead of hardcoded hex pattern (aw_[0-9a-f]{12}). This aligns the handler with the schema definition and the temporary_id.cjs canonical format.

Changes:
- Use isTemporaryId() and normalizeTemporaryId() from temporary_id.cjs
- Add comprehensive tests for temporary project ID resolution
- Test various valid formats (3-8 alphanumeric chars, with/without # prefix)
- Test error handling for missing temporary IDs

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

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:

  • https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js (http block)

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

Copilot AI changed the title [WIP] Add changes to address feedback on ID pattern clean-up Align update_project temporary ID pattern with schema definition Feb 16, 2026
Copilot AI requested a review from mnkiefer February 16, 2026 13:01
@mnkiefer mnkiefer marked this pull request as ready for review February 16, 2026 13:01
Copilot AI review requested due to automatic review settings February 16, 2026 13:01
@mnkiefer mnkiefer merged commit 120acc3 into fix-tmp-ids Feb 16, 2026
123 checks passed
@mnkiefer mnkiefer deleted the copilot/sub-pr-16098 branch February 16, 2026 13:02
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 aligns the update_project handler's temporary project ID validation with the schema definition by replacing a hardcoded regex pattern that only accepted 12 hex characters with the canonical helper functions from temporary_id.cjs. This fix resolves a bug where valid temporary IDs like aw_abc1 (4 alphanumeric characters) or #aw_Test99 (7 alphanumeric characters with hash prefix) were incorrectly rejected.

Changes:

  • Replaced hardcoded regex /^aw_[0-9a-f]{12}$/i with isTemporaryId() and normalizeTemporaryId() helper functions in update_project.cjs
  • Added 5 comprehensive tests covering generated IDs (8 chars), hash-prefixed IDs, minimum length IDs (3 chars), missing ID errors, and URL pass-through behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
actions/setup/js/update_project.cjs Updated temporary project ID validation to use canonical helper functions instead of hardcoded regex pattern
actions/setup/js/update_project.test.cjs Added comprehensive test suite for temporary project ID resolution covering all edge cases

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

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