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

Pull "should do checkout?" logic out of Declarative Agents proper

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Relates to JENKINS-41758 - to determine whether we should do a SCM checkout, we need to check Root and SkipDefaultCheckout, both of which are in pipeline-model-definition, so it's hard to make an extension of DeclarativeAgent that just depends on pipeline-model-declarative-agent. That should be fixed.

        Attachments

          Issue Links

            Activity

            Show
            abayer Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/109
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/32dff607141a0a82578c85be8457386df10351a5
            Log:
            [FIXED JENKINS-41900] Expose doCheckout on DeclarativeAgent

            Reduces dependency load for other plugins extending DeclarativeAgent.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/32dff607141a0a82578c85be8457386df10351a5 Log: [FIXED JENKINS-41900] Expose doCheckout on DeclarativeAgent Reduces dependency load for other plugins extending DeclarativeAgent.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/5e21e525e54fe9cabeb86a42a67f590f85e282d3
            Log:
            Followup to JENKINS-41900 - just record if in stage

            There's no actual good reason for carrying the whole context (i.e.,
            Root or Stage object) around in the DeclarativeAgent when all we need
            to know is whether we're already in a stage. So...switch that to a
            boolean and have Agent.groovy check whether the context it's handed is
            a Root instance. If it is a Root instance, we're not in a stage. If it
            isn't a Root instance, we are in a stage. Tada.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/5e21e525e54fe9cabeb86a42a67f590f85e282d3 Log: Followup to JENKINS-41900 - just record if in stage There's no actual good reason for carrying the whole context (i.e., Root or Stage object) around in the DeclarativeAgent when all we need to know is whether we're already in a stage. So...switch that to a boolean and have Agent.groovy check whether the context it's handed is a Root instance. If it is a Root instance, we're not in a stage. If it isn't a Root instance, we are in a stage. Tada.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java
            pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AnyScript.groovy
            pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy
            pipeline-model-definition/src/test/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelAndOtherFieldAgentScript.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/20f8126272bb09467458d1a978e70016cee1026a
            Log:
            Merge pull request #117 from abayer/switch-agent-context-logic

            Followup to JENKINS-41900 - just record if in stage

            Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/afaea38ea3a4...20f8126272bb

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: pipeline-model-declarative-agent/src/main/java/org/jenkinsci/plugins/pipeline/modeldefinition/agent/DeclarativeAgent.java pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/Agent.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AbstractDockerPipelineScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/AnyScript.groovy pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelScript.groovy pipeline-model-definition/src/test/resources/org/jenkinsci/plugins/pipeline/modeldefinition/agent/impl/LabelAndOtherFieldAgentScript.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/20f8126272bb09467458d1a978e70016cee1026a Log: Merge pull request #117 from abayer/switch-agent-context-logic Followup to JENKINS-41900 - just record if in stage Compare: https://github.com/jenkinsci/pipeline-model-definition-plugin/compare/afaea38ea3a4...20f8126272bb

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                abayer Andrew Bayer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: