Skip to content

Conversation

@luismulinari
Copy link
Contributor

@luismulinari luismulinari commented Nov 14, 2025

Description

Adds a new --skip-download flag to the vip export sql command that allows users to retrieve the download URL for database backups without actually downloading the file. This is particularly useful for automation scenarios where the download needs to be handled separately or when users just need the URL for later use.

This PR also refactors the ProgressTracker to support additional info messages for each step. This prevents direct console.log calls from interfering with the progress tracker's single-line printing mode, ensuring consistent and clean output formatting throughout command execution.

Output example:

$ vip @0000.production export sql
✓ Preparing for backup download 
  • Attaching to an existing export for the backup with timestamp 2025-11-14T13:21:07.000Z
✓ Creating backup copy 
✓ Requesting download link 
  • Download URL: https://example.org/sql.gz

Changes

  • Added --skip-download CLI option to the export sql command
  • When enabled, the command skips storage confirmation and download steps
  • Outputs the download URL to console instead of downloading the file
  • Enhanced ProgressTracker to support additional info messages for steps
  • Refactored console output in prepare step to use ProgressTracker's additional info feature
  • Added comprehensive test coverage for the new functionality

Testing

To test this feature locally:

  1. Run the command with the new flag:
npm run build && ./dist/bin/vip-export-sql.js @<id>.production --skip-download

Changelog Description

Added

  • Added --skip-download flag to export sql command for URL-only retrieval

Pull request checklist

New release checklist

Steps to Test

Outline the steps to test and verify the PR here.

Example:

  1. Check out PR.
  2. Run npm run build
  3. Run ./dist/bin/vip-cookies.js nom
  4. Verify cookies are delicious.

Add --skip-download flag to allow users to retrieve the download URL for database backups without downloading the file. This is useful for automation scenarios where users want to handle the download separately.

Changes:
- Add skipDownload option to ExportSQLCommand
- Skip storage confirmation and download steps when flag is set
- Output download URL to console instead of downloading
- Update progress tracker to support additional info for steps
- Add test coverage for skip-download functionality
- Add example usage in command help
@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@luismulinari luismulinari requested a review from a team November 14, 2025 13:42
Comment on lines -481 to -493
if ( ! this.generateBackup ) {
console.log(
`${ getGlyphForStatus( 'success' ) } Latest backup found with timestamp ${
latestBackup.createdAt
}`
);
} else {
console.log(
`${ getGlyphForStatus( 'success' ) } Backup created with timestamp ${
latestBackup.createdAt
}`
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this since this information is already presented in the following step:

		if ( await this.getExportJob() ) {
			prepareAdditionalInfo.push(
				`Attaching to an existing export for the backup with timestamp ${ latestBackup.createdAt }`
			);
		} else {
			prepareAdditionalInfo.push(
				`Exporting database backup with timestamp ${ latestBackup.createdAt }`
			);

Copy link
Contributor

@robersongomes robersongomes left a comment

Choose a reason for hiding this comment

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

🚢

@sjinks
Copy link
Member

sjinks commented Nov 14, 2025

I guess this also fixes PLTFRM-1822

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a --skip-download flag to the vip export sql command, allowing users to retrieve database backup download URLs without downloading the file. This is useful for automation scenarios where downloads need to be handled separately. The PR also refactors the ProgressTracker to support additional info messages for each step, replacing direct console.log calls to maintain clean, consistent output formatting.

  • Added --skip-download CLI option that outputs the download URL instead of downloading the file
  • Enhanced ProgressTracker to support additional info messages displayed as bullet points under each step
  • Refactored console output in the prepare step to use ProgressTracker's additional info feature

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/lib/cli/progress.ts Enhanced Step interface and ProgressTracker methods to support additionalInfo parameter for displaying extra information as bullet points
src/commands/export-sql.ts Added skipDownload option that skips storage confirmation and download steps, outputting the URL instead; refactored console.log calls to use additionalInfo
src/bin/vip-export-sql.js Added --skip-download CLI option definition and passed skipDownload parameter to ExportSQLCommand
tests/commands/export-sql.ts Added test coverage for skipDownload functionality verifying steps are skipped and URL is output correctly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rebeccahum rebeccahum changed the title feat: add --skip-download option to export sql command [PLTFRM-1814] feat: add --skip-download option to export sql command Nov 14, 2025
@sjinks sjinks added the [Status] Needs Docs The feature or update requires an update to our public VIP Documentation label Nov 14, 2025
Simplify the description to focus on what the option does rather than
redundantly explaining that the URL is always printed.
@sjinks
Copy link
Member

sjinks commented Nov 18, 2025

@luismulinari is it OK to merge this one, or are you still working on it?

@rebeccahum rebeccahum changed the title [PLTFRM-1814] feat: add --skip-download option to export sql command [PLTFRM-1814] [PLTFRM-1822] feat: add --skip-download option to export sql command Nov 18, 2025
@rinatkhaziev
Copy link
Contributor

@copilot generate the public-facing documentation for this change.

Copy link
Contributor

Copilot AI commented Nov 25, 2025

@rinatkhaziev I've opened a new pull request, #2638, to work on those changes. Once the pull request is ready, I'll request review from you.

@sonarqubecloud
Copy link

@rinatkhaziev rinatkhaziev merged commit c73e82f into trunk Nov 26, 2025
26 of 27 checks passed
@rinatkhaziev rinatkhaziev deleted the export-sql/skip-download branch November 26, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Docs The feature or update requires an update to our public VIP Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants