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

remove redundant parsing of original files #9424

Merged
Merged
Changes from all 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
9 changes: 1 addition & 8 deletions updater/lib/dependabot/updater/group_update_creation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,13 @@ module GroupUpdateCreation
# can be used for PR creation.
# rubocop:disable Metrics/AbcSize
# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/PerceivedComplexity
def compile_all_dependency_changes_for(group)
prepare_workspace

group_changes = Dependabot::Updater::DependencyGroupChangeBatch.new(
initial_dependency_files: dependency_snapshot.dependency_files
)
# TODO: add directory to the dependencies to avoid reparsing?
job_directory = Pathname.new(job.source.directory).cleanpath
original_dependency_files = dependency_snapshot.dependency_files.select do |f|
Pathname.new(f.directory).cleanpath == job_directory
end
original_dependencies = dependency_file_parser(original_dependency_files).parse
original_dependencies = dependency_snapshot.dependencies

group.dependencies.each do |dependency|
if dependency_snapshot.handled_dependencies.include?(dependency.name)
Expand Down Expand Up @@ -93,7 +87,6 @@ def compile_all_dependency_changes_for(group)
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/MethodLength
# rubocop:enable Metrics/PerceivedComplexity

def dependency_file_parser(dependency_files)
Dependabot::FileParsers.for_package_manager(job.package_manager).new(
Expand Down
Loading