Skip to content

Commit a6c01ea

Browse files
committed
docs: ci: Update error handling
About merging err and fail into one for individual step failure. Signed-off-by: Jorge Marques <[email protected]>
1 parent 78e2dfb commit a6c01ea

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

docs/ci.rst

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,34 @@ Warning and error handling
6565
Each tool will have its own outputs and the standard to consider something
6666
an error, a warning or something else.
6767
So the workflows separate the steps outputs into steps events named
68-
``err``, ``fail``, and ``warn``:
69-
70-
* ``err``: What a method that must succeed returns, if not captured
71-
(``|| true``), fails the CI. Internal to the bash methods, return codes
72-
expected to return known warnings and errors are filtered-out, deferring
73-
to the assertion step.
74-
* ``fail``: Indicates that a warning or error deemed strict was raised.
75-
Is collected at the assert job and ends the run with failure.
68+
``fail``, and ``warn``:
69+
70+
* ``fail``: Indicates that a warning or error deemed strict was raised, and
71+
or what the method that must succeed returns. Will fail the step if not
72+
captured (``|| true``). The CI allows some steps to fail, in order to
73+
collect all failures and assert the job at the end.
7674
* ``warn``: Indicates that a warning or error non-deemed strict was raised.
7775
Is collected at the assert job and **does not** end the run with failure.
7876

77+
When ``continue-on-error: true`` is used at the job level, the following
78+
topology rules must be followed based on the immediate downstream step:
79+
80+
* If downstream is an assert job, the ci already fails on ``step_fail_*``, so a
81+
``failure()`` step should just set ``set_step_fail "assert_state"``, as well
82+
the job-scoped ``fatal=true`` environment variable.
83+
* If downstream is an regular job, the job must export an ``fail=$fail`` output,
84+
to be used alongside the ``needs`` rule, for example:
85+
86+
.. code:: yaml
87+
88+
build_gcc_aarch64:
89+
needs: [checks]
90+
if: needs.checks.outputs.fatal != 'true'
91+
92+
These rules ensure that the downstream jobs do not run on fatal errors.
93+
Optional steps may also set ``fatal`` job-scoped environment variable, if taking
94+
care of calling ``set_step_fail``.
95+
7996
Checking steps description
8097
~~~~~~~~~~~~~~~~~~~~~~~~~~
8198

@@ -115,7 +132,7 @@ The checkers are, followed by which step event they raise:
115132
- | ``sparse``: the changed files are touched and recompiled with ``C=1``.
116133
| ``fail``: ``error`` logged
117134
| ``warn``: ``warning`` logged
118-
- | ``ggc fanalyzer``: the changed files are recompiled appending the ``-fanalyzer`` flag.
135+
- | ``gcc fanalyzer``: the changed files are recompiled appending the ``-fanalyzer`` flag.
119136
| It uses the *compile_commands.json* file to extract the correct compilation flags.
120137
| ``fail``: ``error`` or ``warning`` logged
121138
- | ``smatch``: the changed files are touched and recompiled with ``C=1 CHECK="smatch -p=kernel"``.

0 commit comments

Comments
 (0)