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

Make the configuration independent from SCM #401

Open
SunBlack opened this issue Sep 4, 2024 · 0 comments
Open

Make the configuration independent from SCM #401

SunBlack opened this issue Sep 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@SunBlack
Copy link

SunBlack commented Sep 4, 2024

What feature do you want to see added?

I tried to simplify our Jenkinsfile from sth. like this (already simplified):

pipeline {
  agent {
    label 'built-in'
  }
  
  options {
    skipDefaultCheckout()
  }

  stages {
    stage('Build') {
      parallel {
        stage('Windows') {
          stages {
            stage('msvc2017') {
              steps {
                publishChecks(name: 'MSVC 2017', status: 'IN_PROGRESS', summary: 'running')
                build job: 'msvc2017'
              }
              post {
                success {
                  publishChecks(name: 'MSVC 2017', status: 'COMPLETED', summary: 'success', conclusion: 'SUCCESS')
                }
                failure {
                  publishChecks(name: 'MSVC 2017', status: 'COMPLETED', summary: 'failed', conclusion: 'FAILURE')
                }
                unstable {
                  publishChecks(name: 'MSVC 2017', status: 'COMPLETED', summary: 'unstable', conclusion: 'FAILURE')
                }
                aborted {
                  publishChecks(name: 'MSVC 2017', status: 'COMPLETED', summary: 'canceled', conclusion: 'CANCELED')
                }
              }
            }
            stage('msvc2022') {
              when { 
                branch 'main' 
              }
              steps {
                publishChecks(name: 'MSVC 2022', status: 'IN_PROGRESS', summary: 'running')
                build job: 'msvc2022'
              }
              post {
                success {
                  publishChecks(name: 'MSVC 2022', status: 'COMPLETED', summary: 'success', conclusion: 'SUCCESS')
                }
                failure {
                  publishChecks(name: 'MSVC 2022', status: 'COMPLETED', summary: 'failed', conclusion: 'FAILURE')
                }
                unstable {
                  publishChecks(name: 'MSVC 2022', status: 'COMPLETED', summary: 'unstable', conclusion: 'FAILURE')
                }
                aborted {
                  publishChecks(name: 'MSVC 2022', status: 'COMPLETED', summary: 'canceled', conclusion: 'CANCELED')
                }
              }
            }
          }
        }
        stage('Linux') {
          stages {
            stage('clang') {
              when { 
                branch 'dev' 
              }
              steps {
                publishChecks(name: 'clang', status: 'IN_PROGRESS', summary: 'running')
                build job: 'clang'
              }
              post {
                success {
                  publishChecks(name: 'clang', status: 'COMPLETED', summary: 'success', conclusion: 'SUCCESS')
                }
                failure {
                  publishChecks(name: 'clang', status: 'COMPLETED', summary: 'failed', conclusion: 'FAILURE')
                }
                unstable {
                  publishChecks(name: 'clang', status: 'COMPLETED', summary: 'unstable', conclusion: 'FAILURE')
                }
                aborted {
                  publishChecks(name: 'clang', status: 'COMPLETED', summary: 'canceled', conclusion: 'CANCELED')
                }
              }
            }
            stage('gcc') {
              steps {
                publishChecks(name: 'gcc', status: 'IN_PROGRESS', summary: 'running')
                build job: 'gcc'
              }
              post {
                success {
                  publishChecks(name: 'gcc', status: 'COMPLETED', summary: 'success', conclusion: 'SUCCESS')
                }
                failure {
                  publishChecks(name: 'gcc', status: 'COMPLETED', summary: 'failed', conclusion: 'FAILURE')
                }
                unstable {
                  publishChecks(name: 'gcc', status: 'COMPLETED', summary: 'unstable', conclusion: 'FAILURE')
                }
                aborted {
                  publishChecks(name: 'gcc', status: 'COMPLETED', summary: 'canceled', conclusion: 'CANCELED')
                }
              }
            }
          }
        }
      }
    }
  }
}

To:

pipeline {
  agent {
    label 'built-in'
  }
  
  options {
    skipDefaultCheckout()
  }

  stages {
    stage('Build') {
      parallel {
        stage('Windows') {
          stages {
            stage('msvc2017') {
              steps {
                withChecks('MSVC 2017') {
                  build job: 'msvc2017'
                }
              }
            }
            stage('msvc2022') {
              when { 
                branch 'main' 
              }
              steps {
                withChecks('MSVC 2022') {
                  build job: 'msvc2022'
                }
              }
            }
          }
        }
        stage('Linux') {
          stages {
            stage('clang') {
              when { 
                branch 'dev' 
              }
              steps {
                withChecks('clang') {
                  build job: 'clang'
                }
              }
            }
            stage('gcc') {
              steps {
                withChecks('gcc') {
                  build job: 'gcc'
                }
              }
            }
          }
        }
      }
    }
  }
}

But somehow GitHub sees that the jobs are starting and even get notification in case of an error, but never a success state. So I wanted to check whether Verbose Console log could help - but this configuration depends on the checkout step, which we were skipping in our case.

So it would be nice, when there is another way to enable debug log - maybe as pipeline option (not sure whether Skip GitHub Branch Source could also be independent of the checkout).

Upstream changes

No response

Are you interested in contributing this feature?

No response

@SunBlack SunBlack added the enhancement New feature or request label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant