Skip to content

CI: Print original warnings in `fail_on_warnings`

Peter Leitzen requested to merge pl-fail-on-warnings-original into master

What does this MR do and why?

We are seeing flaky jobs due to fail_on_warnings but the printed warnings aren't helpful.

In order to debug them better we also print the original/unfiltered warnings.

Screenshots or screen recordings

header
Screenshot_from_2022-12-26_16-22-16

How to set up and validate locally

  1. Create foo.sh
#!/bin/bash

warn() {
  echo "$*" >&2
}

echo "OK"
warn "Something else"
warn "Type application/netcdf is already registered as a variant of application/netcdf."
warn "Type DIFFERENT is already registered as a variant of application/netcdf."
warn "as long at it matchesType application/netcdf is already registered as a variant of application/netcdf.with a suffix"
warn 'Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`'
warn
warn "**** gitlab:sidekiq:sidekiq_queues_yml:check had the following warning(s):"
warn
warn "A warning"
warn
warn

and then

chmod a+x foo.sh
bash # spawn a subshell
source scripts/utils.sh
fail_on_warnings ./foo.sh

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

See #386693 (closed)

Edited by Lin Jen-Shin

Merge request reports