From d7ca8e96342a7810bfc56400d6bf1555a3747334 Mon Sep 17 00:00:00 2001 From: Robert Rosca <robert.rosca@xfel.eu> Date: Mon, 22 Feb 2021 18:52:24 +0100 Subject: [PATCH] Add notes on skipping checks, set to allow failure true, break import order again --- .gitlab-ci.yml | 1 + README.rst | 15 +++++++++++++++ webservice/serve_overview.py | 5 ++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5411680f6..04d8c2ef1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ stages: checks: stage: check only: [merge_requests] + allow_failure: true script: - export PATH=/home/gitlab-runner/.local/bin:$PATH # We'd like to run the pre-commit hooks only on files that are being diff --git a/README.rst b/README.rst index 8064819d4..08a185db2 100644 --- a/README.rst +++ b/README.rst @@ -170,6 +170,21 @@ files then you should **rebase onto the target branch** to prevent the checks from running on the wrong files/diffs. +Skipping Checks +--------------- + +If the checks are failing and you want to ignore them on purpose then you have two options: + +- use the ``--no-verify`` flag on your ``git commit`` command to skip them, e.g. ``git commit -m "Commit skipping hooks" --no-verify`` +- use the variable ``SKIP=hooks,to,skip`` before the git commit command to list hooks to skip, e.g. ``SKIP=flake8,isort git commit -m "Commit skipping only flake8 and isort hooks"`` + +In the CI pipeline the pre-commit check stage has ``allow_failure: true`` set so +that it is possible to ignore errors in the checks, and so that subsequent +stages will still run even if the checks have failed. However there should be a +good reason for allowing the checks to fail, e.g. checks failing due to +unmodified sections of code being looked at. + + Python Scripted Calibration *************************** diff --git a/webservice/serve_overview.py b/webservice/serve_overview.py index b8c6c5593..347539f60 100644 --- a/webservice/serve_overview.py +++ b/webservice/serve_overview.py @@ -6,14 +6,13 @@ from collections import OrderedDict from datetime import datetime, timezone from http.server import BaseHTTPRequestHandler, HTTPServer from subprocess import check_output +from xfel_calibrate.settings import (free_nodes_cmd, preempt_nodes_cmd, + reservation) from uuid import uuid4 import yaml from jinja2 import Template -from xfel_calibrate.settings import (free_nodes_cmd, preempt_nodes_cmd, - reservation) - class LimitedSizeDict(OrderedDict): def __init__(self, *args, **kwds): -- GitLab