-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Remove --mutex network
argument for Yarn builds
#625
Conversation
…nt anymore Signed-off-by: Thorsten Scherler <[email protected]>
pom.xml
Outdated
<id>yarn2-execution</id> | ||
<activation> | ||
<file> | ||
<exists>.mvn_exec_yarn2</exists> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the same applied for yarn3? (the --mutex flag is a yarn 1 thing right?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering rather than replicate the entire profile except the argument should the extra argument just be pulled out as a property and referenced?
Then if you want to use yarn2+ you set the argument to empty in your projects <properties>
.
@jtnord yeah what you recommend is much cleaner, how could I do that? |
in the existing profile remove the then in the top level infact looking at the frontend plugin code... you can remove the setting in both places and just set the property |
…ridden Signed-off-by: Thorsten Scherler <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit 7556d86 re-indents the whole file. Do not include unrelated formatting changes in this pull request.
Signed-off-by: Thorsten Scherler <[email protected]>
pom.xml
Outdated
<!-- ensure only one concurrent 'yarn install' --> | ||
<!-- when yarn cache is empty, multiple yarns performing network fetches frequently results in opaque errors --> | ||
<arguments>--mutex network</arguments> | ||
<arguments>${yarn.args}</arguments> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frontend-maven-plugin
already uses the value of the frontend.yarn.arguments
property, if defined, so for consistency I suggest using that same property name rather than yarn.args
. That would allow you to delete this <arguments>
line (and therefore its parent <configuration>
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok @basil , the only thing is that we do
<properties>
<yarn.version>1.22.19</yarn.version>
</properties>
So you are suggesting that would now become
<properties>
<yarn.version>1.22.19</yarn.version>
<frontend.yarn.arguments>1.22.19</frontend.yarn.arguments>
</properties>
I am fine with it, but personally would find it more readable, if we would drop the frontend
prefix since it just forces us to remember it. Better like:
<properties>
<yarn.version>1.22.19</yarn.version>
<yarn.arguments>1.22.19</yarn.arguments>
</properties>
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be clearer now my previously unpublished comments are published, the question remains is what (if anything) should the default be (keep the default as yarn1
or remove it and make users specify it if they use yarn1)
thanks for spotting Co-authored-by: Basil Crow <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to sumbit my review
pom.xml
Outdated
<!-- can be set to the empty string or install for yarn2 --> | ||
<!-- ensure only one concurrent 'yarn install' --> | ||
<!-- when yarn cache is empty, multiple yarns performing network fetches frequently results in opaque errors --> | ||
<yarn.args>---mutex network</yarn.args> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given we now require you to specify the yarn version (the previous release) I think we should just remove the property and the use of it on line 1333.
Then we document that users of yarn1 will need to add a property frontend.yarn.arguments
to ---mutex network
@basil removed the node/yarn properties so I think this may well be better suited.
if not and we want to keep the default the property needs to be changed to <frontend.yarn.arguments>---mutex network</frontend.yarn.arguments> <!-- extra arguments needed for yarn -->
to match the property of the plugin to make the understanding and override of it easier.
<yarn.args>---mutex network</yarn.args> | |
<frontend.yarn.arguments>---mutex network</frontend.yarn.arguments> <!-- extra arguments needed for yarn, --mutex network is needed for yarn1, yarn2+ do not need this flag --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarnpkg/yarn#2146 (comment) you can as well create a .yarnrc
and add --install.mutex network
in case you want it.
pom.xml
Outdated
<!-- ensure only one concurrent 'yarn install' --> | ||
<!-- when yarn cache is empty, multiple yarns performing network fetches frequently results in opaque errors --> | ||
<arguments>--mutex network</arguments> | ||
<arguments>${yarn.args}</arguments> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be clearer now my previously unpublished comments are published, the question remains is what (if anything) should the default be (keep the default as yarn1
or remove it and make users specify it if they use yarn1)
I personally think that the default behavior should be not adding anything. The mutex option is really a safeguard and I wonder which percent of cases really need these defaults. Further most likely only on the CI build, so you could create a |
I would normally be in agreement - however there would appear to be no users of yarn2+ as you are the first to hit the issue, so that would mean everyone using yarn would need to add it. That said that was the approach in setting the yarn versions.
That would mean that the standard pipeline would need to know you are going to be running yarn1 vs yarn2 or 3 in order to only set it for the legacy case (setting it for yarn2+ should IIUC cause yarn to fail as it does not understand that switch)? |
Not needed on ci.jenkins.io which only runs one build at a time on an executor, only needed if someones running internally with multiple executors |
+1 from me for removing any custom arguments and requiring consumers to specify any such arguments via the |
To summarize, I will prepare the PR removing the old defaults but allowing passing arguments. Thanks all! |
Co-authored-by: James Nord <[email protected]>
Signed-off-by: Thorsten Scherler <[email protected]>
Signed-off-by: Thorsten Scherler <[email protected]>
Signed-off-by: Thorsten Scherler <[email protected]>
pom.xml
Outdated
<!-- ensure only one concurrent 'yarn install' --> | ||
<!-- when yarn cache is empty, multiple yarns performing network fetches frequently results in opaque errors --> | ||
<arguments>--mutex network</arguments> | ||
<arguments>${frontend.yarn.arguments}</arguments> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the default - you can just remove the entire configuration section (lines 1331 - 1333)
As James mentioned a few hours ago, and as I previously wrote in #625 (comment), there is no need to declare an empty property and pass it through to |
Co-authored-by: James Nord <[email protected]>
Thank you for the clarification and sorry for being slow, but I think I understand now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole <configuration>
section can be deleted, since it no longer contains any customizations from the upstream default. Did you have a draft of what should be published in the release notes explaining how Yarn 1.x users should adapt to this change?
Signed-off-by: Thorsten Scherler <[email protected]>
Do we have a proposed entry for the release notes that describes the impact this change will have on plugins? |
@basil for the release note: Breaking change in yarn. In case you rely on the extra argument WDYT? |
Sounds fine. How has this change been tested? I would expect this change to be tested under two use cases:
|
How can I provide these test cases? |
I would run |
|
I first used |
--mutex networ
argument for Yarn builds
--mutex networ
argument for Yarn builds--mutex network
argument for Yarn builds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I will try to do a release of this tomorrow once the this week's weekly release is out.
@basil thanks for your big help |
add profile for yarn 2 which do not support the mutex argunment anymore
Signed-off-by: Thorsten Scherler [email protected]