From cb882e36bb19a4c3d53e53f167066823558e0e3b Mon Sep 17 00:00:00 2001 From: Hook25 Date: Tue, 20 Aug 2024 14:38:32 +0200 Subject: [PATCH] Review feedback --- checkbox-ng/plainbox/impl/secure/qualifiers.py | 14 +++++--------- checkbox-ng/plainbox/impl/session/assistant.py | 2 +- docs/reference/launcher.rst | 8 ++++---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/checkbox-ng/plainbox/impl/secure/qualifiers.py b/checkbox-ng/plainbox/impl/secure/qualifiers.py index c77ee1c517..4421131c1f 100644 --- a/checkbox-ng/plainbox/impl/secure/qualifiers.py +++ b/checkbox-ng/plainbox/impl/secure/qualifiers.py @@ -33,14 +33,10 @@ import re import sre_constants -from contextlib import suppress - from plainbox.abc import IUnitQualifier from plainbox.i18n import gettext as _ from plainbox.impl import pod -from plainbox.impl.secure.origin import FileTextSource from plainbox.impl.secure.origin import Origin -from plainbox.impl.secure.origin import UnknownTextSource _logger = logging.getLogger("plainbox.secure.qualifiers") @@ -166,19 +162,19 @@ def __init__(self, pattern, origin, inclusive=True): raise exc self._pattern_text = pattern - def get_simple_match(self, job): + def get_simple_match(self, unit): """ - Check if the given job matches this qualifier. + Check if the given unit matches this qualifier. This method should not be called directly, it is an implementation detail of SimpleQualifier class. """ pattern = self._pattern - if job.template_id: + if unit.template_id: return bool( - pattern.match(job.template_id) or pattern.match(job.id) + pattern.match(unit.template_id) or pattern.match(unit.id) ) - return self._pattern.match(job.id) is not None + return pattern.match(unit.id) is not None @property def pattern_text(self): diff --git a/checkbox-ng/plainbox/impl/session/assistant.py b/checkbox-ng/plainbox/impl/session/assistant.py index 0b1e69659c..b4924dd813 100644 --- a/checkbox-ng/plainbox/impl/session/assistant.py +++ b/checkbox-ng/plainbox/impl/session/assistant.py @@ -944,7 +944,7 @@ def finish_bootstrap(self): ], ) if self._match_qualifiers: - # when only include is provided, use the testplan but prune it to + # when `match` is provided, use the test plan but prune it to # only pull the jobs asked in the launcher or their dependencies desired_job_list = select_units( desired_job_list, diff --git a/docs/reference/launcher.rst b/docs/reference/launcher.rst index 124f6adf28..9babdad343 100644 --- a/docs/reference/launcher.rst +++ b/docs/reference/launcher.rst @@ -209,10 +209,10 @@ Note: To clear the exclude list use... ...in your 'last' config. ``match`` - List of regex patterns that job ids will be matched against. Checkbox will - only run the matching jobs, their dependencies and any job included in the - testplan bootstrap section. This is useful to re-run the failing subset of - jobs included in a test plan + List of regex patterns that job ids and template ids will be matched against. + Checkbox will only run the matching jobs, their dependencies and any job + included in the testplan bootstrap section. This is useful to re-run the + failing subset of jobs included in a test plan. Only run ``bluetooth`` jobs and their dependencies: