Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

[BUILD-2881]- buildBlockerProperty #21

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

NatWoodson
Copy link

Ticket

JIRA-2881

Overview

buildblocker attribute is currently labeled as blockOn and as a custom type. Changing buildBlockerProperties to match Job DSL plugin

Testing

Test XML Used:

<project>
    <actions/>
    <description>Test</description>
    <keepDependencies>false</keepDependencies>
    <properties>
        <hudson.plugins.buildblocker.BuildBlockerProperty plugin="build-blocker-plugin@1.7.8">
            <useBuildBlocker>false</useBuildBlocker>
            <blockLevel>UNDEFINED</blockLevel>
            <scanQueueFor>DISABLED</scanQueueFor>
            <blockingJobs/>
        </hudson.plugins.buildblocker.BuildBlockerProperty>
        <org.bstick12.jenkinsci.plugins.leastload.LeastLoadDisabledProperty plugin="leastload@3.0.0">
            <leastLoadDisabled>false</leastLoadDisabled>
        </org.bstick12.jenkinsci.plugins.leastload.LeastLoadDisabledProperty>
        <com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty plugin="naginator@1.18.1">
            <optOut>false</optOut>
        </com.chikli.hudson.plugin.naginator.NaginatorOptOutProperty>
        <hudson.plugins.copyartifact.CopyArtifactPermissionProperty plugin="copyartifact@1.46.4">
            <projectNameList>
                <string>agenda</string>
            </projectNameList>
        </hudson.plugins.copyartifact.CopyArtifactPermissionProperty>
        <hudson.plugins.heavy__job.HeavyJobProperty plugin="heavy-job@1.1">
            <weight>1</weight>
        </hudson.plugins.heavy__job.HeavyJobProperty>
    </properties>
</project>

DSL Output:

job("Test") {
	description("Test")
	keepDependencies(false)
	properties {
		buildBlockerProperty {
			useBuildBlocker(false)
			blockLevel("UNDEFINED")
			scanQueueFor("DISABLED")
			blockingJobs()
		}
		LeastLoadDisabledProperty {
			leastLoadDisabled(false)
		}
		naginatorOptOutProperty {
			optOut(false)
		}
		copyArtifactPermission {
			projectNames("agenda")
		}
		heavyJobProperty {
			weight(1)
		}
	}
}


No untranslated tag! Fit for moving

@@ -25,11 +25,10 @@ flow-definition.description = description

com.tikal.jenkins.plugins.multijob.MultiJobProject.description = description

hudson.plugins.buildblocker.BuildBlockerProperty = blockOn
hudson.plugins.buildblocker.BuildBlockerProperty.type = com.adq.jenkins.xmljobtodsl.dsl.strategies.custom.DSLBlockOnStrategy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the custom type? what does it do?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a custom type, the buildBlockerProperty is currently being skipped over during translation:

description("Test")
	keepDependencies(false)
	properties {
		LeastLoadDisabledProperty {
			leastLoadDisabled(false)
		}
		naginatorOptOutProperty {
			optOut(false)
		}
		heavyJobProperty {
			weight(1)
		}
		throttleConcurrentBuilds()
	}

There is a blockOn property though. Checked these docs and it doesn't seem to be deprecated. Maybe both should be available

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just mean, what is the code in the custom type doing? Do we need to try to preserve that or can we delete those files? is it being used for something else?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom type looks like it's meant to create a similar block under the blockOn property. It gets the following properties by their name: useBuildBlocker, blocking jobs, blockLevel, scanQueueFor and formats them as inner methods and parameters in order to return the DSL. This is the only place the custom type is being used so we may be able to delete, but should we still make sure the blockOn property is supported? Or is useBuildBlocker, which is the dynamic dsl, used in place of that ?

Copy link

@pamgluss-slack pamgluss-slack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm fine with this, we can check later what's up with blockOn

@NatWoodson NatWoodson merged commit 12f78f9 into master Oct 25, 2022
@NatWoodson NatWoodson deleted the BUILD-2881_buildBlockerProperty branch October 25, 2022 22:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants