From 44c3b4f7ec8e3e5fe50b13c89383d5e7f6eada62 Mon Sep 17 00:00:00 2001 From: Sam Reid Date: Wed, 2 Oct 2024 14:29:06 -0600 Subject: [PATCH] Return success for applyPatches, see https://github.com/phetsims/perennial/issues/365 --- ...nsity-buoyancy-1.2-release-candidate-notes.js | 16 ++++++++++++---- js/common/Maintenance.js | 5 +++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/temp/density-buoyancy-1.2-release-candidate-notes.js b/doc/temp/density-buoyancy-1.2-release-candidate-notes.js index 8476433f..dbdc9284 100644 --- a/doc/temp/density-buoyancy-1.2-release-candidate-notes.js +++ b/doc/temp/density-buoyancy-1.2-release-candidate-notes.js @@ -9,14 +9,18 @@ const Maintenance = require( '../../js/common/Maintenance.js' ); const m = Maintenance; - const setUpPatch = async ( patchName, sha, repo = 'density-buoyancy-common' ) => { + const cherryPickSHA = async ( repo, sha ) => { + const patchName = repo + sha; await m.createPatch( repo, 'for rc.2', patchName ); await m.addPatchSHA( patchName, sha ); await m.addNeededPatch( 'density', '1.2', patchName ); await m.addNeededPatch( 'buoyancy', '1.2', patchName ); await m.addNeededPatch( 'buoyancy-basics', '1.2', patchName ); - await m.applyPatches(); + const success = await m.applyPatches(); // could also throw + if ( success ) { + await m.updateDependencies(); + } } ////////////////////////////////////////////////////////////// @@ -79,8 +83,12 @@ //////////////////////////////////////////////////////// // B:B explore share usageTracker https://github.com/phetsims/density-buoyancy-common/issues/397 // https://github.com/phetsims/density-buoyancy-common/commit/45dc5d2946385141b6406654f3143ab0f8e2a3df - await setUpPatch( 'exploreGrabDragUsageTracker', '45dc5d2946385141b6406654f3143ab0f8e2a3df' ); - await m.updateDependencies(); + // await setUpPatch( 'exploreGrabDragUsageTracker', '45dc5d2946385141b6406654f3143ab0f8e2a3df' ); + // await m.updateDependencies(); + //////////////////////////////////////////////////////// + // https://github.com/phetsims/density-buoyancy-common/issues/405 + // Avoid cascading density property changes from "hidden" fluids to the custom fluid density + // await cherryPickSHA( 'density-buoyancy-common', 'c22a525940eb520b74ef717f986c16ae83ab1183' ); } )(); \ No newline at end of file diff --git a/js/common/Maintenance.js b/js/common/Maintenance.js index 148a7aa5..53b0ec12 100644 --- a/js/common/Maintenance.js +++ b/js/common/Maintenance.js @@ -727,6 +727,8 @@ module.exports = ( function() { * @public */ static async applyPatches() { + + let success = true; const maintenance = Maintenance.load(); let numApplied = 0; @@ -791,6 +793,7 @@ module.exports = ( function() { break; } else { + success = false; console.log( `Could not cherry-pick ${sha}` ); } } @@ -808,6 +811,8 @@ module.exports = ( function() { maintenance.save(); console.log( `${numApplied} patches applied` ); + + return success; } /**