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

Ensure Corepack Usage for npm, pnpm, and yarn Command Execution #10944

Merged
Prev Previous commit
Next Next commit
add condition for feature flag is on
  • Loading branch information
kbukum1 committed Nov 18, 2024
commit ee0faad160bff44bdf63146febae84c5e138ed95
24 changes: 17 additions & 7 deletions npm_and_yarn/lib/dependabot/npm_and_yarn/package_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,19 +252,29 @@ def setup(name)
)
end

version ||= requested_version(name)

if version
raise_if_unsupported!(name, version)
version = nil
if Dependabot::Experiments.enabled?(:enable_corepack_for_npm_and_yarn)
version ||= requested_version(name) || guessed_version(name)

install(name, version)
if version
raise_if_unsupported!(name, version.to_s)
install(name, version)
end
else
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This else is going to be removed in clean-up process of enable_corepack_for_npm_and_yarn feature flag after all checks.

version = guessed_version(name)
version ||= requested_version(name)

if version
raise_if_unsupported!(name, version.to_s)
raise_if_unsupported!(name, version)

install(name, version)
else
version = guessed_version(name)

if version
raise_if_unsupported!(name, version.to_s)

install(name, version) if name == PNPMPackageManager::NAME
end
end
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to install npm, and yarn versions as well. We removed the condition that only install for pnpm when version is guessed.

version
Expand Down
Loading