Skip to content

fix(init): allow long directory names - #6216

Open
gcomneno wants to merge 1 commit into
canonical:mainfrom
gcomneno:contrib/issue-6093-init-long-directory-name
Open

fix(init): allow long directory names#6216
gcomneno wants to merge 1 commit into
canonical:mainfrom
gcomneno:contrib/issue-6093-init-long-directory-name

Conversation

@gcomneno

Copy link
Copy Markdown
Contributor

Summary

  • validate snap names during init name resolution so directory-derived names can fall back to the default
  • keep explicit invalid names failing with Snapcraft's snap name validation
  • add coverage for long working directory names

Issue
Closes #6093

Validation

  • pytest -q tests/unit/services/test_init.py tests/unit/commands/test_init.py -rs
  • ruff check snapcraft/services/init.py tests/unit/services/test_init.py tests/unit/commands/test_init.py
  • ruff format snapcraft/services/init.py tests/unit/services/test_init.py tests/unit/commands/test_init.py
  • git diff --check

@gcomneno
gcomneno requested review from bepri and mr-cal as code owners April 27, 2026 14:51
@gcomneno

Copy link
Copy Markdown
Contributor Author

All functional checks are passing from my side. The remaining failures appear unrelated to this change:

  • OSV-scanner is failing in the policy/security workflow.
  • CI/publish (self-hosted, amd64) exits during the self-hosted runner pre-job authorization check with: "Author association: CONTRIBUTOR, is allowed: false".

Validation run locally:

  • pytest -q tests/unit/services/test_init.py tests/unit/commands/test_init.py -rs
  • ruff check snapcraft/services/init.py tests/unit/services/test_init.py tests/unit/commands/test_init.py
  • ruff format snapcraft/services/init.py tests/unit/services/test_init.py tests/unit/commands/test_init.py
  • git diff --check

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.

snapcraft init fails when the working directory's name is longer than 40 characters

1 participant