Skip to content

[bug-fix] Fix oversized-number-crash: bound Python --number parsing - #5200

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
fix/5194-oversized-number-crash-4b620ea38b337406
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
fix/5194-oversized-number-crash-4b620ea38b337406

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Bug fix — oversized-number-crash

Proposed fix for issue #5194, applying the
remediation from the bug assessment.

Verdict: valid · Severity: low

Summary

The Python extension branch-creation script now validates --number against a bounded integer domain before conversion, so oversized numeric inputs fail with a clear argument error instead of crashing at int().

Changes

File Change Notes
extensions/git/scripts/python/create_new_feature_branch.py modified Added int64-style bound validation (0..2**63-1) for --number and a defensive conversion guard with user-facing error text.
tests/extensions/git/test_git_extension_python_parity.py modified Added boundary and regression tests for max, max+1, and oversized digit-only --number inputs; asserts no traceback on rejection.

Tests Added or Updated

  • tests/extensions/git/test_git_extension_python_parity.py::TestCreateFeatureBranchParity::test_explicit_number_max_int64_accepted — verifies the maximum supported explicit number is accepted.
  • tests/extensions/git/test_git_extension_python_parity.py::TestCreateFeatureBranchParity::test_explicit_number_above_max_int64_rejected — pins rejection for max+1 with expected error message.
  • tests/extensions/git/test_git_extension_python_parity.py::TestCreateFeatureBranchParity::test_explicit_number_oversized_digits_rejected_without_traceback — verifies long digit strings are rejected cleanly without traceback.

Local Verification

  • Commands run: python3 extensions/git/scripts/python/create_new_feature_branch.py --json --dry-run --number 42 "some feature" → pass (exit 0)
  • Commands run: python3 extensions/git/scripts/python/create_new_feature_branch.py --json --dry-run --number 9223372036854775808 "some feature" → expected validation failure (exit 1, bounded-range error)
  • Commands run: python3 extensions/git/scripts/python/create_new_feature_branch.py --json --dry-run --number <5000-digit number> "some feature" → expected validation failure (exit 1, bounded-range error, no traceback)
  • python3 -m pytest ... could not run in this runner because pytest is unavailable in the base Python environment.

Deviations from Assessment

  • Added Python-only parity tests that explicitly codify current divergence from bash for oversized --number handling, rather than changing bash/powershell behavior in this fix-stage patch.

Risks & Review Notes

  • Bash/PowerShell extension twins currently do not enforce the same explicit upper bound for --number; this PR intentionally scopes remediation to the Python crash path identified in the assessment.

Refs #5194 · cc @soarkit

Generated by 🛠️ Fix Bug from Labeled Issue for #5194 · copilot · gpt53codex · 49.1 AIC · ⌖ 0.695 AIC · ⊞ 25.1K · ◷

Apply the remediation from the bug assessment on issue
#5194.

Refs #5194

Assisted-by: GitHub Copilot (model: gpt-5.3-codex, autonomous)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automated bug-fix Trigger the bug-fix agentic workflow labels Oct 30, 2026
@mnriem mnriem added the triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate label Oct 30, 2026

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

automated bug-fix Trigger the bug-fix agentic workflow triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The Python branch-creation port accepts an oversized --number and crashes at int() instead of rejecting it

1 participant