Skip to content

fix: preserve path separators in create command argument#526

Open
srtaalej wants to merge 1 commit intoale-fix-display-name-casingfrom
ale-fix-create-path-regression
Open

fix: preserve path separators in create command argument#526
srtaalej wants to merge 1 commit intoale-fix-display-name-casingfrom
ale-fix-create-path-regression

Conversation

@srtaalej
Copy link
Copy Markdown
Contributor

@srtaalej srtaalej commented May 7, 2026

Summary

  • Fixes the slack create path/to/my-app regression where path separators were being replaced with dashes, creating a flat path-to-my-app directory instead of preserving the path/to/my-app structure
  • Adds parseAppPath helper that splits user input into path prefix + basename, only kebab-casing the basename
  • Display name for manifests is derived from the raw basename (not the full path)

Behavior

$ slack create my-app              # dir: ./my-app/        manifest: "my-app"
$ slack create "My App"            # dir: ./my-app/        manifest: "My App"
$ slack create path/to/my-app      # dir: ./path/to/my-app/ manifest: "my-app"
$ slack create path/to/My App      # dir: ./path/to/my-app/ manifest: "My App"

Stacks on #521 which handles the display name vs dir name separation.

Test plan

  • TestParseAppPath — 12 cases covering simple names, paths, absolute paths, dot-prefixed, trailing slashes, and error cases
  • Existing TestGetProjectDirectoryName still passes (single-component names)
  • Full test suite (go test ./...) passes
  • Manual: slack create path/to/my-app with existing path/to/ directory → verify nested structure created and manifest has my-app
  • Manual: slack create "My App" → verify dir is my-app, manifest display is My App

The getAppDirName function was normalizing the entire input including
path separators, so `slack create path/to/my-app` produced a flat
directory `path-to-my-app` instead of preserving the path structure.

Adds parseAppPath which splits user input into path prefix and basename,
only kebab-casing the basename. The display name for manifests is
derived from the raw basename (preserving original casing).

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@srtaalej srtaalej requested a review from a team as a code owner May 7, 2026 21:16
@srtaalej srtaalej added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch Use on pull requests to describe the release version increment labels May 7, 2026
@srtaalej srtaalej self-assigned this May 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.30%. Comparing base (39cdaad) to head (ac8fcea).

Files with missing lines Patch % Lines
internal/pkg/create/create.go 68.42% 6 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##           ale-fix-display-name-casing     #526      +/-   ##
===============================================================
+ Coverage                        71.27%   71.30%   +0.03%     
===============================================================
  Files                              222      222              
  Lines                            18683    18696      +13     
===============================================================
+ Hits                             13316    13332      +16     
+ Misses                            4189     4187       -2     
+ Partials                          1178     1177       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant