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

Add Swarm Plugin support to PCT #188

Merged
merged 2 commits into from
Sep 12, 2019
Merged

Conversation

basil
Copy link
Member

@basil basil commented Sep 11, 2019

Adding Swarm support to PCT following the existing examples for Pipeline: Delarative, Pipeline: REST API, and Structs.

First, I added a new SwarmHook class with the details of the Swarm plugin's structure. Then, I updated MultiParentCompileHook and TransformPom to add references to SwarmHook following the existing examples.

I added an integration test in src/it/war-with-plugins-test/packager-config.yml, but I'm not sure how to run it. I tested PCT against Swarm locally in the BOM project before and after this change. Before, it failed; after, it passed.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

LGTM. The comments are rather a subject for the future improvement

@@ -85,7 +85,7 @@ public void validate(Map<String, Object> toCheck) throws Exception {
@Override
public boolean check(Map<String, Object> info) throws Exception {
return BlueOceanHook.isBOPlugin(info) || DeclarativePipelineHook.isDPPlugin(info) || StructsHook.isStructsPlugin(info) ||
ConfigurationAsCodeHook.isCascPlugin(info) || PipelineRestApiHook.isPipelineStageViewPlugin(info);
SwarmHook.isSwarmPlugin(info) || ConfigurationAsCodeHook.isCascPlugin(info) || PipelineRestApiHook.isPipelineStageViewPlugin(info);
Copy link
Member

Choose a reason for hiding this comment

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

We should finally rewrite the hook engine at some point to an extension-alike approach.
This line makes me cry :D

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, this would be a good area for future improvement.

@@ -58,7 +59,7 @@ public boolean check(Map<String, Object> info) {
boolean coreRequiresNewParentPOM = coreCoordinates.compareVersionTo(CORE_NEW_PARENT_POM) >= 0;
boolean coreRequiresPluginOver233 = coreCoordinates.compareVersionTo(CORE_WITHOUT_WAR_FOR_TEST) >= 0;

if (isDeclarativePipeline || isBO || isCB || isStructs || isCasC || isPipelineStageViewPlugin || (pluginPOM && parentV2)) {
if (isDeclarativePipeline || isBO || isCB || isStructs || isCasC || isPipelineStageViewPlugin || isSwarm || (pluginPOM && parentV2)) {
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@oleg-nenashev oleg-nenashev changed the title Add Swarm support to PCT Add Swarm Plugin support to PCT Sep 12, 2019
@oleg-nenashev oleg-nenashev merged commit 61b1704 into jenkinsci:master Sep 12, 2019
@oleg-nenashev
Copy link
Member

Thanks @basil !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants