Skip to content

Commit 26e7ff4

Browse files
committed
Sort the build based on the tagging timestamp
Signed-off-by: Gaëtan Lehmann <[email protected]>
1 parent 4417527 commit 26e7ff4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/pkg_in_pipe/pkg_in_pipe.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,14 @@ def find_pull_requests(gh, repo, start_sha, end_sha):
315315
session = koji.ClientSession('https://kojihub.xcp-ng.org', config)
316316
session.ssl_login(config['cert'], None, config['serverca'])
317317
for tag in tags:
318+
tag_history = dict(
319+
(tl['build_id'], tl['create_ts'])
320+
for tl in session.queryHistory(tag=tag, active=True)['tag_listing']
321+
)
318322
print_table_header(temp_out, tag)
319-
taggeds = sorted(session.listTagged(tag), key=lambda build: int(build['build_id']), reverse=True)
323+
taggeds = session.listTagged(tag)
320324
taggeds = [t for t in taggeds if t['package_name'] in args.packages or args.packages == []]
325+
taggeds = sorted(taggeds, key=lambda t: (tag_history[t['build_id']], t['build_id']), reverse=True)
321326
for tagged in taggeds:
322327
build = session.getBuild(tagged['build_id'])
323328
prs: list[PullRequest] = []

0 commit comments

Comments
 (0)