Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MR Process: Create a simple grunt task for patching one maintenance branch #365

Open
zepumph opened this issue Oct 2, 2024 · 3 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Oct 2, 2024

From a conversation with @samreid.

Like cd density; grunt maintenance-cherry-pick --dependency=density-buoyancy-common--sha=SHA --branch=1.2

This is basically an alias for:

    await m.createPatch( DEPENDENCY, 'for rc.2', patchName );
    await m.addPatchSHA( patchName, sha );
    await m.addNeededPatch( 'REPO', '1.2', patchName );
    await m.applyPatches();
    await m.updateDependencies();
@zepumph
Copy link
Member Author

zepumph commented Oct 2, 2024

One important part of this change would be modulifying the .maintenance.json so that we didn't blow away a central one on each grunt command. Likely what would be best here is to just use a maintenance state that is never written, and just lives in memory.

@zepumph
Copy link
Member Author

zepumph commented Oct 2, 2024

Some grunt options?

--shaURL
--repo (buoyancy)


Maybe also support these separately??
--sha
--depRepo (density-buoyancy-common)

@zepumph
Copy link
Member Author

zepumph commented Oct 9, 2024

Our "success" return for applyPatches is buggy if there is more than one patch sha or more than one release branch for the patch. We need better "anding" logic.

Subject: [PATCH] better success metric
---
Index: js/common/Maintenance.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/Maintenance.js b/js/common/Maintenance.js
--- a/js/common/Maintenance.js	(revision ebf676468449dc2bf4a482e1e70bf8c74d7545c1)
+++ b/js/common/Maintenance.js	(date 1728492812414)
@@ -731,7 +731,7 @@
       winston.info( 'applying patches' );
       const maintenance = Maintenance.load();
 
-      let success = true;
+      let fullSuccess = true;
       let numApplied = 0;
 
       for ( const modifiedBranch of maintenance.modifiedBranches ) {
@@ -739,6 +739,8 @@
           continue;
         }
 
+        let successForReleaseBranch = true;
+
         const repo = modifiedBranch.repo;
         const branch = modifiedBranch.branch;
 
@@ -794,13 +796,16 @@
                   modifiedBranch.pendingMessages.push( patch.message );
                 }
 
+                successForReleaseBranch = true;
                 break;
               }
               else {
-                success = false;
+                successForReleaseBranch = false;
                 console.log( `Could not cherry-pick ${sha}` );
               }
             }
+
+            fullSuccess = fullSuccess && successForReleaseBranch;
           }
           catch( e ) {
             maintenance.save();

@zepumph zepumph self-assigned this Oct 9, 2024
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

No branches or pull requests

1 participant