Skip to content

Extract semantic project identifier regex into a composed constant#23197

Merged
akabiru merged 1 commit into
devfrom
refactor/extract-semantic-project-identifier-format
May 13, 2026
Merged

Extract semantic project identifier regex into a composed constant#23197
akabiru merged 1 commit into
devfrom
refactor/extract-semantic-project-identifier-format

Conversation

@akabiru
Copy link
Copy Markdown
Member

@akabiru akabiru commented May 13, 2026

Split out of #22976 at the reviewer's request so #23186 can land its symmetric CLASSIC_IDENTIFIER_CHARS refactor without waiting on the larger feature PR.

The [A-Z][A-Z0-9_]* shape that defines a semantic project identifier
appears in three places that each redefine it inline: the validator's
body check, the work-package semantic-id pattern composed into the
route constraint, and the wiki reverse-link parser.

Lift the unanchored shape to Projects::Identifier::SEMANTIC_FORMAT and
have WorkPackage::SemanticIdentifier::SEMANTIC_ID_PATTERN compose from
it via .source, with ID_ROUTE_CONSTRAINT in turn composing from that.
The validator keeps its own anchored start/body patterns because each
pattern produces a distinct error message — composing the two from
SEMANTIC_FORMAT would obscure that contract.

Split out of #22976 so #23186 can introduce its CLASSIC_IDENTIFIER_CHARS
counterpart without conflicting with the larger feature PR.
@akabiru akabiru force-pushed the refactor/extract-semantic-project-identifier-format branch from b264708 to 741aea9 Compare May 13, 2026 14:04
@akabiru akabiru self-assigned this May 13, 2026
@akabiru akabiru marked this pull request as ready for review May 13, 2026 14:06
@akabiru akabiru requested a review from thykel May 13, 2026 14:06
Copy link
Copy Markdown
Contributor

@thykel thykel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@akabiru akabiru merged commit fd9a5be into dev May 13, 2026
17 checks passed
@akabiru akabiru deleted the refactor/extract-semantic-project-identifier-format branch May 13, 2026 14:50
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants