Compare commits
2 Commits
2245698405
...
b4b2b2ec5d
Author | SHA1 | Date | |
---|---|---|---|
b4b2b2ec5d | |||
ec8e3e491e |
@ -58,6 +58,13 @@ def pr_merge_status(
|
||||
|
||||
results = {}
|
||||
|
||||
# Check if base branch is in our list, if it is
|
||||
# no need to call commit_in_branch
|
||||
merge_base_branch = pr_data.get("base", {}).get("ref")
|
||||
if merge_base_branch in branches:
|
||||
results[merge_base_branch] = True
|
||||
branches.remove(merge_base_branch)
|
||||
|
||||
for branch in branches:
|
||||
in_branch = commit_in_branch(commit_sha, branch)
|
||||
results[branch] = in_branch
|
||||
|
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "nixprstatus"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
description = "Nixpkgs PR status checker"
|
||||
authors = ["Torjus Håkestad <torjus@usit.uio.no>"]
|
||||
license = "MIT"
|
||||
|
@ -66,6 +66,19 @@ class TestPRMergeStatus(unittest.TestCase):
|
||||
res = pr_merge_status(pr, branches, check_backport=True)
|
||||
self.assertEqual(res.title, expected_title)
|
||||
|
||||
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
||||
def test_pr_merge_status_no_check_master_345583(self, mock_get):
|
||||
pr = 345583
|
||||
branches = ["master", "nixos-unstable", "nixos-24.05"]
|
||||
master_compare_url = "https://api.github.com/repos/NixOS/nixpkgs/compare/master...2c5fac3edf2d00d948253e392ec1604b29b38f14"
|
||||
|
||||
res = pr_merge_status(pr, branches, check_backport=False)
|
||||
self.assertTrue(res.merged)
|
||||
self.assertTrue(res.branches["master"])
|
||||
|
||||
urls_called = [call[0][0] for call in mock_get.call_args_list]
|
||||
self.assertFalse(master_compare_url in urls_called)
|
||||
|
||||
|
||||
class TestCommitInBranch(unittest.TestCase):
|
||||
@unittest.mock.patch("requests.get", side_effect=mocked_requests_get)
|
||||
|
Loading…
Reference in New Issue
Block a user