Skip to content

Conversation

@naman-contentstack
Copy link
Contributor

🐛 Fix: CLI Import Incorrectly Backs Up Entire Branches Directory

Problem

CLI import command was copying entire branches directory instead of specific branch data, causing backup structure issues and module failures.

Solution

Added intelligent path resolution that auto-detects export structure:

  • V2/V1 exports: Uses path as-is
  • Branch exports: Auto-resolves single branch or prompts user for multiple
  • User flags: Respects --module and --branch

Changes

  • ✨ Added path resolution logic in common-helper.ts
  • 🔄 Updated setup-branch.ts and backup-handler.ts
  • 🎯 Backup now uses correct source directory

Result

  • ✅ Correct backup structure
  • ✅ Auto-detection of export types
  • ✅ Interactive branch selection
  • ✅ No breaking changes

Files: common-helper.ts, setup-branch.ts, backup-handler.ts, interactive.ts

@naman-contentstack naman-contentstack self-assigned this Sep 1, 2025
@naman-contentstack naman-contentstack requested a review from a team as a code owner September 1, 2025 13:27
shafeeqd959
shafeeqd959 previously approved these changes Sep 3, 2025
cs-raj
cs-raj previously approved these changes Sep 4, 2025
@gitguardian
Copy link

gitguardian bot commented Sep 5, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
20655528 Triggered Generic Password da436c0 pnpm-lock.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@naman-contentstack naman-contentstack merged commit 3233750 into development Sep 5, 2025
11 checks passed
@naman-contentstack naman-contentstack deleted the fix/DX-3246 branch September 5, 2025 06:48
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.

4 participants