-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Prevent unnecessary downloads of library packages - just update the json/lock files #2998
Closed
driskell
wants to merge
2
commits into
dependabot:main
from
driskell:mock-library-installer-prevent-unnecessary-downloads
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -311,37 +311,8 @@ | |
let(:project_name) { "env_variable" } | ||
|
||
context "that hasn't been provided" do | ||
it "raises a MissingEnvironmentVariable error" do | ||
expect { updated_lockfile_content }.to raise_error do |error| | ||
expect(error).to be_a(Dependabot::MissingEnvironmentVariable) | ||
expect(error.message).to eq("Missing environment variable ACF_PRO_KEY") | ||
end | ||
end | ||
end | ||
|
||
context "that has been provided" do | ||
let(:updater) do | ||
described_class.new( | ||
dependency_files: files, | ||
dependencies: [dependency], | ||
credentials: [{ | ||
"type" => "git_source", | ||
"host" => "github.com", | ||
"username" => "x-access-token", | ||
"password" => "token" | ||
}, { | ||
"type" => "php_environment_variable", | ||
"env-key" => "ACF_PRO_KEY", | ||
"env-value" => "example_key" | ||
}] | ||
) | ||
end | ||
|
||
it "runs just fine (we get a 404 here because our key is wrong)" do | ||
expect { updated_lockfile_content }.to raise_error do |error| | ||
expect(error).to be_a(Dependabot::DependencyFileNotResolvable) | ||
expect(error.message).to include("404") | ||
end | ||
it "does not attempt to download and has details of the updated item" do | ||
expect(updated_lockfile_content).to include("\"version\":\"5.9.2\"") | ||
end | ||
end | ||
end | ||
|
@@ -544,11 +515,8 @@ | |
}] | ||
end | ||
|
||
it "raises a helpful errors" do | ||
expect { updated_lockfile_content }.to raise_error do |error| | ||
expect(error).to be_a Dependabot::PrivateSourceAuthenticationFailure | ||
expect(error.source).to eq("nova.laravel.com") | ||
end | ||
it "does not attempt to download and has details of the updated item" do | ||
expect(updated_lockfile_content).to include("\"version\":\"v2.0.9\"") | ||
end | ||
end | ||
end | ||
|
@@ -577,11 +545,8 @@ | |
) | ||
end | ||
|
||
it "raises a helpful errors" do | ||
expect { updated_lockfile_content }.to raise_error do |error| | ||
expect(error).to be_a Dependabot::GitDependencyReferenceNotFound | ||
expect(error.dependency).to eq("monolog/monolog") | ||
end | ||
it "does not attempt to install it and has details of the updated item" do | ||
expect(updated_lockfile_content).to include("\"version\":\"v1.6.0\"") | ||
end | ||
end | ||
|
||
|
@@ -609,12 +574,8 @@ | |
) | ||
end | ||
|
||
it "raises a helpful errors" do | ||
expect { updated_lockfile_content }.to raise_error do |error| | ||
expect(error).to be_a Dependabot::GitDependencyReferenceNotFound | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these exceptions potentially need cleaning up? I left as is as it seems it will need a higher discussion as this looks like the scope now increases as there’s potentially areas of code handing nice errors that won’t need handling anymore because installs aren’t attempted |
||
expect(error.dependency). | ||
to eq("monolog/monolog") | ||
end | ||
it "does not attempt to install it and has details of the updated item" do | ||
expect(updated_lockfile_content).to include("\"version\":\"v1.6.0\"") | ||
end | ||
end | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 boolean argument to getLockedRepository is "withDevReqs" to return all packages including dev requirements.