-
Notifications
You must be signed in to change notification settings - Fork 494
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
Infinite loop makes changeset version
command hang
#571
Comments
changeset version
command hang
Even if there is a constant condition there this loop should not be infinite. There are multiple breaks in it and one of them should get hit by design. This is clearly a bug (it shouldn't hang) but I wouldn't blame this on this while statement per se. Do you have some link to a repro case? Some GH action run perhaps? |
I don't have a repro currently because it hangs on a private repository in our Jenkins. But I know for sure that this is the part that hangs infinitely. When I changed that line to |
Would you be able to patch the content of this function with some extra console.logs and rerun the failing job to investigate this? |
deepenCloneBy() does not check if the git command was successful. It fails over and over and the loop continues indefinitly. |
Ok, thanks - that is good to know! I will try to make sure to wrap all those git calls with some error handling unless somebody beats me to it. |
spawn will never throw an exception, it just returns a response with |
Yeah - I know. I've just referred to this kind of check as error handling. After all, if this would actually throw then there wouldn't be a problem as the |
We run snapshot releases on pull requests and seems like there is no Git in the container that runs the release. Even if there is, I don't think fetching the history is a good idea as our repository is very big and it would cause a major slowdown. I think at least for snapshot releases it should not fail. |
No, it is not public. It is a project that uses git shallow cloning. It appears that the Git CLI was present. I can't investigate it further because I already spent a lot of time on it and the fork that I created solves the issue. The lack of debug information made it impossible to investigate (I tried the |
I also get a infinite loop with all packages fixed in pre mode. yarn changeset pre enter alpha Running with debugger node --inspect-brk node_modules/@changesets/cli/bin.js version chrome://inspect Seems to loop forever in assemble-release-plan |
@fivethreeo could you share a repro case? It's hard to debug this & fix it for me without one |
Thank you for the link - could you list your exact repro steps though? You have mentioned running
|
I already ran that, just run yarn install and the version command. |
releasesValidated seems to never become true in the while loop |
dependentAdded and fixedConstraintUpdated are always true. I forced them to be false in debugger and version completes successfully. |
so I think releases get mutated by both determineDependents and matchFixedConstraint for every while loop |
If I remove fixed from config it works |
Thanks for looking into this - I should have a fix for this soon-ish |
Any updates on when the fix for handling the git errors will be merged? I'm running into this issue as well when the For my particular use case, I was running into the error |
Affected Packages
@changesets/git
Problem
a loop that never ends
https://github.com/atlassian/changesets/blob/18d3da3b707fe834e0bb1cddce1186bb24b75ef2/packages/git/src/index.ts#L112
Proposed solution
The text was updated successfully, but these errors were encountered: