Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Hook25 committed Aug 20, 2024
1 parent 8bac9eb commit cb882e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
14 changes: 5 additions & 9 deletions checkbox-ng/plainbox/impl/secure/qualifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion checkbox-ng/plainbox/impl/session/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/launcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit cb882e3

Please sign in to comment.