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

main-pull-status.js might be running git operations on repos in parallel #321

Open
jessegreenberg opened this issue May 18, 2023 · 4 comments
Assignees

Comments

@jessegreenberg
Copy link
Contributor

jessegreenberg commented May 18, 2023

While doing an automated release process phetsims/tasks#1123, I tried to use master-pull--status.js --allBranches to pull all release branches from remote. I ran into an error where I had uncommitted changes in brand graphing-quadratics-1.0 and scenery molecules-and-light-1.5.

I wonder if this Promise.all() is the problem: await Promise.all( repos.map( repo => getStatus( repo ) ) );

I am going to try to run it again with so it waits for each repo individually.

  for ( const repo of repos ) {
    await getStatus( repo );
  }
@jessegreenberg
Copy link
Contributor Author

Yes that worked. Here is the patch:

Subject: [PATCH] Remove opt out of Interactive Highlights, see https://github.com/phetsims/friction/issues/201
---
Index: js/scripts/master-pull-status.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/scripts/master-pull-status.js b/js/scripts/master-pull-status.js
--- a/js/scripts/master-pull-status.js	(revision 8f5beec14684b1d85e7f4ac05bd5d1c29bdc380e)
+++ b/js/scripts/master-pull-status.js	(date 1684433025053)
@@ -104,7 +104,9 @@
 };
 
 ( async () => {
-  await Promise.all( repos.map( repo => getStatus( repo ) ) );
+  for ( const repo of repos ) {
+    await getStatus( repo );
+  }
 
   repos.forEach( repo => {
     process.stdout.write( data[ repo ] );

@jonathanolson is this OK? It might be a little slower but it avoided the problem. I didn't commit because I am not sure where all this script is used.

@jonathanolson
Copy link
Contributor

That's weird, can you try running the original again? Is this reproducible? I call this script multiple times a day (without the --allBranches, maybe that's triggering a problem)

@jonathanolson
Copy link
Contributor

Also, it's meant to be parallel, so that it minimizes the time needed in order for people to pull repos.

@jessegreenberg jessegreenberg self-assigned this May 18, 2023
@jessegreenberg
Copy link
Contributor Author

jessegreenberg commented May 19, 2023

Yes, this is reproducible on Windows 10. I just ran it on two difference machines and both finished with unstaged changes in various repos.

I tried without --allBranches and did not see the problem.

@jessegreenberg jessegreenberg removed their assignment May 19, 2023
@zepumph zepumph changed the title master-pull-status.js might be running git operations on repos in parallel main-pull-status.js might be running git operations on repos in parallel Nov 16, 2023
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

2 participants