jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-56180] unstahing always success even if stash failed

Open
#485 0 comments 0 reactions 0 assignees View on GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
73
Forks
129
PR merge metrics
No merged PRs in 30d

Description

No matter if stash succed or not unstash always pass.

I want to stash file but I dont know if it exists. If file exists everything goes well my_jar is saved and I can unstash it. But... if file doesnt exists it goes to catch() section and I guess that unstash also should go to catch() section but it's not happening. Instead of it  unstash return success (without any files). It means that during stash section "my_jar" label is created and unstash recognize it as stashed file.

 

(NODE1){

try {
stash includes: 'some_jar.jar', name: 'my_jar'
}
catch(e){
println(e.toString())
}
}
.
.
.
(NODE2){
try {
unstash 'my_jar'
}
catch (e) {
println(e.toString())
//DO SOMETING
}

---
Originally reported by tomkoz, imported from: unstahing always success even if stash failed


  • status: Open
  • priority: Major
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251215-220547

Raw content of original issue

No matter if stash succed or not unstash always pass.

I want to stash file but I dont know if it exists. If file exists everything goes well my_jar is saved and I can unstash it. But... if file doesnt exists it goes to catch() section and I guess that unstash also should go to catch() section but it's not happening. Instead of it  unstash return success (without any files). It means that during stash section "my_jar" label is created and unstash recognize it as stashed file.

 



(NODE1){

try {
stash includes: 'some_jar.jar', name: 'my_jar'
}
catch(e){
println(e.toString())
}
}
.
.
.
(NODE2){
try {
unstash 'my_jar'
}
catch (e) {
println(e.toString())
//DO SOMETING
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.