Skip to content

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented Nov 3, 2025

Description

Change the install args based on yarn 1.x or 2+

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

Change the install args based on yarn 1.x or 2+
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12633

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12633"

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the default Yarn install arguments in publish mode by adding version detection logic. The code now differentiates between Yarn 1.x (Classic) and Yarn 2+ (Berry) and uses the appropriate flag for each version.

Key changes:

  • Modified GetDefaultYarnInstallArgs to detect Yarn version based on presence of .yarnrc.yml or .yarn/releases directory
  • Changed default behavior to use --frozen-lockfile for Yarn 1.x and --immutable for Yarn 2+
  • Added test coverage for the new Yarn version detection logic

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Aspire.Hosting.NodeJs/NodeExtensions.cs Implemented Yarn version detection logic in GetDefaultYarnInstallArgs to return appropriate install flags based on detected version
tests/Aspire.Hosting.NodeJs.Tests/PackageInstallationTests.cs Updated existing test to expect --frozen-lockfile for Yarn 1.x and added two new tests verifying --immutable flag when Yarn 2+ indicators are present

Copy link
Member

@adamint adamint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, other than adding a comment for additional context

@eerhardt eerhardt enabled auto-merge (squash) November 3, 2025 20:47
@eerhardt
Copy link
Member Author

eerhardt commented Nov 3, 2025

/backport to release/13

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Started backporting to release/13: https://github.com/dotnet/aspire/actions/runs/19048867211

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

@eerhardt an error occurred while backporting to "release/13", please check the run log for details!

Error: The specified backport target branch "release/13" wasn't found in the repo.

@eerhardt
Copy link
Member Author

eerhardt commented Nov 3, 2025

/backport to release/13.0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2025

Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/19048879965

@eerhardt eerhardt merged commit 8c3199c into dotnet:main Nov 3, 2025
296 checks passed
@eerhardt eerhardt deleted the DetectYarnVersion branch November 3, 2025 21:07
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 3, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants