diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2024-04-19 16:19:00 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2024-04-19 16:19:00 -0400 |
commit | 59855510ff1c414baa792084cd23012d230859cb (patch) | |
tree | 2e025a2b3146cecd47b00b6745252b58bc92c37b | |
parent | a797e4a17bf07e0979063304da87339afbe32f3a (diff) | |
download | b4-59855510ff1c414baa792084cd23012d230859cb.tar.gz |
ez: add preflight-checks-failing show-info output
Have an easy way for scripts to check if a series needs attention before
it is sent out.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | plan.otl | 3 | ||||
-rw-r--r-- | src/b4/ez.py | 14 |
2 files changed, 16 insertions, 1 deletions
@@ -18,6 +18,9 @@ v0.14 [X] Add --check to am/shazam and display checkpatch report [X] Run b4-specific checks automatically (needs-editing, needs-auto-to-cc) [X] Refuse to send if checks haven't been run +[_] Document new features + [_] How to work with series dependencies + [_] How to run pre-flight checks v0.15 ----- diff --git a/src/b4/ez.py b/src/b4/ez.py index e0db327..b53d262 100644 --- a/src/b4/ez.py +++ b/src/b4/ez.py @@ -947,6 +947,8 @@ def check_deps(cmdargs: argparse.Namespace) -> None: logger.info('%s %s', b4.CI_FLAGS_FANCY['fail'], prereq) logger.info(' - %s', info[1]) + store_preflight_check('check-deps') + def get_series_start(usebranch: Optional[str] = None) -> str: if usebranch: @@ -1858,13 +1860,15 @@ def cmd_send(cmdargs: argparse.Namespace) -> None: if not cmdargs.resend: logger.debug('Running pre-flight checks') sinfo = get_info() - if sinfo['needs-editing'] or sinfo['needs-checking'] or sinfo['needs-auto-to-cc']: + if sinfo['preflight-checks-failing']: logger.critical('---') logger.critical('Some pre-flight checks are alerting:') if sinfo['needs-editing']: logger.critical(' - Edit the cover : b4 prep --edit-cover') if sinfo['needs-checking']: logger.critical(' - Run local checks : b4 prep --check') + if sinfo['needs-checking-deps']: + logger.critical(' - Run deps checks : b4 prep --check-deps') if sinfo['needs-auto-to-cc']: logger.critical(' - Run auto-to-cc : b4 prep --auto-to-cc') try: @@ -2419,6 +2423,14 @@ def get_info(usebranch: Optional[str] = None) -> Dict[str, str]: info['needs-auto-to-cc'] = False if (ppcmds or scmds) and 'check' in pf_checks: info['needs-checking'] = False + if info['has-prerequisites']: + info['needs-checking-deps'] = 'check-deps' not in pf_checks + else: + info['needs-checking-deps'] = False + if info['needs-editing'] or info['needs-auto-to-cc'] or info['needs-checking'] or info['needs-checking-deps']: + info['preflight-checks-failing'] = True + else: + info['preflight-checks-failing'] = False info['base-commit'] = base_commit info['start-commit'] = start_commit |