Closed NeillM closed 8 months ago
The same happens if I deliberately add a coding style failure into the code base.
I'm guessing it is possible that other parts could also have failures such as the unit or behat tests and then they would not cause a change in the status of the overall job.
Although having looks at my config again just now, I'm wondering if that is my own fault for adding success twice in the commands.
Yes that sounds like it's because of the configuration. If you add explicit statuses they override the actual stage result and build result. (That was implemented as it's often useful to run some of the code checking stuff to see the results but only fail the build if actual tests fail, or whatever.)
I can confirm that if I change the setup to:
pipeline {
agent {label 'testing'}
options {
checkoutToSubdirectory('files/converter/onedrive')
disableConcurrentBuilds()
}
stages {
stage("Plugin CI") {
steps {
withMoodlePluginCiContainer(php: '8.1', db: 'mysql') {
moodlePluginCiInstall("--branch MOODLE_401_STABLE --plugin ./files/converter/onedrive")
moodlePluginCi 'phplint'
moodlePluginCi 'phpcpd', 'UNSTABLE', 'FAILURE'
moodlePluginCi 'phpmd', 'UNSTABLE', 'FAILURE'
moodlePluginCi 'codechecker --max-warnings 0', 'UNSTABLE', 'FAILURE'
moodlePluginCi 'phpdoc', 'UNSTABLE', 'FAILURE'
moodlePluginCi 'validate', 'UNSTABLE', 'FAILURE'
moodlePluginCi 'savepoints', 'UNSTABLE', 'FAILURE'
moodlePluginCi 'mustache', 'UNSTABLE', 'FAILURE'
moodlePluginCi 'grunt --max-lint-warnings 0', 'UNSTABLE', 'FAILURE'
moodlePluginCi 'phpunit'
}
}
}
}
}
Then the overall job will show up as unstable (i.e. warning yellow) when the liniting has either an error or a warning, while still running all the other stages in the job. Which is what I would want.
So it was defiantly a me issue.
In a job configured like:
The linting stage had two warnings in it
However the overall status of the job was a pass, I would expect it to show up in the warning state.