-
Bug
-
Resolution: Unresolved
-
Minor
-
Most versions of pipeline stage view, probably.
If you use try/catch around a stage, the stage can fail and will be shown as a failure and the pipeline will still proceed (correct). Unfortunately the following stages aren't displayed correctly for purposes of pass/fail state.
Sample job that will reproduce this:
try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' }
ALTERNATELY If the build fails overall:
try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } currentBuild.result = 'FAILURE'
Screenshot:
Note that in both cases, the last stage should probably be a passing stage.
This is probably fixable by UI template and/or CSS.
[JENKINS-38793] Try/catch around a stage will show the stage as failing (correct) but following stages also show as red
Attachment | New: Screen Shot 2016-10-06 at 10.57.39 AM.png [ 34276 ] | |
Description |
Original:
If you use try/catch around a stage, the stage can fail and will be shown as a failure and the pipeline will still proceed (correct). Unfortunately the following stages aren't displayed correctly for purposes of pass/fail state. Sample job that will reproduce this: {code:java} try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } {code} ALTERNATELY If the build fails overall: {code:java} try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } currentBuild.result = 'FAILURE' {code} This is probably fixable by UI template and/or CSS. |
New:
If you use try/catch around a stage, the stage can fail and will be shown as a failure and the pipeline will still proceed (correct). Unfortunately the following stages aren't displayed correctly for purposes of pass/fail state. Sample job that will reproduce this: {code:java} try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } {code} ALTERNATELY If the build fails overall: {code:java} try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } currentBuild.result = 'FAILURE' {code} *Screenshot:* !Screen Shot 2016-10-06 at 10.57.39 AM.png|thumbnail! This is probably fixable by UI template and/or CSS. |
Description |
Original:
If you use try/catch around a stage, the stage can fail and will be shown as a failure and the pipeline will still proceed (correct). Unfortunately the following stages aren't displayed correctly for purposes of pass/fail state. Sample job that will reproduce this: {code:java} try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } {code} ALTERNATELY If the build fails overall: {code:java} try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } currentBuild.result = 'FAILURE' {code} *Screenshot:* !Screen Shot 2016-10-06 at 10.57.39 AM.png|thumbnail! This is probably fixable by UI template and/or CSS. |
New:
If you use try/catch around a stage, the stage can fail and will be shown as a failure and the pipeline will still proceed (correct). Unfortunately the following stages aren't displayed correctly for purposes of pass/fail state. Sample job that will reproduce this: {code:java} try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } {code} ALTERNATELY If the build fails overall: {code:java} try { stage('failFirst') { error('Fail') } } catch (Exception ex) { } try { stage('failSecond') { error('Fail') } } catch (Exception ex) { } stage('passOrFail') { echo 'run' } currentBuild.result = 'FAILURE' {code} *Screenshot:* !Screen Shot 2016-10-06 at 10.57.39 AM.png|thumbnail! Note that in both cases, the last stage should probably be a *passing* stage. This is probably fixable by UI template and/or CSS. |
Labels | Original: ux | New: triaged-2018-11 ux |
Assignee | Original: Sam Van Oort [ svanoort ] |