Skip to content

fix: preserve feature numbering during reinitialization - #5101

Open
Shubham-Padkonde wants to merge 1 commit into
github:mainfrom
Shubham-Padkonde:fix/5098-preserve-feature-numbering
Open

Shubham-Padkonde wants to merge 1 commit into
github:mainfrom
Shubham-Padkonde:fix/5098-preserve-feature-numbering

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

Description

Fixes #5098. Re-running specify init --here --force currently replaces a project's feature_numbering: "timestamp" with "sequential". Preserve the existing setting, defaulting to sequential only when it is absent. Fresh initialization still uses sequential numbering.

The regression test exercises real offline initialization and re-initialization for timestamp, sequential, and missing settings. It also verifies that a custom option survives while the current here option is updated.

Testing

  • Tested locally with this checkout's .venv/Scripts/specify --help.
  • Installed test dependencies with uv sync --extra test and ran the affected tests using this checkout's virtualenv.
  • Tested with a sample project.

On Windows with Python 3.14.6:

  • Before the fix, the timestamp regression fails; the sequential and missing-setting controls pass. After the fix, all three pass.
  • .venv/Scripts/python -m pytest tests/specify_cli/test_command_init.py tests/test_branch_numbering.py -q: 20 passed, 3 shell-dependent tests skipped.
  • .venv/Scripts/python -m pytest tests/integrations/test_cli.py -k 'not symlink' -q: 70 passed, 1 skipped, 5 deselected, 2 failed. Both failures occur in fixture setup at os.symlink with Windows error 1314 (missing symlink privilege), before exercising the changed code. The unrestricted integration run encounters the same privilege limitation. The full repository suite was not run.
  • Initialized an offline generic sample, selected timestamp numbering, and re-initialized it. The setting remained timestamp. Codex then followed the generated specification command instructions for a local-notes export feature, producing a timestamp-prefixed feature directory, specification, checklist, and matching .specify/feature.json.
  • git diff --check passes. Ruff reports the same eight existing findings in command_init.py on the unchanged base and this branch; the test file has no findings.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance

AI disclosure: OpenAI Codex (GPT-6), operating autonomously on behalf of Shubham-Padkonde, investigated the issue, generated the code and tests, ran validation and the sample workflow, and drafted this PR. A more specific model variant/reasoning setting is not exposed to the agent. This disclosure does not claim personal line-by-line human review.

Assisted-by: Codex (model: GPT-6, autonomous)

This branch has not been deployed

No deployments
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]: Re-running specify init --here --force resets feature_numbering in init-options.json to "sequential"

1 participant