Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

qa: return errcode 1 if fontbakery reports a fatal error #800

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Lib/gftools/qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from gftools.gfgithub import GitHubClient
from gftools.utils import mkdir
import sys

try:
from diffenator2 import ninja_diff, ninja_proof
Expand Down Expand Up @@ -114,12 +115,13 @@ def fontbakery(self, profile="googlefonts", html=False, extra_args=None):
+ [f.path for f in self.fonts]
+ ["-C"]
+ ["--ghmarkdown", os.path.join(out, "report.md")]
+ ["-e", "FATAL"]
)
if html:
cmd.extend(["--html", os.path.join(out, "report.html")])
if extra_args:
cmd.extend(extra_args)
subprocess.call(cmd)
process = subprocess.run(cmd)

fontbakery_report = os.path.join(self.out, "Fontbakery", "report.md")
if not os.path.isfile(fontbakery_report):
Expand All @@ -131,6 +133,10 @@ def fontbakery(self, profile="googlefonts", html=False, extra_args=None):
msg = doc.read()
self.post_to_github(msg)

if process.returncode != 0:
logger.fatal("Fontbakery has raised a fatal error. Please fix!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, my goal is to gradually change the threshold in this CI setup. So, instead of saying "raised a fatal error", this could say: "There are check results at the current threshold: FATAL"

And in the future that would become something like:
"There are check results at (or worse than) the current threshold: FAIL severity 10"

sys.exit(1)

def googlefonts_upgrade(self, imgs=False):
self.fontbakery()
self.diffenator()
Expand Down
Loading