Skip to content

Commit

Permalink
Update files imported from dependabot-updater as of 0.244.0 (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell authored Feb 19, 2024
1 parent 9e72467 commit 894e254
Show file tree
Hide file tree
Showing 90 changed files with 6,586 additions and 718 deletions.
10 changes: 10 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
require:
- rubocop-performance
- rubocop-sorbet

AllCops:
DisplayCopNames: true
Expand Down Expand Up @@ -331,6 +332,15 @@ Style/SpecialGlobalVars:
Enabled: false
Style/SelectByRegexp:
Enabled: false
Sorbet/TrueSigil:
Exclude:
- "**/spec/**/*"
Sorbet/StrictSigil:
Exclude:
- "**/spec/**/*"
Sorbet/StrongSigil:
Exclude:
- "**/spec/**/*"

# TODO these were temporarily disabled during the Ruby 2.7 -> 3.1 upgrade
# in order to keep the upgrade diff small, they will be enabled/fixed in
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ require "yaml"
# python/dependabot-python.gemspec
# pub/dependabot-pub.gemspec
# omnibus/dependabot-omnibus.gemspec
# silent/dependabot-silent.gemspec
# swift/dependabot-swift.gemspec
# devcontainers/dependabot-devcontainers.gemspec
# ).freeze
Expand Down
72 changes: 52 additions & 20 deletions update-files.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Write-Output "Found dependabot-omnibus version: $version"
# Prepare the list of files to be downloaded
$files = @(
".ruby-version"
# ".rubocop.yml"
".rubocop.yml"
# "Rakefile"
"updater/.rubocop.yml"

Expand All @@ -26,11 +26,10 @@ $files = @(
"updater/lib/dependabot/sentry/exception_sanitizer_processor.rb"
"updater/lib/dependabot/sentry/processor.rb"
"updater/lib/dependabot/sentry/sentry_context_processor.rb"
"updater/lib/dependabot/updater/operations/create_group_security_update_pull_request.rb"
"updater/lib/dependabot/sorbet/runtime.rb"
"updater/lib/dependabot/updater/operations/create_group_update_pull_request.rb"
"updater/lib/dependabot/updater/operations/create_security_update_pull_request.rb"
"updater/lib/dependabot/updater/operations/group_update_all_versions.rb"
"updater/lib/dependabot/updater/operations/refresh_group_security_update_pull_request.rb"
"updater/lib/dependabot/updater/operations/refresh_group_update_pull_request.rb"
"updater/lib/dependabot/updater/operations/refresh_security_update_pull_request.rb"
"updater/lib/dependabot/updater/operations/refresh_version_update_pull_request.rb"
Expand All @@ -52,15 +51,16 @@ $files = @(
"updater/lib/dependabot/file_fetcher_command.rb"
"updater/lib/dependabot/job.rb"
"updater/lib/dependabot/opentelemetry.rb"
"updater/lib/dependabot/sentry.rb"
"updater/lib/dependabot/service.rb"
"updater/lib/dependabot/setup.rb"
"updater/lib/dependabot/update_files_command.rb"
"updater/lib/dependabot/updater.rb"

"updater/spec/dependabot/sentry/exception_sanitizer_processor_spec.rb"
"updater/spec/dependabot/sentry/sentry_context_processor_spec.rb"
# "updater/spec/dependabot/updater/operations/group_update_all_versions_spec.rb"
# "updater/spec/dependabot/updater/operations/refresh_group_update_pull_request_spec.rb"
# "updater/spec/dependabot/updater/operations/update_all_versions_spec.rb"
"updater/spec/dependabot/updater/dependency_group_change_batch_spec.rb"
"updater/spec/dependabot/updater/error_handler_spec.rb"
"updater/spec/dependabot/updater/operations_spec.rb"
Expand All @@ -70,49 +70,81 @@ $files = @(
"updater/spec/dependabot/dependency_group_engine_spec.rb"
# "updater/spec/dependabot/dependency_snapshot_spec.rb"
"updater/spec/dependabot/environment_spec.rb"
# "updater/spec/dependabot/file_fetcher_command_spec.rb"
# "updater/spec/dependabot/integration_spec.rb"
"updater/spec/dependabot/file_fetcher_command_spec.rb"
"updater/spec/dependabot/job_spec.rb"
"updater/spec/dependabot/service_spec.rb"
# "updater/spec/dependabot/update_files_command_spec.rb"
# "updater/spec/dependabot/updater_spec.rb"

"updater/spec/fixtures/handle_error.json"
"updater/spec/fixtures/rubygems-index"
"updater/spec/fixtures/rubygems-info-a"
"updater/spec/fixtures/rubygems-versions-a.json"
"updater/spec/fixtures/rubygems-info-b"
"updater/spec/fixtures/rubygems-versions-a.json"
"updater/spec/fixtures/rubygems-versions-b.json"
"updater/spec/fixtures/bundler/original/Gemfile"
"updater/spec/fixtures/bundler/original/Gemfile.lock"
"updater/spec/fixtures/bundler/original/sub_dep"
"updater/spec/fixtures/bundler/original/sub_dep.lock"
"updater/spec/fixtures/bundler/updated/Gemfile"
"updater/spec/fixtures/bundler/updated/Gemfile.lock"
"updater/spec/fixtures/bundler2/original/Gemfile"
"updater/spec/fixtures/bundler2/original/Gemfile.lock"
"updater/spec/fixtures/bundler2/updated/Gemfile"
"updater/spec/fixtures/bundler2/updated/Gemfile.lock"
"updater/spec/fixtures/bundler_gemspec/original/Gemfile"
"updater/spec/fixtures/bundler_gemspec/original/Gemfile.lock"
"updater/spec/fixtures/bundler_gemspec/original/library.gemspec"
"updater/spec/fixtures/bundler_git/original/Gemfile"
"updater/spec/fixtures/bundler_git/original/Gemfile.lock"
"updater/spec/fixtures/bundler_grouped_by_types/original/Gemfile"
"updater/spec/fixtures/bundler_grouped_by_types/original/Gemfile.lock"
"updater/spec/fixtures/bundler_gemspec/updated/Gemfile"
"updater/spec/fixtures/bundler_gemspec/updated/Gemfile.lock"
"updater/spec/fixtures/bundler_gemspec/updated/library.gemspec"
"updater/spec/fixtures/bundler_grouped/original/Gemfile"
"updater/spec/fixtures/bundler_grouped/original/Gemfile.lock"
"updater/spec/fixtures/bundler_vendored/original/Gemfile"
"updater/spec/fixtures/bundler_vendored/original/Gemfile.lock"
"updater/spec/fixtures/bundler_vendored/original/vendor/cache/dummy-pkg-a-2.0.0.gem"
"updater/spec/fixtures/bundler_vendored/original/vendor/cache/dummy-pkg-b-1.1.0.gem"
"updater/spec/fixtures/bundler_vendored/original/vendor/cache/ruby-dummy-git-dependency-20151f9b67c8/.bundlecache"
"updater/spec/fixtures/bundler_vendored/original/vendor/cache/ruby-dummy-git-dependency-20151f9b67c8/dummy-git-dependency.gemspec"
"updater/spec/fixtures/bundler_vendored/updated/Gemfile"
"updater/spec/fixtures/bundler_vendored/updated/Gemfile.lock"
"updater/spec/fixtures/bundler_vendored/updated/.bundle/config"
"updater/spec/fixtures/bundler_vendored/updated/vendor/cache/ruby-dummy-git-dependency-c0e25c2eb332/.bundlecache"
"updater/spec/fixtures/bundler_vendored/updated/vendor/cache/ruby-dummy-git-dependency-c0e25c2eb332/dummy-git-dependency.gemspec"
"updater/spec/fixtures/bundler_vendored/updated/vendor/cache/dummy-pkg-a-2.0.0.gem"
"updater/spec/fixtures/bundler_vendored/updated/vendor/cache/dummy-pkg-b-1.2.0.gem"
"updater/spec/fixtures/composer/original/composer.json"
"updater/spec/fixtures/composer/original/composer.lock"
"updater/spec/fixtures/composer/updated/composer.json"
"updater/spec/fixtures/composer/updated/composer.lock"
"updater/spec/fixtures/dummy/original/a.dummy"
"updater/spec/fixtures/dummy/original/b.dummy"
"updater/spec/fixtures/file_fetcher_output/output.json"
"updater/spec/fixtures/file_fetcher_output/vendoring_output.json"
"updater/spec/fixtures/jobs/job_with_credentials.json"
"updater/spec/fixtures/jobs/job_with_dummy.json"
"updater/spec/fixtures/jobs/job_with_vendor_dependencies.json"
"updater/spec/fixtures/jobs/job_without_credentials.json"
"updater/spec/fixtures/job_definitions/bundler/security_updates/group_update_multi_dir.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all_by_dependency_type.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all_empty_group.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all_overlapping_groups.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all_with_existing_pr.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all_with_ungrouped.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all_with_vendoring.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all_semver_grouping_with_global_ignores.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_all_semver_grouping.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_refresh.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_refresh_dependencies_changed.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_refresh_empty_group.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_refresh_missing_group.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_refresh_versions_changed.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_refresh_similar_pr.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/group_update_refresh_versions_changed.yaml"
"updater/spec/fixtures/job_definitions/bundler/version_updates/update_all_simple.yaml"
"updater/spec/fixtures/job_definitions/dummy/version_updates/group_update_peer_manifests.yaml"
"updater/spec/fixtures/job_definitions/README.md"
"updater/spec/fixtures/vcr_cassettes/Dependabot_FileFetcherCommand/_perform_job/when_the_connectivity_check_is_enabled/when_connectivity_is_broken/logs_connectivity_failed_and_does_not_raise_an_error.yml"
"updater/spec/fixtures/vcr_cassettes/Dependabot_FileFetcherCommand/_perform_job/when_the_connectivity_check_is_enabled/logs_connectivity_is_successful_and_does_not_raise_an_error.yml"
"updater/spec/fixtures/vcr_cassettes/Dependabot_FileFetcherCommand/_perform_job/does_not_clone_the_repo.yml"
"updater/spec/fixtures/vcr_cassettes/Dependabot_FileFetcherCommand/_perform_job/fetches_the_files_and_writes_the_fetched_files_to_output_json.yml"
"updater/spec/fixtures/vcr_cassettes/Dependabot_Updater_Operations_GroupUpdateAllVersions/when_the_snapshot_contains_a_git_dependency/creates_individual_PRs_since_git_dependencies_cannot_be_grouped_as_semver.yml"
"updater/spec/fixtures/vcr_cassettes/Dependabot_Updater_Operations_GroupUpdateAllVersions/when_the_snapshot_is_updating_a_gemspec/creates_a_DependencyChange_for_just_the_modified_files_without_reporting_errors.yml"
"updater/spec/fixtures/vcr_cassettes/Dependabot_Updater_Operations_GroupUpdateAllVersions/when_the_snapshot_is_updating_vendored_dependencies/creates_a_pull_request_that_includes_changes_to_the_vendored_files.yml"

"updater/spec/support/dummy_package_manager/dummy.rb"
"updater/spec/support/dummy_package_manager/file_fetcher.rb"
Expand All @@ -133,11 +165,11 @@ foreach ($name in $files) {
$sourceUrl = "$baseUrl/v$version/$($name)"
$destinationPath = Join-Path -Path '.' -ChildPath "$name"

# Write-Host "`Downloading $name ..."
Write-Host "`Downloading $name ..."

# [System.IO.Directory]::CreateDirectory("$(Split-Path -Path "$destinationPath")") | Out-Null
# Invoke-WebRequest -Uri $sourceUrl -OutFile $destinationPath

echo "Downloading $($name) ..."
mkdir -p "$(dirname "$destinationPath")"
curl -sL "$sourceUrl" -o "$destinationPath"
}
12 changes: 11 additions & 1 deletion updater/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,23 @@ gem "opentelemetry-instrumentation-faraday", "~> 0.23"
gem "opentelemetry-instrumentation-http", "~> 0.23"
gem "opentelemetry-instrumentation-net_http", "~> 0.22"
gem "opentelemetry-sdk", "~> 1.4"
gem "sentry-ruby", "~> 5.1"
gem "sentry-opentelemetry", "~> 5.16"
gem "sentry-ruby", "~> 5.16"
gem "terminal-table", "~> 3.0.2"

group :test do
gem "debug"
gem "gpgme"
gem "rake"
gem "rspec"
gem "rspec-its"
gem "rspec-sorbet"
gem "rubocop"
gem "rubocop-performance"
gem "rubocop-sorbet"
gem "stackprof"
gem "turbo_tests"
gem "vcr"
gem "webmock"
gem "webrick"
end
49 changes: 45 additions & 4 deletions updater/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ GEM
crack (1.0.0)
bigdecimal
rexml
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
dependabot-bundler (0.244.0)
dependabot-common (= 0.244.0)
dependabot-cargo (0.244.0)
Expand Down Expand Up @@ -124,11 +127,13 @@ GEM
gitlab (4.19.0)
httparty (~> 0.20)
terminal-table (>= 1.5.1)
google-protobuf (3.25.2-aarch64-linux)
google-protobuf (3.25.2-arm64-darwin)
google-protobuf (3.25.2-x86_64-linux)
google-protobuf (3.25.3-aarch64-linux)
google-protobuf (3.25.3-arm64-darwin)
google-protobuf (3.25.3-x86_64-linux)
googleapis-common-protos-types (1.11.0)
google-protobuf (~> 3.18)
gpgme (2.0.24)
mini_portile2 (~> 2.7)
hashdiff (1.1.0)
http (5.2.0)
addressable (~> 2.8)
Expand All @@ -143,6 +148,10 @@ GEM
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
io-console (0.7.2)
irb (1.11.2)
rdoc
reline (>= 0.4.2)
jmespath (1.6.2)
json (2.6.3)
language_server-protocol (3.17.0.3)
Expand All @@ -153,6 +162,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0206)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
multi_xml (0.6.0)
netrc (0.11.0)
nokogiri (1.16.2-aarch64-linux)
Expand Down Expand Up @@ -202,6 +212,8 @@ GEM
opentelemetry-semantic_conventions (1.10.0)
opentelemetry-api (~> 1.0)
parallel (1.24.0)
parallel_tests (4.5.1)
parallel
parseconfig (1.0.8)
parser (3.3.0.5)
ast (~> 2.4.1)
Expand All @@ -212,7 +224,11 @@ GEM
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rdoc (6.6.2)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.4.2)
io-console (~> 0.5)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
Expand All @@ -228,9 +244,14 @@ GEM
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-sorbet (1.9.2)
sorbet-runtime
rspec-support (3.13.0)
rubocop (1.60.2)
json (~> 2.3)
Expand All @@ -248,26 +269,36 @@ GEM
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-sorbet (0.7.7)
rubocop (>= 0.90.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
sentry-opentelemetry (5.16.1)
opentelemetry-sdk (~> 1.0)
sentry-ruby (~> 5.16.1)
sentry-ruby (5.16.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
sorbet-runtime (0.5.11262)
stackprof (0.2.26)
stringio (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
toml-rb (2.2.0)
citrus (~> 3.0, > 3.0)
turbo_tests (2.2.0)
parallel_tests (>= 3.3.0, < 5)
rspec (>= 3.10)
unicode-display_width (2.5.0)
vcr (6.2.0)
webmock (3.20.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.1)

PLATFORMS
aarch64-linux
Expand All @@ -276,7 +307,9 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
debug
dependabot-omnibus (~> 0.244.0)
gpgme
http (~> 5.2)
octokit (= 6.1.1)
opentelemetry-exporter-otlp (~> 0.26)
Expand All @@ -285,13 +318,21 @@ DEPENDENCIES
opentelemetry-instrumentation-http (~> 0.23)
opentelemetry-instrumentation-net_http (~> 0.22)
opentelemetry-sdk (~> 1.4)
rake
rspec
rspec-its
rspec-sorbet
rubocop
rubocop-performance
sentry-ruby (~> 5.1)
rubocop-sorbet
sentry-opentelemetry (~> 5.16)
sentry-ruby (~> 5.16)
stackprof
terminal-table (~> 3.0.2)
turbo_tests
vcr
webmock
webrick

BUNDLED WITH
2.3.26
4 changes: 1 addition & 3 deletions updater/lib/dependabot/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def mark_job_as_processed(base_commit_sha)
span&.finish
end

sig { params(dependencies: T::Array[T::Hash[Symbol, T.untyped]], dependency_files: T::Array[DependencyFile]).void }
sig { params(dependencies: T::Array[T::Hash[Symbol, T.untyped]], dependency_files: T::Array[String]).void }
def update_dependency_list(dependencies, dependency_files)
span = ::Dependabot::OpenTelemetry.tracer&.start_span("update_dependency_list", kind: :internal)
span&.set_attribute(::Dependabot::OpenTelemetry::Attributes::JOB_ID, job_id)
Expand Down Expand Up @@ -290,8 +290,6 @@ def create_pull_request_data(dependency_change, base_commit_sha)
"base-commit-sha": base_commit_sha
}.merge(dependency_group_hash(dependency_change))

return data unless dependency_change.pr_message

data["commit-message"] = dependency_change.pr_message.commit_message
data["pr-title"] = dependency_change.pr_message.pr_name
data["pr-body"] = dependency_change.pr_message.pr_message
Expand Down
Loading

0 comments on commit 894e254

Please sign in to comment.