Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

The CleanPackageName method was allowing underscores and spaces in Identity Names, violating the MSIX schema pattern [-.A-Za-z0-9]+ and causing create-debug-identity failures.

Changes

  • Updated regex pattern from [^A-Za-z0-9\-_. ] to [^A-Za-z0-9.\-] to reject underscores and spaces
  • Removed obsolete logic for prepending "App" to names starting with underscore (net -8 lines)
  • Added test coverage for underscore/space removal and mixed character handling

Behavior

CleanPackageName("My_Test_Package")          // => "MyTestPackage"
CleanPackageName("Test Package Name")        // => "TestPackageName"  
CleanPackageName("Valid.Package-Name.123")   // => "Valid.Package-Name.123" (unchanged)

Identity Names now comply with MSIX AppxManifest schema requirements.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: A new manifest generates a non valid Identity name</issue_title>
<issue_description>### Describe the bug

When creating a new manifest (tested via winapp init), if the provided name contains underscore, it will happily use that name for the Identity Name even though it is not valid per the schema.

To Reproduce

  1. run winapp init
  2. Set the name to something that contains undescore (_)
  3. Try to create debug identity with winapp create-debug-identity
  4. Error

Expected behavior

The Name property of the Identity object should be valid per the schema [-.A-Za-z0-9]+

Screenshots

No response

OS Version and details

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 24, 2026 01:19
Co-authored-by: nmetulev <711864+nmetulev@users.noreply.github.com>
Co-authored-by: nmetulev <711864+nmetulev@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix generation of valid Identity name in manifest Fix Identity Name validation to enforce MSIX schema pattern Jan 24, 2026
Copilot AI requested a review from nmetulev January 24, 2026 01:26
@nmetulev nmetulev marked this pull request as ready for review January 26, 2026 23:46
@nmetulev nmetulev merged commit d9e5f07 into main Jan 30, 2026
6 checks passed
@nmetulev nmetulev deleted the copilot/fix-invalid-identity-name branch January 30, 2026 23:56
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.

[Bug]: A new manifest generates a non valid Identity name

3 participants