Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check for a changelog text before returning a changelog url #10522

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,8 @@ def build_table(summary, rows)

sig { params(dependency: Dependabot::Dependency).returns(T.nilable(String)) }
def changelog_url(dependency)
metadata_finder(dependency).changelog_url
metadata = metadata_finder(dependency)
metadata.changelog_url if metadata.changelog_text
end

sig { params(dependency: Dependabot::Dependency).returns(T.nilable(String)) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3429,6 +3429,18 @@ def commits_details(base:, head:)
expect(commit_message).to eql(expected_commit_message)
end

context "when changelog file does not contain relevant versions" do
it "does not contain changelog url" do
stub_const("Dependabot::MetadataFinders::Base::ChangelogFinder::CHANGELOG_NAMES",
T.let(%w(license).freeze, T::Array[String]))

expect(commit_message).to end_with(
"- [Release notes](https://github.com/gocardless/business/releases)\n" \
"- [Commits](https://github.com/gocardless/business/compare/v1.4.0...v1.5.0)"
)
end
end

context "with a PR name that is too long" do
before do
allow(builder).to receive(:pr_name)
Expand Down
Loading
Loading