Skip to content

fix: improve app name derivation to support numbers and acronyms#921

Open
nakrenat wants to merge 1 commit intofal-ai:mainfrom
nakrenat:fix/improve-app-name-derivation
Open

fix: improve app name derivation to support numbers and acronyms#921
nakrenat wants to merge 1 commit intofal-ai:mainfrom
nakrenat:fix/improve-app-name-derivation

Conversation

@nakrenat
Copy link
Copy Markdown

🚀 Summary

The current PART_FINDER_RE regex in app.py has a limitation: it fails to capture numbers and handles acronyms inconsistently. This PR updates the regex to correctly derive kebab-case app names from PascalCase/CamelCase strings that contain digits or consecutive uppercase letters.

🛠 Changes

  • Updated PART_FINDER_RE to: r"[A-Z][a-z]+|[A-Z]+(?=[A-Z][a-z]|$)|[a-z]+|\d+"
  • This ensures that digits (like '2' in Sora2Video) and acronyms (like 'ONNX') are properly parsed as distinct parts.

✅ Test Cases (Verified locally)

I've verified the fix with the following cases:

  • Sora2Video -> sora-2-video (Previously: sora-video)
  • ONNXModel -> onnx-model (Previously: o-n-n-x-model)
  • My3DApp -> my-3-d-app (Previously: my-app)

This improvement ensures a better Developer Experience (DX) when naming fal.ai apps.

@nakrenat
Copy link
Copy Markdown
Author

It seems like the Claude Code Review action is failing due to missing id-token: write permissions. This shouldn't affect the core changes in my PR.

@nakrenat
Copy link
Copy Markdown
Author

Hi! It seems like the integration tests are failing with 401 Unauthorized because repository secrets are not shared with this PR from my fork. I've verified the regex fix locally with several test cases (Sora2Video, ONNXModel, My3DApp) and they all produce the correct output now. Could a maintainer trigger the tests or review the logic?

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.

1 participant