From 47139bb4922bd0223fe14a6a5448fe7820e44466 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Thu, 25 May 2023 02:31:11 +0100 Subject: [PATCH 1/2] tools/lisa-make-preview: Use branch sha1 for remote name FIX Ensure the remote name is unique to each branch by using the head commit's sha1. --- tools/lisa-make-preview | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/lisa-make-preview b/tools/lisa-make-preview index e81a4a91d..e7f45e0c4 100755 --- a/tools/lisa-make-preview +++ b/tools/lisa-make-preview @@ -22,6 +22,7 @@ from itertools import starmap, chain from tempfile import NamedTemporaryFile import json from collections import ChainMap +from operator import itemgetter from github3 import GitHub @@ -51,7 +52,7 @@ def main(): ] def make_topic(issue, pr): - remote = f'remote_{pr.head.ref}' + remote = f'remote_{pr.head.sha}' return ( { remote: { @@ -66,7 +67,7 @@ def main(): } ) - topics = sorted(starmap(make_topic, prs)) + topics = list(starmap(make_topic, prs)) if topics: remotes, topics = zip(*topics) remotes = dict(ChainMap(*chain( @@ -86,7 +87,7 @@ def main(): 'remote': 'github', 'ref': 'main', }, - 'topics': sorted(topics) + 'topics': sorted(topics, key=itemgetter('name')) } } conf = json.dumps(conf, indent=4) -- GitLab From f7fee3af7cfc8b1744cf99a82725f453ba1383d5 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Thu, 25 May 2023 02:37:47 +0100 Subject: [PATCH 2/2] .github/workflows/preview.yml: Fixup condition --- .github/workflows/preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index bb2468c5c..2d37af013 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -31,7 +31,7 @@ jobs: ( ( github.event.action == 'synchronize' && - contains(github.event.pull_request_target.labels.*.name, 'preview') + contains(github.event.pull_request.labels.*.name, 'preview') ) || ( ( -- GitLab