Problem/Motivation
While we want the first stage of tests to help keep core consistent and catch issues with phpstan. There are situations such as architectural issues you would want full tests to run even if phpcs is failing for example.
I would like to suggest that if an MR is in draft then the first stage of tests get a new rule that allows failure.
We would need to ensure that code is not committed from a draft MR as well.
Steps to reproduce
See:
https://www.drupal.org/project/drupal/issues/3525331
https://www.drupal.org/project/drupal/issues/3526388
Neither of those are really in a position to be even in needs review, but it would be valuable to see a full test run even if there is a spelling mistake. This would have the potential to increase resources used by the DA, but we could be cognizant of when an issue uses Draft MRs
Proposed resolution
Rule to allow failure for most jobs in the first column when the MR is in Draft
Remaining tasks
Determine if there is a better way to do this.
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3526516
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mstrelan commentedCould possibly make use of labels on the MR as well
Comment #3
nicxvan commentedI was concerned about how visible those would be for core committers / reviewers, but that might be a viable way too.
Comment #4
nicxvan commentedhttps://www.drupal.org/project/drupal/issues/3515704 may have some examples to pull from.
Comment #5
nicxvan commentedChanges from gitlab ci here: https://git.drupalcode.org/project/drupal/-/merge_requests/11841/diffs
More notes from @mstrelan:
https://forum.gitlab.com/t/how-to-share-artifacts-even-on-job-failure/69393
https://docs.gitlab.com/ci/yaml/#artifactswhen
So we might add this:
allow_failure: true
artifacts when:always
When a certain label is applied or it's a draft.
Comment #6
quietone commentedIt would also be helpful to have a way to only run the linting jobs but not the tests. That would be handy for documentation only issues.
Comment #8
longwaveThere is a CI_MERGE_REQUEST_DRAFT variable we could use for this.
When issues are on GitLab then we can perhaps do more with labels to run less tests in certain situations.
Comment #11
longwaveindex.php is not checked by PHPCS, PHPStan, or CSpell apparently.
Comment #12
longwavePHPCS is responsible for generating the
vendorartifact, and we can force those to upload even on failure, but https://gitlab.com/gitlab-org/gitlab/-/issues/367229 then prevents the downstream jobs from pulling artifacts from the failed job.Comment #13
longwaveAs far as I can see the only way to allow PHPCS to fail is to move
composer installto its own job.#3572572: [ci] Cache vendor so we hit Packagist and GitHub less often might be a possible workaround - we can use the vendor cache instead - postponing on that.