Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ceasing to test against non-block-scoped stage #2385

Merged
merged 15 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Ceasing to test against non-block-scoped stage
  • Loading branch information
jglick committed Jan 18, 2023
commit e83ca5ab386619861baba3635a1984102edbb070
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node {
stage 'test'
checkout scm
echo 'test'
stage('test') {
checkout scm
echo 'test'
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
node {
stage 'Stage 1 - scm'
echo 'Stage 1 - scm'
stage('Stage 1 - scm') {
echo 'Stage 1 - scm'

//
// Need a small wait here so as not to hit JENKINS-36408.
// Without it, the build run SSE end events *can* arrive at the client
// before the it has finished processing the earlier events, which means
// the end events are meaningless to it (no proper context until earlier
// events are processed), causing the UI state for that run to end up in
// limbo state - constant spinning orb etc requiring a page reload to fix.
//
sleep 2
//
// Need a small wait here so as not to hit JENKINS-36408.
// Without it, the build run SSE end events *can* arrive at the client
// before the it has finished processing the earlier events, which means
// the end events are meaningless to it (no proper context until earlier
// events are processed), causing the UI state for that run to end up in
// limbo state - constant spinning orb etc requiring a page reload to fix.
//
sleep 2


checkout scm
stage 'Stage test'
echo 'stuff'
sh 'touch TEST-*.xml'
step([$class: 'JUnitResultArchiver', testResults: 'TEST-*.xml'])
checkout scm
}
stage('Stage test') {
echo 'stuff'
sh 'touch TEST-*.xml'
step([$class: 'JUnitResultArchiver', testResults: 'TEST-*.xml'])
}

}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
node {
stage "hey"
sh "echo yeah"
stage("hey") {
sh "echo yeah"
}

stage "parallel"
stage("parallel") {

parallel firstBranch: {
sh 'echo `date` Stage 2 - firstBranch www.spiegel.de'
sh 'ping -c 4 -i 3 www.spiegel.de || true'
parallel firstBranch: {
sh 'echo `date` Stage 2 - firstBranch www.spiegel.de'
sh 'ping -c 4 -i 3 www.spiegel.de || true'

}, secondBranch: {
sh 'echo `date` Stage 2 - secondBranch www.stern.de'
sh 'ping -c 6 -i 2 www.stern.de || true'
}, secondBranch: {
sh 'echo `date` Stage 2 - secondBranch www.stern.de'
sh 'ping -c 6 -i 2 www.stern.de || true'
}
}

stage "ho"
sh "echo done"
stage("ho") {
sh "echo done"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ node {
sh 'echo yeah > foo.txt'
archiveArtifacts 'foo.txt'
}
stage 'NoSteps'
stage('NoSteps') {}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
node {
stage 'Stage 1'
sh 'sleep 6; echo `date` Stage 1a we need some time here for slower ath hosts;'
sh 'sleep 6; echo `date` Stage 1b;'
stage 'Stage 2'
parallel firstBranch: {
sh 'echo `date` Stage 2 - first;sleep 3; echo `date` Stage 2 - first;sleep 5; echo `date` Stage 2 - first;'
stage('Stage 1') {
sh 'sleep 6; echo `date` Stage 1a we need some time here for slower ath hosts;'
sh 'sleep 6; echo `date` Stage 1b;'
}
stage('Stage 2') {
parallel firstBranch: {
sh 'echo `date` Stage 2 - first;sleep 3; echo `date` Stage 2 - first;sleep 5; echo `date` Stage 2 - first;'

}, secondBranch: {
sh 'echo `date` Stage 2 - second;sleep 3; echo `date` Stage 2 - second;sleep 5; echo `date` Stage 2 - second;'
},
failFast: true
stage 'fin'
sh 'echo `date` fin;sleep 6; echo `date` fin;'
sh 'echo yeah > foo.txt'
archiveArtifacts 'foo.txt'
stage 'NoSteps'
}, secondBranch: {
sh 'echo `date` Stage 2 - second;sleep 3; echo `date` Stage 2 - second;sleep 5; echo `date` Stage 2 - second;'
},
failFast: true
}
stage('fin') {
sh 'echo `date` fin;sleep 6; echo `date` fin;'
sh 'echo yeah > foo.txt'
archiveArtifacts 'foo.txt'
}
stage('NoSteps') {}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
node {
stage 'Stage 1'
echo 'Hello World 1'
stage 'Stage 2'
echo 'Hello World 2'
stage 'Stage 3'
echo 'Hello World 3'
}
stage('Stage 1') {
echo 'Hello World 1'
}
stage('Stage 2') {
echo 'Hello World 2'
}
stage('Stage 3') {
echo 'Hello World 3'
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
node {
stage 'Stage 1 - scm'
echo 'Stage 1 - scm'
stage('Stage 1 - scm') {
echo 'Stage 1 - scm'

//
// Need a small wait here so as not to hit JENKINS-36408.
// Without it, the build run SSE end events *can* arrive at the client
// before the it has finished processing the earlier events, which means
// the end events are meaningless to it (no proper context until earlier
// events are processed), causing the UI state for that run to end up in
// limbo state - constant spinning orb etc requiring a page reload to fix.
//
sleep 2
//
// Need a small wait here so as not to hit JENKINS-36408.
// Without it, the build run SSE end events *can* arrive at the client
// before the it has finished processing the earlier events, which means
// the end events are meaningless to it (no proper context until earlier
// events are processed), causing the UI state for that run to end up in
// limbo state - constant spinning orb etc requiring a page reload to fix.
//
sleep 2


checkout scm
stage 'Stage test'
echo 'stuff'
sh 'touch TEST-*.xml'
step([$class: 'JUnitResultArchiver', testResults: 'TEST-*.xml'])
checkout scm
}
stage('Stage test') {
echo 'stuff'
sh 'touch TEST-*.xml'
step([$class: 'JUnitResultArchiver', testResults: 'TEST-*.xml'])
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node {
stage 'test'
checkout scm
echo 'test'
stage('test') {
checkout scm
echo 'test'
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
node {
stage "hey"
sh "echo yeah"
stage("hey") {
sh "echo yeah"
}

stage "parallel"
stage("parallel") {

parallel firstBranch: {
sh 'echo `date` Stage 2 - firstBranch www.spiegel.de'
sh 'ping -c 4 -i 3 www.spiegel.de || true'
parallel firstBranch: {
sh 'echo `date` Stage 2 - firstBranch www.spiegel.de'
sh 'ping -c 4 -i 3 www.spiegel.de || true'

}, secondBranch: {
sh 'echo `date` Stage 2 - secondBranch www.stern.de'
sh 'ping -c 6 -i 2 www.stern.de || true'
}, secondBranch: {
sh 'echo `date` Stage 2 - secondBranch www.stern.de'
sh 'ping -c 6 -i 2 www.stern.de || true'
}
}

stage "ho"
sh "echo done"
stage("ho") {
sh "echo done"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ node {
sh 'echo yeah > foo.txt'
archiveArtifacts 'foo.txt'
}
stage 'NoSteps'
stage('NoSteps') {}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
node {
stage 'Stage 1'
sh 'sleep 6; echo `date` Stage 1a we need some time here for slower ath hosts;'
sh 'sleep 6; echo `date` Stage 1b;'
stage 'Stage 2'
parallel firstBranch: {
sh 'echo `date` Stage 2 - first;sleep 3; echo `date` Stage 2 - first;sleep 5; echo `date` Stage 2 - first;'
stage('Stage 1') {
sh 'sleep 6; echo `date` Stage 1a we need some time here for slower ath hosts;'
sh 'sleep 6; echo `date` Stage 1b;'
}
stage('Stage 2') {
parallel firstBranch: {
sh 'echo `date` Stage 2 - first;sleep 3; echo `date` Stage 2 - first;sleep 5; echo `date` Stage 2 - first;'

}, secondBranch: {
sh 'echo `date` Stage 2 - second;sleep 3; echo `date` Stage 2 - second;sleep 5; echo `date` Stage 2 - second;'
},
failFast: true
stage 'fin'
sh 'echo `date` fin;sleep 6; echo `date` fin;'
sh 'echo yeah > foo.txt'
archiveArtifacts 'foo.txt'
stage 'NoSteps'
}, secondBranch: {
sh 'echo `date` Stage 2 - second;sleep 3; echo `date` Stage 2 - second;sleep 5; echo `date` Stage 2 - second;'
},
failFast: true
}
stage('fin') {
sh 'echo `date` fin;sleep 6; echo `date` fin;'
sh 'echo yeah > foo.txt'
archiveArtifacts 'foo.txt'
}
stage('NoSteps') {}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
node {
stage 'Stage 1'
echo 'Hello World 1'
stage 'Stage 2'
echo 'Hello World 2'
stage 'Stage 3'
echo 'Hello World 3'
}
stage('Stage 1') {
echo 'Hello World 1'
}
stage('Stage 2') {
echo 'Hello World 2'
}
stage('Stage 3') {
echo 'Hello World 3'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ export function convertJenkinsNodeGraph(jenkinsGraph, isCompleted, skewMillis) {

Object.keys(convertedNodeForId).map((key, index) => {
//Check if this stage contains sequential stages and if so, replace it with the first one in the sequence
// (TODO this logic can probably be deleted now)
if (originalNodeForId[key].firstParent === branchNode.id) {
for (var i = 0; i < currentNode.children.length; i++) {
if (currentNode.children[i].id === branchNode.id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,9 @@ private String createMbp(User user) throws UnirestException {
private void setupScm() throws Exception {
// create git repo
sampleRepo.init();
sampleRepo.write("Jenkinsfile", "stage 'build'\n "+"node {echo 'Building'}\n"+
"stage 'test'\nnode { echo 'Testing'}\n"+
"stage 'deploy'\nnode { echo 'Deploying'}\n"
sampleRepo.write("Jenkinsfile", "stage('build') {\n "+"node {echo 'Building'}}\n"+
"stage('test') {\nnode { echo 'Testing'}}\n"+
"stage('deploy') {\nnode { echo 'Deploying'}}\n"
);
sampleRepo.write("file", "initial content");
sampleRepo.git("add", "Jenkinsfile");
Expand All @@ -540,12 +540,12 @@ private void setupScm() throws Exception {
//create feature branch
sampleRepo.git("checkout", "-b", "feature/ux-1");
sampleRepo.write("Jenkinsfile", "echo \"branch=${env.BRANCH_NAME}\"; "+"node {" +
" stage ('Build'); " +
" echo ('Building'); " +
" stage ('Test'); " +
" echo ('Testing'); " +
" stage ('Deploy'); " +
" echo ('Deploying'); " +
" stage ('Build') { " +
" echo ('Building');} " +
" stage ('Test') { " +
" echo ('Testing');} " +
" stage ('Deploy'){ " +
" echo ('Deploying');} " +
"}");
ScriptApproval.get().approveSignature("method java.lang.String toUpperCase");
sampleRepo.write("file", "subsequent content1");
Expand Down
1 change: 1 addition & 0 deletions blueocean-pipeline-api-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>pipeline-stage-step</artifactId>
<!-- TODO https://github.com/jenkinsci/pipeline-stage-step-plugin/pull/94 -->
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ private void assertURL(String expected, String actual) throws IOException {
public void setupScm() throws Exception {
// create git repo
sampleRepo.init();
sampleRepo.write("Jenkinsfile", "stage 'build'\n "+"node {echo 'Building'}\n"+
"stage 'test'\nnode { echo 'Testing'}\n"+
"stage 'deploy'\nnode { echo 'Deploying'}\n"
sampleRepo.write("Jenkinsfile", "stage('build') {\n "+"node {echo 'Building'}}\n"+
"stage('test') {\nnode { echo 'Testing'}}\n"+
"stage('deploy') {\nnode { echo 'Deploying'}}\n"
);
sampleRepo.write("file", "initial content");
sampleRepo.git("add", "Jenkinsfile");
Expand All @@ -129,12 +129,12 @@ public void setupScm() throws Exception {
//create feature branch
sampleRepo.git("checkout", "-b", "feature/ux-1");
sampleRepo.write("Jenkinsfile", "echo \"branch=${env.BRANCH_NAME}\"; "+"node {" +
" stage ('Build'); " +
" echo ('Building'); " +
" stage ('Test'); " +
" echo ('Testing'); " +
" stage ('Deploy'); " +
" echo ('Deploying'); " +
" stage ('Build') { " +
" echo ('Building');} " +
" stage ('Test') { " +
" echo ('Testing');} " +
" stage ('Deploy') { " +
" echo ('Deploying');} " +
"}");
ScriptApproval.get().approveSignature("method java.lang.String toUpperCase");
sampleRepo.write("file", "subsequent content1");
Expand All @@ -143,12 +143,12 @@ public void setupScm() throws Exception {
//create feature branch
sampleRepo.git("checkout", "-b", "feature2");
sampleRepo.write("Jenkinsfile", "echo \"branch=${env.BRANCH_NAME}\"; "+"node {" +
" stage ('Build'); " +
" echo ('Building'); " +
" stage ('Test'); " +
" echo ('Testing'); " +
" stage ('Deploy'); " +
" echo ('Deploying'); " +
" stage ('Build') { " +
" echo ('Building');} " +
" stage ('Test') { " +
" echo ('Testing');} " +
" stage ('Deploy') { " +
" echo ('Deploying');} " +
"}");
ScriptApproval.get().approveSignature("method java.lang.String toUpperCase");
sampleRepo.write("file", "subsequent content2");
Expand Down
Loading