Inform jobs about the "composer" job exit status and bail out early
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3471235. -->
Reported by: [grimreaper](https://www.drupal.org/user/2388214)
Related to !254
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p><del>The <code>phpstan (next major)</code> job is failing due to a curl error: <code>curl: (23) Failure writing output to destination</code> when trying to obtain the phpstan.neon of the sobki_profile_bootstrap repository.</del></p>
<p><del>Examples of failure:</del></p>
<p><del><a href="https://git.drupalcode.org/project/sobki_profile_bootstrap/-/jobs/2601438">https://git.drupalcode.org/project/sobki_profile_bootstrap/-/jobs/2601438</a></del><br>
<del><a href="https://git.drupalcode.org/project/sobki_profile_bootstrap/-/jobs/2602278">https://git.drupalcode.org/project/sobki_profile_bootstrap/-/jobs/2602278</a></del></p>
<p>The "next major" variant has "allow_failure" even in the "composer" job. Note that if this fails, but we allow failure, the other jobs will try to run and might report some errors which are hard to debug, but due to the previous fail.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Write a variable at the end of the composer job to the env file and check that variable and its value before running any logic for dependant jobs, and if there was an error, then bail out early and inform the users accordingly.</p>
<h3 id="testing">Testing</h3>
<p>To test this MR in your .gitlab-ci.yml file use the following values:</p>
<pre>include:<br> # MR 254 Detect composer failures and halt other jobs.<br> - project: issue/gitlab_templates-3471235<br> ref: 3471235-dependencies</pre><p>
and also</p>
<pre>variables:<br> _CURL_TEMPLATES_REPO: issue/gitlab_templates-3471235<br> _CURL_TEMPLATES_REF: 3471235-dependencies</pre><p>
See the <a href="https://project.pages.drupalcode.org/gitlab_templates/info/testing-mrs/">documentation page</a> for a full explanation</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
issue