Skip to content
Snippets Groups Projects
Commit 1cbb8cee authored by Walter Lozano's avatar Walter Lozano Committed by Dylan Aïssi
Browse files

analyse-missing-packages: Add support for labels


During the rebase lots of MR will be handled, so using labels makes it
easier to focus on the important packages.

Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
parent 6976dc99
No related branches found
No related tags found
1 merge request!240Rebase improvements
Pipeline #882402 passed
......@@ -52,7 +52,7 @@ class Analyser:
return component
def analyse_package(self, package, target, debian, trigger_trivial = False):
def analyse_package(self, package, target, debian, trigger_trivial = False, label = None):
logging.debug(f"Analysing {package}")
package = RENAMED.get(package, package)
logging.debug(f"Analysing {package}")
......@@ -67,6 +67,14 @@ class Analyser:
for mr in project.mergerequests.list(iterator=True, lazy=True):
if mr.target_branch == target and mr.state == 'opened':
logging.info(f"{project.web_url} has an open MR - {mr.web_url}")
if label:
if label == "!":
mr.labels = []
elif label.startswith("!") and label[1:] in mr.labels:
mr.labels.remove(label[1:])
else:
mr.labels.append(label)
mr.save()
return
try:
......@@ -155,6 +163,9 @@ if __name__ == "__main__":
parser.add_argument('--group',
default = 'pkg',
help = 'Gitlab group were package are stored')
parser.add_argument('--label',
default = '',
help = 'Apply a label to the MR if present')
args = parser.parse_args()
logging.basicConfig(format='%(asctime)s %(message)s',
......@@ -166,4 +177,4 @@ if __name__ == "__main__":
missing = open(args.missing);
for l in missing.readlines():
package = l.rstrip();
a.analyse_package(package, args.apertis_target_branch, args.debian_branch, args.trigger_trivial)
a.analyse_package(package, args.apertis_target_branch, args.debian_branch, args.trigger_trivial, args.label)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment