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

always clone all the ecosystems #8933

Merged
merged 5 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions bin/dry-run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,10 +474,7 @@ def log_conflicting_dependencies(conflicting_dependencies)
commit: $options[:commit]
)

always_clone = Dependabot::Utils
.always_clone_for_package_manager?($package_manager)
abdulapopoola marked this conversation as resolved.
Show resolved Hide resolved
vendor_dependencies = $options[:vendor_dependencies]
$repo_contents_path = File.expand_path(File.join("tmp", $repo_name.split("/"))) if vendor_dependencies || always_clone
$repo_contents_path = File.expand_path(File.join("tmp", $repo_name.split("/")))

fetcher_args = {
source: $source,
Expand Down
12 changes: 0 additions & 12 deletions common/lib/dependabot/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,6 @@ def self.register_requirement_class(package_manager, requirement_class)

@cloning_package_managers = T.let(Set[], T::Set[String])

sig { params(package_manager: String).returns(T::Boolean) }
def self.always_clone_for_package_manager?(package_manager)
@cloning_package_managers.include?(package_manager)
end

sig { params(package_manager: String).void }
def self.register_always_clone(package_manager)
validate_package_manager!(package_manager)

@cloning_package_managers << package_manager
end

sig { params(package_manager: String).void }
def self.validate_package_manager!(package_manager)
# Official package manager
Expand Down
3 changes: 0 additions & 3 deletions devcontainers/lib/dependabot/devcontainers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@
require "dependabot/dependency"
Dependabot::Dependency
.register_production_check("devcontainers", ->(_) { true })

require "dependabot/utils"
Dependabot::Utils.register_always_clone("devcontainers")
3 changes: 0 additions & 3 deletions go_modules/lib/dependabot/go_modules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@
require "dependabot/dependency"
Dependabot::Dependency
.register_production_check("go_modules", ->(_) { true })

require "dependabot/utils"
Dependabot::Utils.register_always_clone("go_modules")
3 changes: 0 additions & 3 deletions npm_and_yarn/lib/dependabot/npm_and_yarn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,3 @@
groups.include?("dependencies")
end
)

require "dependabot/utils"
Dependabot::Utils.register_always_clone("npm_and_yarn")
2 changes: 0 additions & 2 deletions nuget/lib/dependabot/nuget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@
groups.include?("dependencies")
end
)

Dependabot::Utils.register_always_clone("nuget")
3 changes: 0 additions & 3 deletions pub/lib/dependabot/pub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@

require "dependabot/dependency"
Dependabot::Dependency.register_production_check("pub", ->(_) { true })

require "dependabot/utils"
Dependabot::Utils.register_always_clone("pub")
3 changes: 0 additions & 3 deletions python/lib/dependabot/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@
"pip",
->(name) { Dependabot::Python::NameNormaliser.normalise(name) }
)

require "dependabot/utils"
Dependabot::Utils.register_always_clone("pip")
3 changes: 0 additions & 3 deletions silent/lib/dependabot/silent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@
require "dependabot/dependency"
Dependabot::Dependency
.register_production_check("silent", ->(groups) { groups.empty? || groups.include?("prod") })

require "dependabot/utils"
Dependabot::Utils.register_always_clone("silent")
3 changes: 0 additions & 3 deletions swift/lib/dependabot/swift.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@
require "dependabot/dependency"
Dependabot::Dependency
.register_production_check("swift", ->(_) { true })

require "dependabot/utils"
Dependabot::Utils.register_always_clone("swift")
3 changes: 0 additions & 3 deletions terraform/lib/dependabot/terraform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
Dependabot::Dependency
.register_production_check("terraform", ->(_) { true })

require "dependabot/utils"
Dependabot::Utils.register_always_clone("terraform")

Dependabot::Dependency
.register_display_name_builder(
"terraform",
Expand Down
3 changes: 1 addition & 2 deletions updater/lib/dependabot/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ def initialize(attributes)
end

def clone?
vendor_dependencies? ||
Dependabot::Utils.always_clone_for_package_manager?(@package_manager)
true
end

# Some Core components test for a non-nil repo_contents_path as an implicit
Expand Down
3 changes: 0 additions & 3 deletions updater/spec/support/dummy_package_manager/dummy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@
groups.any? { |g| g.include?("prod") }
end
)

require "dependabot/utils"
Dependabot::Utils.register_always_clone("dummy")
Loading