Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix github specs broken due to missing merge_commit_sha

Markus Kahlc2386064a7fd
diff --git a/modules/github_integration/lib/open_project/github_integration/services/upsert_pull_request.rb b/modules/github_integration/lib/open_project/github_integration/services/upsert_pull_request.rb
index 19000c1eb6f..914af5b921b 100644
--- a/modules/github_integration/lib/open_project/github_integration/services/upsert_pull_request.rb
+++ b/modules/github_integration/lib/open_project/github_integration/services/upsert_pull_request.rb
@@ -70,7 +70,7 @@ module OpenProject::GithubIntegration::Services
.fetch("repo")
.fetch("html_url"),
draft: payload.fetch("draft"),
- merge_commit_sha: payload.fetch("merge_commit_sha"),
+ merge_commit_sha: payload["merge_commit_sha"],
merged: payload.fetch("merged"),
merged_by: github_user_id(payload["merged_by"]),
merged_at: payload["merged_at"],
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/pull_request_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/pull_request_spec.rb
index 73e8373bd50..8cb4edab8d7 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/pull_request_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/notification_handler/pull_request_spec.rb
@@ -51,7 +51,7 @@ RSpec.describe OpenProject::GithubIntegration::NotificationHandler::PullRequest
"merged" => pr_merged,
"merged_by" => nil,
"merged_at" => nil,
- "merge_commit_sha" => "955af2f83de81c39fcf912376855eb3ee5e38f26",
+ "merge_commit_sha" => nil,
"comments" => 1,
"review_comments" => 2,
"additions" => 3,
diff --git a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_pull_request_spec.rb b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_pull_request_spec.rb
index afc97f1b655..95b2cc1e7a9 100644
--- a/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_pull_request_spec.rb
+++ b/modules/github_integration/spec/lib/open_project/github_integration/services/upsert_pull_request_spec.rb
@@ -181,7 +181,8 @@ RSpec.describe OpenProject::GithubIntegration::Services::UpsertPullRequest do
{
"merged" => true,
"merged_by" => user_payload,
- "merged_at" => "20210410T09:45:03Z"
+ "merged_at" => "20210410T09:45:03Z",
+ "merge_commit_sha" => "955af2f83de81c39fcf912376855eb3ee5e38f26",
}
end
@@ -195,7 +196,8 @@ RSpec.describe OpenProject::GithubIntegration::Services::UpsertPullRequest do
github_user:,
merged: true,
merged_by: github_user,
- merged_at: Time.zone.parse("20210410T09:45:03Z")
+ merged_at: Time.zone.parse("20210410T09:45:03Z"),
+ merge_commit_sha: "955af2f83de81c39fcf912376855eb3ee5e38f26"
)
end
end