Skip to content

Commit

Permalink
Use GROUPS (plural) for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
landongrindheim committed Mar 12, 2024
1 parent a07aa22 commit 372abcc
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions common/lib/dependabot/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ module Dependabot
extend T::Sig

module ErrorAttributes
BACKTRACE = "error-backtrace"
CLASS = "error-class"
DETAILS = "error-details"
MESSAGE = "error-message"
DEPENDENCIES = "job-dependencies"
DEPENDENCY_GROUP = "job-dependency-group"
JOB_ID = "job-id"
PACKAGE_MANAGER = "package-manager"
BACKTRACE = "error-backtrace"
CLASS = "error-class"
DETAILS = "error-details"
MESSAGE = "error-message"
DEPENDENCIES = "job-dependencies"
DEPENDENCY_GROUPS = "job-dependency-groups"
JOB_ID = "job-id"
PACKAGE_MANAGER = "package-manager"
end

# rubocop:disable Metrics/MethodLength
Expand Down
2 changes: 1 addition & 1 deletion updater/lib/dependabot/base_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def handle_unknown_error(err)
ErrorAttributes::PACKAGE_MANAGER => job.package_manager,
ErrorAttributes::JOB_ID => job.id,
ErrorAttributes::DEPENDENCIES => job.dependencies,
ErrorAttributes::DEPENDENCY_GROUP => job.dependency_groups
ErrorAttributes::DEPENDENCY_GROUPS => job.dependency_groups
}.compact
service.record_update_job_unknown_error(error_type: "updater_error", error_details: error_details)
service.increment_metric("updater.update_job_unknown_error", tags: {
Expand Down
2 changes: 1 addition & 1 deletion updater/lib/dependabot/file_fetcher_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def handle_file_fetcher_error(error)
ErrorAttributes::PACKAGE_MANAGER => job.package_manager,
ErrorAttributes::JOB_ID => job.id,
ErrorAttributes::DEPENDENCIES => job.dependencies,
ErrorAttributes::DEPENDENCY_GROUP => job.dependency_groups
ErrorAttributes::DEPENDENCY_GROUPS => job.dependency_groups
}.compact

error_details = {
Expand Down
2 changes: 1 addition & 1 deletion updater/lib/dependabot/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def capture_exception(error:, job: nil, dependency: nil, dependency_group: nil,
ErrorAttributes::PACKAGE_MANAGER => job&.package_manager,
ErrorAttributes::JOB_ID => job&.id,
ErrorAttributes::DEPENDENCIES => dependency&.name || job&.dependencies,
ErrorAttributes::DEPENDENCY_GROUP => dependency_group&.name || job&.dependency_groups
ErrorAttributes::DEPENDENCY_GROUPS => dependency_group&.name || job&.dependency_groups
}.compact
record_update_job_unknown_error(error_type: "unknown_error", error_details: error_details)
end
Expand Down
2 changes: 1 addition & 1 deletion updater/lib/dependabot/update_files_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def handle_parser_error(error)
ErrorAttributes::PACKAGE_MANAGER => job.package_manager,
ErrorAttributes::JOB_ID => job.id,
ErrorAttributes::DEPENDENCIES => job.dependencies,
ErrorAttributes::DEPENDENCY_GROUP => job.dependency_groups
ErrorAttributes::DEPENDENCY_GROUPS => job.dependency_groups
}.compact

service.capture_exception(error: error, job: job)
Expand Down
2 changes: 1 addition & 1 deletion updater/lib/dependabot/updater/error_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def log_unknown_error_with_backtrace(error)
ErrorAttributes::PACKAGE_MANAGER => job.package_manager,
ErrorAttributes::JOB_ID => job.id,
ErrorAttributes::DEPENDENCIES => job.dependencies,
ErrorAttributes::DEPENDENCY_GROUP => job.dependency_groups
ErrorAttributes::DEPENDENCY_GROUPS => job.dependency_groups
}.compact

service.increment_metric("updater.update_job_unknown_error", tags: {
Expand Down
6 changes: 3 additions & 3 deletions updater/spec/dependabot/file_fetcher_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
Dependabot::ErrorAttributes::CLASS => "StandardError",
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)
expect(api_client).to receive(:record_update_job_unknown_error)
Expand All @@ -163,7 +163,7 @@
Dependabot::ErrorAttributes::CLASS => "StandardError",
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)
expect(api_client).to receive(:mark_job_as_processed)
Expand All @@ -188,7 +188,7 @@
Dependabot::ErrorAttributes::CLASS => "StandardError",
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)
expect(api_client).to receive(:mark_job_as_processed)
Expand Down
2 changes: 1 addition & 1 deletion updater/spec/dependabot/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
error_details: hash_including(
Dependabot::ErrorAttributes::MESSAGE => "Something went wrong",
Dependabot::ErrorAttributes::CLASS => "Dependabot::DependabotError",
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => "all-the-things"
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => "all-the-things"
)
)
end
Expand Down
6 changes: 3 additions & 3 deletions updater/spec/dependabot/update_files_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
Dependabot::ErrorAttributes::CLASS => "StandardError",
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)

Expand All @@ -152,7 +152,7 @@
Dependabot::ErrorAttributes::CLASS => "StandardError",
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)

Expand All @@ -176,7 +176,7 @@
Dependabot::ErrorAttributes::CLASS => "StandardError",
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)

Expand Down
6 changes: 3 additions & 3 deletions updater/spec/dependabot/updater/error_handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCIES => [],
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)

Expand Down Expand Up @@ -187,7 +187,7 @@
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCIES => [],
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)

Expand Down Expand Up @@ -334,7 +334,7 @@
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "123123",
Dependabot::ErrorAttributes::DEPENDENCIES => [],
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)

Expand Down
2 changes: 1 addition & 1 deletion updater/spec/dependabot/updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ def expect_update_checker_with_ignored_versions(versions, dependency_matcher: an
Dependabot::ErrorAttributes::CLASS => "Dependabot::SharedHelpers::HelperSubprocessFailed",
Dependabot::ErrorAttributes::PACKAGE_MANAGER => "bundler",
Dependabot::ErrorAttributes::JOB_ID => "1",
Dependabot::ErrorAttributes::DEPENDENCY_GROUP => []
Dependabot::ErrorAttributes::DEPENDENCY_GROUPS => []
}
)
updater.run
Expand Down

0 comments on commit 372abcc

Please sign in to comment.