Skip to content

Commit 43a3e12

Browse files
authored
Merge pull request #838 from xcp-ng/gln/pkg-in-pipe-updates-psmx
pkg_in_pipe: keep PRs merged by rebase or squash
2 parents e9941c9 + 26db50c commit 43a3e12

2 files changed

Lines changed: 115 additions & 4 deletions

File tree

scripts/pkg_in_pipe/pkg_in_pipe.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def find_pull_requests(repo, start_sha, end_sha):
246246
"""Find the pull requests for the commits in the [start_sha,end_sha[ range."""
247247
prs = set()
248248
for commit in find_commits(GITHUB, repo, start_sha, end_sha):
249-
cache_key = f'commit-prs-4-{commit.sha}'
249+
cache_key = f'commit-prs-6-{commit.sha}'
250250
if not args.re_cache and cache_key in CACHE:
251251
prs.update(cast(list[PullRequest], CACHE[cache_key]))
252252
elif GITHUB:
@@ -258,9 +258,12 @@ def find_pull_requests(repo, start_sha, end_sha):
258258
if group:
259259
pr = GITHUB.get_repo(repo).get_pull(int(group[1]))
260260
prs.add(pr)
261-
# github sometimes return a PR which doesn't match the given commit, so we check if the commit
262-
# is actually in the PR
263-
commit_prs = [pr for pr in commit_prs if commit in pr.get_commits()]
261+
# github sometimes returns a PR which is only related to the commit through its branch
262+
# history, e.g. a PR whose branch was created from this commit, so we check that the
263+
# commit is actually part of the PR: it must be one of its commits, or its merge
264+
# commit. The latter is needed for the PRs merged by rebase or squash, whose merge
265+
# commit on the base branch is not one of the PR commits.
266+
commit_prs = [pr for pr in commit_prs if commit in pr.get_commits() or commit.sha == pr.merge_commit_sha]
264267
CACHE.set(cache_key, commit_prs, expire=RETENTION_TIME)
265268
prs.update(commit_prs)
266269
return sorted(prs, key=lambda p: p.number, reverse=True)

scripts/pkg_in_pipe/report.json

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"generated_at": "2026-08-26T14:54:16.276502",
3+
"generated_info": null,
4+
"warnings": {
5+
"plane": false,
6+
"github": false
7+
},
8+
"error": null,
9+
"tags": [
10+
{
11+
"tag": "v8.3-testing",
12+
"builds": [
13+
{
14+
"nvr": "sm-3.2.12-23.5.xcpng8.3",
15+
"previous_nvr": "sm-3.2.12-23.4.xcpng8.3",
16+
"package": "sm",
17+
"url": "https://koji.xcp-ng.org/buildinfo?buildID=6089",
18+
"built_by": "gaetan.lehmann",
19+
"maintained_by": "Storage",
20+
"issues": [
21+
{
22+
"sequence_id": 3706,
23+
"url": "https://project.vates.tech/vates-global/browse/XCPNG-3706/",
24+
"milestones": [
25+
"8.3-next"
26+
]
27+
},
28+
{
29+
"sequence_id": 3675,
30+
"url": "https://project.vates.tech/vates-global/browse/XCPNG-3675/",
31+
"milestones": [
32+
"8.3-next"
33+
]
34+
},
35+
{
36+
"sequence_id": 3674,
37+
"url": "https://project.vates.tech/vates-global/browse/XCPNG-3674/",
38+
"milestones": [
39+
"8.3-next"
40+
]
41+
}
42+
],
43+
"pull_requests": [
44+
{
45+
"number": 104,
46+
"title": "Release 3.2.12-23.5",
47+
"url": "https://github.com/xcp-ng-rpms/sm/pull/104",
48+
"linked": true
49+
}
50+
],
51+
"build_linked": true
52+
},
53+
{
54+
"nvr": "xapi-26.1.16-1.2.xcpng8.3",
55+
"previous_nvr": "xapi-26.1.16-1.1.xcpng8.3",
56+
"package": "xapi",
57+
"url": "https://koji.xcp-ng.org/buildinfo?buildID=6088",
58+
"built_by": "asultanov",
59+
"maintained_by": "XAPI & Network",
60+
"issues": [
61+
{
62+
"sequence_id": 3671,
63+
"url": "https://project.vates.tech/vates-global/browse/XCPNG-3671/",
64+
"milestones": [
65+
"8.3-next"
66+
]
67+
}
68+
],
69+
"pull_requests": [
70+
{
71+
"number": 142,
72+
"title": "Optimize migration from QCOW2-backed VDIs + preserve VDI tags on migration",
73+
"url": "https://github.com/xcp-ng-rpms/xapi/pull/142",
74+
"linked": true
75+
}
76+
],
77+
"build_linked": true
78+
},
79+
{
80+
"nvr": "blktap-3.55.5-9.4.xcpng8.3",
81+
"previous_nvr": "blktap-3.55.5-9.3.xcpng8.3",
82+
"package": "blktap",
83+
"url": "https://koji.xcp-ng.org/buildinfo?buildID=6091",
84+
"built_by": "abourgeois",
85+
"maintained_by": "Storage",
86+
"issues": [
87+
{
88+
"sequence_id": 3669,
89+
"url": "https://project.vates.tech/vates-global/browse/XCPNG-3669/",
90+
"milestones": [
91+
"8.3-next"
92+
]
93+
}
94+
],
95+
"pull_requests": [
96+
{
97+
"number": 28,
98+
"title": "Release 3.55.5-9.4",
99+
"url": "https://github.com/xcp-ng-rpms/blktap/pull/28",
100+
"linked": true
101+
}
102+
],
103+
"build_linked": true
104+
}
105+
]
106+
}
107+
]
108+
}

0 commit comments

Comments
 (0)