Skip to content

Commit dfcd717

Browse files
author
v-HaripriyaC
committed
added fixes for failing checks
1 parent 692d495 commit dfcd717

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

github_actions/lib/dependabot/github_actions/package/package_details_fetcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def fetch_tag_and_release_date
146146

147147
# Log an error if we couldn't fetch any release dates
148148
if result.empty? && allowed_version_tags.any?
149-
Dependabot.logger.error("Error fetching tag and release date: unable to fetch release dates for any allowed tags")
149+
Dependabot.logger.error("Error: unable to fetch release dates for any allowed tags")
150150
end
151151

152152
result

github_actions/lib/dependabot/github_actions/update_checker/latest_version_finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def latest_version_tag
107107

108108
sig { returns(T.nilable(Dependabot::GithubActions::Package::PackageDetailsFetcher)) }
109109
def package_details_fetcher
110-
@package_details_fetcher = T.let(
110+
@package_details_fetcher ||= T.let(
111111
Dependabot::GithubActions::Package::PackageDetailsFetcher
112112
.new(
113113
dependency: dependency,

github_actions/spec/dependabot/github_actions/update_checker/latest_version_finder_spec.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
credentials: github_credentials,
6161
security_advisories: security_advisories,
6262
ignored_versions: ignored_versions,
63-
raise_on_ignored: raise_on_ignored
63+
raise_on_ignored: raise_on_ignored,
64+
cooldown_options: Dependabot::Package::ReleaseCooldownOptions.new(default_days: 90)
6465
)
6566
end
6667

@@ -415,8 +416,9 @@
415416
end
416417

417418
before do
418-
allow_any_instance_of(Dependabot::GithubActions::Package::PackageDetailsFetcher)
419-
.to receive(:fetch_tag_and_release_date).and_raise(StandardError, "git error")
419+
mock_fetcher = instance_double(Dependabot::GithubActions::Package::PackageDetailsFetcher)
420+
allow(mock_fetcher).to receive(:fetch_tag_and_release_date).and_raise(StandardError, "git error")
421+
allow(finder).to receive(:package_details_fetcher).and_return(mock_fetcher)
420422
end
421423

422424
it "handles error gracefully and returns empty array" do

0 commit comments

Comments
 (0)