Skip to content

Commit

Permalink
Merge branch 'main' into nishnha/defer-opening-duplicate-grouped-prs
Browse files Browse the repository at this point in the history
  • Loading branch information
brrygrdn authored May 8, 2023
2 parents 6546516 + 5adef00 commit dcd24cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
8 changes: 7 additions & 1 deletion updater/lib/dependabot/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Job
vendor_dependencies
dependency_groups
dependency_group_to_refresh
repo_private
)

attr_reader :allowed_updates,
Expand Down Expand Up @@ -80,7 +81,7 @@ def self.standardise_keys(hash)

# NOTE: "attributes" are fetched and injected at run time from
# dependabot-api using the UpdateJobPrivateSerializer
def initialize(attributes)
def initialize(attributes) # rubocop:disable Metrics/AbcSize
@id = attributes.fetch(:id)
@allowed_updates = attributes.fetch(:allowed_updates)
@commit_message_options = attributes.fetch(:commit_message_options, {})
Expand Down Expand Up @@ -111,6 +112,7 @@ def initialize(attributes)
@vendor_dependencies = attributes.fetch(:vendor_dependencies, false)
@dependency_groups = attributes.fetch(:dependency_groups, [])
@dependency_group_to_refresh = attributes.fetch(:dependency_group_to_refresh, nil)
@repo_private = attributes.fetch(:repo_private, nil)

register_experiments
register_dependency_groups
Expand All @@ -130,6 +132,10 @@ def repo_contents_path
@repo_contents_path
end

def repo_private?
@repo_private
end

def updating_a_pull_request?
@updating_a_pull_request
end
Expand Down
3 changes: 2 additions & 1 deletion updater/lib/dependabot/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def capture_exception(error:, job: nil, dependency: nil, tags: {}, extra: {})
{
tags: tags.merge({
update_job_id: job&.id,
package_manager: job&.package_manager
package_manager: job&.package_manager,
repo_private: job&.repo_private?
}.compact),
extra: extra.merge({
dependency_name: dependency&.name
Expand Down
4 changes: 3 additions & 1 deletion updater/spec/dependabot/job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
experiments: experiments,
commit_message_options: commit_message_options,
security_updates_only: security_updates_only,
dependency_groups: dependency_groups
dependency_groups: dependency_groups,
repo_private: repo_private
}
end

Expand All @@ -65,6 +66,7 @@
let(:commit_message_options) { nil }
let(:vendor_dependencies) { false }
let(:dependency_groups) { [] }
let(:repo_private) { false }

describe "::new_update_job" do
let(:job_json) { fixture("jobs/job_with_credentials.json") }
Expand Down

0 comments on commit dcd24cc

Please sign in to comment.