-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to control PR description max length + set reasonable defa…
…ults for each platform (#7487) Add option to set the max character length of the PR description. Any descriptions longer than the max will get truncated with a clear message to the user that the remaining description was truncated. This is mostly a refactor / moving of existing code that had been copy/pasted across several PR creators so that we have a clean generic version that can re-used everywhere. In addition to being configurable, this also sets reasonable defaults for some of the platforms we support. --------- Co-authored-by: Dennis Carey <[email protected]> Co-authored-by: Jeff Widman <[email protected]>
- Loading branch information
1 parent
e4afdd4
commit ce32701
Showing
9 changed files
with
139 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,23 +168,6 @@ | |
end | ||
end | ||
|
||
context "with e very long pr description" do | ||
let(:pr_description) { ("a" * 3997) + "💣 kaboom" } | ||
it "truncates the description respecting azures encoding" do | ||
creator.create | ||
|
||
expect(WebMock). | ||
to( | ||
have_requested(:post, "#{repo_api_url}/pullrequests?api-version=5.0"). | ||
with do |req| | ||
description = JSON.parse(req.body).fetch("description") | ||
expect(description.length).to eq 4000 | ||
expect(description).to end_with("\n\n_Description has been truncated_") | ||
end | ||
) | ||
end | ||
end | ||
|
||
context "with author details provided" do | ||
let(:author_details) do | ||
{ email: "[email protected]", name: "dependabot" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters