Skip to content

Conversation

@sejas
Copy link
Member

@sejas sejas commented Nov 5, 2025

Related issues

Proposed Changes

  • Simplifies the push and export logic to produce same wp-content data. sqlite-database-integration is excluded and all the wp-content data is included.
  • Improve tests respecting the fake files and directories

Testing Instructions

Test selective push

  • Apply this diff
diff --git a/src/ipc-handlers.ts b/src/ipc-handlers.ts
index c44c6256..037cb80f 100644
--- a/src/ipc-handlers.ts
+++ b/src/ipc-handlers.ts
@@ -794,6 +794,9 @@ export async function exportSiteForPush(
 		const stats = fs.statSync( archivePath );
 		return { archivePath, archiveSizeInBytes: stats.size };
 	} finally {
+		const tempralDestination = `${ TEMP_DIR }manual-test.${ extension }`;
+		fs.copyFileSync( archivePath, tempralDestination );
+		shell.showItemInFolder( tempralDestination );
 		SYNC_ABORT_CONTROLLERS.delete( operationId );
 	}
 }
@@ -826,6 +829,8 @@ export async function pushArchive(
 		formData.push( [ 'options', optionsToSync.join( ',' ) ] );
 	}
 
+	return { success: true };
+
 	try {
 		await wpcom.req.post( {
 			path: `/sites/${ remoteSiteId }/studio-app/sync/import`,
  • Run npm start
  • Go to the Sync tab
  • Connect a site and click on push
  • Select only database
  • Observe that the zip file created contains only the SQL files and other meta files
  • Click again on push
  • Select all options (database and files)
  • Observe the zip created contains also extra-folders and files inside wp-content
  • Click again on push
  • Select only mu-plugins
  • Observe that the sqlite-database-integration is not included in the zip file.
test-push.mp4

Test export database and full export

  • Run npm start
  • Go to the Sync tab
  • Export the database
  • Observe the database is correctly exported
  • Export the full site
  • Observe that the zip file created contains only the SQL files and other meta files
test-exports.mp4

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@sejas sejas mentioned this pull request Nov 5, 2025
1 task
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

📊 Performance Test Results

Comparing 8a701ae vs trunk

site-editor

Metric trunk 8a701ae Diff Change
load 11252.00 ms 10492.00 ms -760.00 ms 🟢 -6.8%

site-startup

Metric trunk 8a701ae Diff Change
siteCreation 21151.00 ms 20228.00 ms -923.00 ms 🟢 -4.4%
siteStartup 5992.00 ms 6970.00 ms +978.00 ms 🔴 16.3%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

@sejas sejas marked this pull request as ready for review November 5, 2025 11:02
@sejas sejas self-assigned this Nov 5, 2025
@sejas sejas requested review from a team and katinthehatsite November 5, 2025 11:02
@sejas sejas mentioned this pull request Nov 5, 2025
1 task
const stat = fs.statSync( fullPath );
const stat = await fsPromises.stat( fullPath );
if ( stat.isDirectory() ) {
this.archiveBuilder.directory( fullPath, archivePath );
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice simplification 👍

Copy link
Contributor

@katinthehatsite katinthehatsite left a comment

Choose a reason for hiding this comment

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

This looks good, different test cases worked well 👍

@sejas sejas merged commit aa26e3f into trunk Nov 5, 2025
12 checks passed
@sejas sejas deleted the update/push-folder-structure-unique-exporter branch November 5, 2025 18:36
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