@@ -65,17 +65,38 @@ Warning and error handling
65
65
Each tool will have its own outputs and the standard to consider something
66
66
an error, a warning or something else.
67
67
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.
76
74
* ``warn ``: Indicates that a warning or error non-deemed strict was raised.
77
75
Is collected at the assert job and **does not ** end the run with failure.
78
76
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
+
96
+ The draw back of this approach is that captured/unexpected errors may have a step
97
+ exit with error without set the set_step_fail, causing the step fail to fail through
98
+ and passing the immediate assert step.
99
+
79
100
Checking steps description
80
101
~~~~~~~~~~~~~~~~~~~~~~~~~~
81
102
0 commit comments