Skip to content

Conversation

@riderx
Copy link
Member

@riderx riderx commented Nov 28, 2025

Upstream PR Sync

This PR syncs changes from an external contributor's PR on the official Capacitor repository.

Original PR

  • PR: #7598
  • Title: fix(cli): Android apk name multi flavor dimensions parsing
  • Author: @luisbytes

Automation

  • CI will run automatically
  • Claude Code will review for security/breaking changes
  • If approved, this PR will be auto-merged

Synced from upstream by Capacitor+ Bot

Summary by CodeRabbit

  • Changes
    • Modified APK naming convention for flavors with mixed-case characters. APK filenames now include hyphens between word segments (e.g., app-camel-case-debug.apk).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 28, 2025

Walkthrough

Modified the parseApkNameFromFlavor function in the CLI utilities to insert hyphens before uppercase letters and lowercase them, then normalize by removing any leading hyphen. This changes how flavor names are converted to APK filename components.

Changes

Cohort / File(s) Summary
APK naming logic
cli/src/common.ts
Modified parseApkNameFromFlavor to insert hyphens before uppercase letters, lowercase the result, and remove leading hyphens. Affects APK name generation from flavor strings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the new hyphenation logic produces expected output for various flavor name patterns (camelCase, PascalCase, with/without numbers)
  • Confirm the leading hyphen normalization doesn't introduce edge cases
  • Check for any existing tests that may need updating to match the new naming convention

Poem

🐰 A hyphen here, a lowercase there,
Flavor names transform with care,
From camelCase to kebab-delight,
APK names now spelled just right! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: syncing an upstream PR that fixes Android APK name parsing for multi-flavor dimensions.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync/upstream-pr-7598

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@riderx riderx force-pushed the sync/upstream-pr-7598 branch from 2f4cada to 9bd9c50 Compare November 28, 2025 15:04
@riderx riderx force-pushed the sync/upstream-pr-7598 branch from 9bd9c50 to de435c4 Compare November 29, 2025 06:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
cli/src/common.ts (1)

540-543: Perfect! I now have all the information needed to verify and rewrite the review comment. Let me summarize my findings:

Key Verification Results:

  1. ✅ Function exists at lines 539-545 with the exact code described
  2. ✅ Logic is correct for converting camelCase to kebab-case APK naming
  3. ✅ Function is actively used in cli/src/android/run.ts and cli/src/config.ts
  4. ✅ Commit confirms upstream sync from PR ionic-team#7598
  5. This is a NEW function being added, not replacing existing code - so the fork compatibility concern is moot
  6. ⚠️ No tests found for this function in the fork (reasonable for new upstream code)
  7. ✅ No hardcoded APK patterns that would break

Issue with original review: The review asks to "verify that no fork-specific code depends on the old APK name format," but this is a new function being added to the codebase. There is no "old format" to break compatibility with in this fork.


Logic correctly converts camelCase flavor names to kebab-case APK naming per Android Gradle conventions.

The implementation is sound. This is a new function from upstream PR ionic-team#7598, not replacing existing code, so there's no fork-specific compatibility concern.

Minor nitpick: Line 542 could be more idiomatic:

-  if (convertedName.startsWith('-')) convertedName = convertedName.replace('-', '');
+  if (convertedName.startsWith('-')) convertedName = convertedName.substring(1);

Verify that upstream PR ionic-team#7598 includes tests for this new function (not found in this fork's codebase).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7f7689 and de435c4.

📒 Files selected for processing (1)
  • cli/src/common.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test-ios (/Applications/Xcode_26.0.app)
  • GitHub Check: test-android
  • GitHub Check: test-cli
  • GitHub Check: test-core

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.

3 participants