Skip to content

fix(setup): normalize short name boundaries for package validity - #292

Merged
c-vigo merged 3 commits into
release/0.3.0from
bugfix/291-release-failed-automatic-rollback
Mar 13, 2026
Merged

c-vigo merged 3 commits into
release/0.3.0from
bugfix/291-release-failed-automatic-rollback

Conversation

@c-vigo

@c-vigo c-vigo commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a release-blocking edge case where sanitized project names could end with _, producing an invalid pyproject.toml package name during install/integration flows. Adds a regression test, applies boundary-safe normalization in both install paths, and records the fix in the changelog.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • tests/test_install_script.py
    • Added test_dry_run_name_sanitization_trims_trailing_separator.
    • Verifies --name "Install-Test-Project-" becomes install_test_project (no trailing underscore).
  • install.sh
    • Updated sanitize_name() to collapse duplicate underscores, trim non-alphanumeric boundaries, and fallback to project when empty.
  • assets/init-workspace.sh
    • Mirrored the same short-name normalization to keep runtime initialization behavior consistent with install-time behavior.
  • CHANGELOG.md
    • Added a ### Fixed entry for issue #291 under the active 0.3.0 section.

Changelog Entry

Fixed

  • Install name sanitization trims invalid package boundaries (#291)
    • install.sh now normalizes sanitized project names to ensure they start/end with alphanumeric characters before passing SHORT_NAME
    • init-workspace.sh mirrors the same normalization so generated pyproject.toml names cannot end with separators like _

Testing

  • Tests pass locally (just test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Refs: #291

@c-vigo c-vigo self-assigned this Mar 13, 2026
@c-vigo
c-vigo requested a review from Copilot March 13, 2026 12:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes a release-blocking bug where sanitized project names could end with _, producing invalid Python package names in pyproject.toml. Adds boundary normalization to both install paths and a regression test.

Changes:

  • Harden sanitize_name() in install.sh and mirrored logic in init-workspace.sh to collapse duplicate underscores, strip non-alphanumeric boundaries, and fallback to "project"
  • Add regression test verifying trailing-separator trimming
  • Record the fix in CHANGELOG.md

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
install.sh Enhanced sanitize_name() with boundary normalization and empty fallback
assets/init-workspace.sh Mirrored the same normalization inline
tests/test_install_script.py Added regression test for trailing-separator trimming
CHANGELOG.md Added Fixed entry for #291

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@c-vigo
c-vigo merged commit be28810 into release/0.3.0 Mar 13, 2026
16 checks passed
@c-vigo
c-vigo deleted the bugfix/291-release-failed-automatic-rollback branch March 13, 2026 12:21
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.

2 participants