Align update_project temporary ID pattern with schema definition#16101
Align update_project temporary ID pattern with schema definition#16101mnkiefer merged 2 commits intofix-tmp-idsfrom
Conversation
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>
|
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:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
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}$/iwithisTemporaryId()andnormalizeTemporaryId()helper functions inupdate_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.
The
update_projecthandler used a hardcoded regex/^aw_[0-9a-f]{12}$/i(12 hex chars) that rejected schema-valid temporary IDs likeaw_abc1or#aw_Test99, causing valid inputs to fail as invalid project URLs.Changes:
isTemporaryId()andnormalizeTemporaryId()fromtemporary_id.cjsto support canonical formataw_[A-Za-z0-9]{3,8}Before:
After:
✨ 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