Skip to content

Commit

Permalink
Only record ecosystem versions when flag set (dependabot#7516)
Browse files Browse the repository at this point in the history
There's no point in recording the versions on GHES / non-cloud instances
because we can't access that data for telemetry purposes. So put it
behind a feature flag.

This will also make it so later on when we do the rename of
`record_package_manager_version` to `record_ecosystem_versions`, there
is less to worry about for backwards incompatible changes on GHES.
  • Loading branch information
jeffwidman authored Jul 4, 2023
1 parent 0fe7f97 commit 2b2ad94
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions updater/lib/dependabot/file_fetcher_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ def perform_job
@base_commit_sha = file_fetcher.commit
raise "base commit SHA not found" unless @base_commit_sha

version = file_fetcher.package_manager_version
api_client.record_package_manager_version(version[:package_managers]) unless version.nil?
# We don't set this flag in GHES because there's no point in recording versions since we can't access that data.
# TODO: The flag is named `record_ecosystem_versions` because `package_manager_version` is getting renamed to
# to that shortly... but splitting into separate PR's for lower risk/easiery testability. Once the follow-on PR
# with the rename lands, the name confusion will disappear.
if Experiments.enabled?(:record_ecosystem_versions)
version = file_fetcher.package_manager_version
api_client.record_package_manager_version(version[:package_managers]) unless version.nil?
end

dependency_files
rescue StandardError => e
Expand Down

0 comments on commit 2b2ad94

Please sign in to comment.