fix: accept 4+ digit spec numbers in tests and docs#2094
Open
alex-zwingli wants to merge 1 commit intogithub:mainfrom
Open
fix: accept 4+ digit spec numbers in tests and docs#2094alex-zwingli wants to merge 1 commit intogithub:mainfrom
alex-zwingli wants to merge 1 commit intogithub:mainfrom
Conversation
Two test assertions in test_timestamp_branches.py used the regex
`\d{3}` (exactly 3 digits) instead of `\d{3,}` (3 or more digits).
While the underlying shell scripts already handle spec numbers ≥ 1000
correctly — printf "%03d" and PowerShell '{0:000}' both expand naturally
beyond 3 digits, and all detection regexes use {3,} — the overly-strict
test assertions would fail with a misleading error if a fixture ever
contained 1000+ spec directories.
Documentation in README.md, spec-driven.md, and the CLI --branch-numbering
help text implied that sequential spec numbers are always 3 digits, which
could lead users to believe a hard limit of 999 exists.
Changes:
- tests/test_timestamp_branches.py: change two \d{3} assertions to \d{3,}
- src/specify_cli/__init__.py: clarify help text to show numbers expand past 999
- README.md: update --branch-numbering docs to note numbers expand beyond 3 digits
- spec-driven.md: update feature numbering description to include 4-digit example
Fixes github#2093
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates tests and documentation to correctly reflect that sequential spec/branch numbering supports 4+ digit prefixes (e.g., 1000+) rather than implying a hard 3-digit limit, aligning assertions and user-facing text with existing script behavior.
Changes:
- Relax sequential branch-name test assertions from
\d{3}to\d{3,}to allow 1000+ prefixes. - Clarify
--branch-numberinghelp/documentation to state sequential numbering expands past 999 automatically. - Update SDD documentation to include examples beyond 3 digits.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_timestamp_branches.py |
Updates two regex assertions to accept 3+ digit sequential prefixes. |
src/specify_cli/__init__.py |
Adjusts --branch-numbering help text to clarify 1000+ behavior. |
README.md |
Updates CLI options table description for --branch-numbering to include 1000+ examples. |
spec-driven.md |
Updates feature numbering description to explicitly mention expansion beyond 3 digits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2093
The shell scripts already handle spec numbers ≥ 1000 correctly —
printf "%03d"and PowerShell'{0:000}'expand naturally beyond 3 digits, and all detection regexes throughoutcommon.sh,common.ps1, andcreate-new-feature.*use{3,}quantifiers. However, two issues remained:1. Overly-strict test assertions
Two assertions in
tests/test_timestamp_branches.pyused\d{3}(exactly 3 digits):These tests pass today because their fixtures start from low spec numbers, but the hard-coded
\d{3}would produce a misleading failure if a test context ever had 1000+ specs — rather than confirming the scripts work correctly with 4-digit prefixes.2. Documentation implied a 3-digit hard limit
Three docs described sequential numbering exclusively with 3-digit examples (
001, 002, 003), implying a hard cap of 999 specs. Updated to clarify that numbers expand naturally past 3 digits.Changes
tests/test_timestamp_branches.py\d{3}→\d{3,}in two assertionssrc/specify_cli/__init__.py--branch-numberinghelp text updatedREADME.md--branch-numberingtable row updatedspec-driven.mdTesting
All existing tests pass:
The existing
test_sequential_supports_four_digit_prefixestest (introduced previously) confirms the scripts work end-to-end with a 4-digit transition (999 → 1000 → 1001).