Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34060

Unstable a build when DSL scripts pattern doesn't list any files

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Let's control the jobdsl status when a script doesn't exist in a particular folder, as it has been intentionally coded in the ticke JENKINS-30541, rather than failing let's keep generating jobs and make the build unstable instead failing the build.

      Further details:
      https://groups.google.com/forum/#!topic/job-dsl-plugin/JkhN523-u4o

        Attachments

          Issue Links

            Activity

            Show
            v2v Victor Martinez added a comment - Initial approach: https://github.com/v1v/job-dsl-plugin/commit/82ef6729855eff4c28c0f8e747193e74f8bb03ff
            Hide
            micahzoltu Micah Zoltu added a comment -

            This solution (marking builds as unstable) won't resolve my issue with JENKINS-30541 because it will result in every build being marked as unstable. I need a way to switch the validation to only require that DSL files were found it at least one folder.

            It is unclear to me why there is a desire to validate that every folder has a DSL file in it, I can't think of a situation where you have multiple glob patterns and every one must have a file in it. It seems to me that if you are using multiple globs the most likely scenario is that you are searching for a DSL rather than specifically loading each DSL.

            That being said, I would be fine with a checkbox to enable/disable this, or switch between "validate that at least one DSL was found" and "validate that all globs resulted in a DSL being found".

            Show
            micahzoltu Micah Zoltu added a comment - This solution (marking builds as unstable) won't resolve my issue with JENKINS-30541 because it will result in every build being marked as unstable. I need a way to switch the validation to only require that DSL files were found it at least one folder. It is unclear to me why there is a desire to validate that every folder has a DSL file in it, I can't think of a situation where you have multiple glob patterns and every one must have a file in it. It seems to me that if you are using multiple globs the most likely scenario is that you are searching for a DSL rather than specifically loading each DSL. That being said, I would be fine with a checkbox to enable/disable this, or switch between "validate that at least one DSL was found" and "validate that all globs resulted in a DSL being found".
            Hide
            chris_hubbard Chris Hubbard added a comment -

            We have a web application that generates DSL files from a database. When there are no entries in the database, then there won't be any groovy files. When a database entry is deleted (and the count goes to zero), the job should be deleted. With JENKINS-30541, now the Job DSL job fails and the generated job doesn't get deleted.

            I would be fine with a checkbox to enable/disable this. I don't want a switch between "validate that at least one DSL was found" and "validate that all globs resulted in a DSL being found" since we can have cases where it is fine that there are no DSL files generated.

            Show
            chris_hubbard Chris Hubbard added a comment - We have a web application that generates DSL files from a database. When there are no entries in the database, then there won't be any groovy files. When a database entry is deleted (and the count goes to zero), the job should be deleted. With JENKINS-30541 , now the Job DSL job fails and the generated job doesn't get deleted. I would be fine with a checkbox to enable/disable this. I don't want a switch between "validate that at least one DSL was found" and "validate that all globs resulted in a DSL being found" since we can have cases where it is fine that there are no DSL files generated.
            Hide
            daspilker Daniel Spilker added a comment -

            Victor Martinez are you still working on a fix?

            Show
            daspilker Daniel Spilker added a comment - Victor Martinez are you still working on a fix?
            Show
            daspilker Daniel Spilker added a comment - PR: https://github.com/jenkinsci/job-dsl-plugin/pull/866
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Daniel Spilker
            Path:
            docs/Home.md
            docs/User-Power-Moves.md
            job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java
            job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ScriptRequestGenerator.groovy
            job-dsl-plugin/src/main/resources/javaposse/jobdsl/plugin/ExecuteDslScripts/config.jelly
            job-dsl-plugin/src/main/resources/javaposse/jobdsl/plugin/ExecuteDslScripts/help-ignoreMissingFiles.html
            job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy
            job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ScriptRequestGeneratorSpec.groovy
            http://jenkins-ci.org/commit/job-dsl-plugin/9c85e7f87c5379bedb53e72f7edd038bb8f0fb16
            Log:
            added option to ignore missing files (#866)

            [FIXES JENKINS-34060]

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md docs/User-Power-Moves.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ExecuteDslScripts.java job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/ScriptRequestGenerator.groovy job-dsl-plugin/src/main/resources/javaposse/jobdsl/plugin/ExecuteDslScripts/config.jelly job-dsl-plugin/src/main/resources/javaposse/jobdsl/plugin/ExecuteDslScripts/help-ignoreMissingFiles.html job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ExecuteDslScriptsSpec.groovy job-dsl-plugin/src/test/groovy/javaposse/jobdsl/plugin/ScriptRequestGeneratorSpec.groovy http://jenkins-ci.org/commit/job-dsl-plugin/9c85e7f87c5379bedb53e72f7edd038bb8f0fb16 Log: added option to ignore missing files (#866) [FIXES JENKINS-34060]

              People

              • Assignee:
                v2v Victor Martinez
                Reporter:
                v2v Victor Martinez
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: