hudson.matrix.MatrixProject Java Examples

The following examples show how to use hudson.matrix.MatrixProject. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GitLabEnvironmentContributorTest.java    From gitlab-plugin with GNU General Public License v2.0 6 votes vote down vote up
@Test
public void matrixProjectTest() throws IOException, InterruptedException, ExecutionException {
    EnvVars env;
    MatrixProject p = jenkins.jenkins.createProject(MatrixProject.class, "matrixbuild");
    GitLabWebHookCause cause = new GitLabWebHookCause(generateCauseData());
    // set up 2x2 matrix
    AxisList axes = new AxisList();
    axes.add(new TextAxis("db","mysql","oracle"));
    axes.add(new TextAxis("direction","north","south"));
    p.setAxes(axes);

    MatrixBuild build = p.scheduleBuild2(0, cause).get();
    List<MatrixRun> runs = build.getRuns();
    assertEquals(4,runs.size());
    for (MatrixRun run : runs) {
        env = run.getEnvironment(listener);
        assertNotNull(env.get("db"));
        assertEnv(env);
    }
}
 
Example #2
Source File: JUnitResultArchiverTest.java    From junit-plugin with MIT License 6 votes vote down vote up
@Test public void specialCharsInRelativePath() throws Exception {
    Assume.assumeFalse(Functions.isWindows());
    final String ID_PREFIX = "test-../a=%3C%7C%23)/testReport/org.twia.vendor/VendorManagerTest/testCreateAdjustingFirm/";
    final String EXPECTED = "org.twia.dao.DAOException: [S2001] Hibernate encountered an error updating Claim [null]";

    MatrixProject p = j.jenkins.createProject(MatrixProject.class, "test-" + j.jenkins.getItems().size());
    p.setAxes(new AxisList(new TextAxis("a", "<|#)")));
    p.setScm(new SingleFileSCM("report.xml", getClass().getResource("junit-report-20090516.xml")));
    p.getPublishersList().add(new JUnitResultArchiver("report.xml"));

    MatrixBuild b = p.scheduleBuild2(0).get();
    j.assertBuildStatus(Result.UNSTABLE, b);

    WebClient wc = j.createWebClient();
    HtmlPage page = wc.getPage(b, "testReport");

    assertThat(page.asText(), not(containsString(EXPECTED)));

    ((HtmlAnchor) page.getElementById(ID_PREFIX + "-showlink")).click();
    wc.waitForBackgroundJavaScript(10000L);
    assertThat(page.asText(), containsString(EXPECTED));

    ((HtmlAnchor) page.getElementById(ID_PREFIX + "-hidelink")).click();
    wc.waitForBackgroundJavaScript(10000L);
    assertThat(page.asText(), not(containsString(EXPECTED)));
}
 
Example #3
Source File: PipelineApiTest.java    From blueocean-plugin with MIT License 6 votes vote down vote up
@Test
public void matrixProjectTest() throws Exception{
    MatrixProject mp = j.jenkins.createProject(MatrixProject.class, "mp1");
    mp.getAxes().add(new Axis("os", "linux", "windows"));
    mp.getAxes().add(new Axis("jdk", "1.7", "1.8"));

    MatrixBuild matrixBuild = mp.scheduleBuild2(0).get();
    j.assertBuildStatusSuccess(matrixBuild);

    List<Map> pipelines = get("/search/?q=type:pipeline;excludedFromFlattening:jenkins.branch.MultiBranchProject,hudson.matrix.MatrixProject", List.class);
    Assert.assertEquals(1, pipelines.size());

    Map p = pipelines.get(0);

    Assert.assertEquals("mp1", p.get("name"));

    String href = getHrefFromLinks(p, "self");

    Assert.assertEquals("/job/mp1/", href);
}
 
Example #4
Source File: JobsTest.java    From jenkins-client-java with MIT License 5 votes vote down vote up
@Test
public void buildWithParams() throws Exception {
    MatrixProject project = j.createProject(MatrixProject.class);

    final String name = "NAME";
    project.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition(name, "")));

    project.getBuildersList().add(new Shell("echo env." + name));

    final Map<String, String> params = Collections.singletonMap(name, System.currentTimeMillis() + "-hello");
    jobs.buildWithParams(project.getName(), params);
    j.waitUntilNoActivity();
    assertEquals(1, project.getBuilds().size());
    assertThat(project.getBuild("1").getLog(), containsString(params.get(name)));
}
 
Example #5
Source File: TemplateUtils.java    From ez-templates with Apache License 2.0 5 votes vote down vote up
/**
 * Inlined from {@link MatrixProject#setAxes(hudson.matrix.AxisList)} except it doesn't call save.
 *
 * @param matrixProject The project to set the Axis on.
 * @param axisList      The Axis list to set.
 */
private static void fixAxisList(MatrixProject matrixProject, AxisList axisList) {
    if (axisList == null) {
        return; //The "axes" field can never be null. So just to be extra careful.
    }
    ReflectionUtils.setFieldValue(MatrixProject.class, matrixProject, "axes", axisList);

    //noinspection unchecked
    ReflectionUtils.invokeMethod(MatrixProject.class, matrixProject, "rebuildConfigurations", ReflectionUtils.MethodParameter.get(MatrixBuild.MatrixBuildExecution.class, null));
}
 
Example #6
Source File: MatrixBranchProjectFactory.java    From multi-branch-project-plugin with MIT License 5 votes vote down vote up
@Override
public MatrixProject decorate(MatrixProject project) {
    if (!isProject(project)) {
        return project;
    }

    if (!(getOwner() instanceof MatrixMultiBranchProject)) {
        throw new IllegalStateException(String.format("%s can only be used with %s.",
                MatrixBranchProjectFactory.class.getSimpleName(),
                MatrixMultiBranchProject.class.getSimpleName()));
    }

    MatrixMultiBranchProject owner = (MatrixMultiBranchProject) getOwner();

    BulkChange bc = new BulkChange(project);
    try {
        project = super.decorate(project);

        // Workaround for JENKINS-21017
        if (owner.getTemplate().hasChildCustomWorkspace()) {
            project.setChildCustomWorkspace(owner.getTemplate().getChildCustomWorkspace());
        } else {
            project.setChildCustomWorkspace(null);
        }

        bc.commit();
    } catch (IOException e) {
        LOGGER.log(Level.WARNING, "Unable to update project " + project.getName(), e);
    } finally {
        bc.abort();
    }

    return project;
}
 
Example #7
Source File: MatrixBranchProjectFactory.java    From multi-branch-project-plugin with MIT License 5 votes vote down vote up
@Override
public boolean isProject(Item item) {
    /*
     * Can't check ((MatrixProject) item).getProperty(BranchProjectProperty.class) != null because it is possible
     * for user to configure item directly and accidentally remove the property.
     */
    return item instanceof MatrixProject;
}
 
Example #8
Source File: MatrixProjectITest.java    From github-integration-plugin with MIT License 5 votes vote down vote up
@Test
public void testChildStatuses() throws Exception {
    final MatrixProject matrixProject = jRule.jenkins.createProject(MatrixProject.class, "matrix-project");

    matrixProject.addProperty(getPreconfiguredProperty(ghRule.getGhRepo()));
    matrixProject.addTrigger(getPreconfiguredPRTrigger());

    matrixProject.getBuildersList().add(new GitHubPRStatusBuilder());
    matrixProject.getBuildersList().add(new Shell("sleep 10"));

    matrixProject.getPublishersList().add(new GitHubPRBuildStatusPublisher());
    matrixProject.getPublishersList().add(new GitHubPRCommentPublisher(new GitHubPRMessage("Comment"), null, null));

    matrixProject.setAxes(
            new AxisList(
                    new TextAxis("first_axis", "first_value1", "first_value2"),
                    new TextAxis("second_axis", "sec_value1", "sec_value2")
            )
    );

    matrixProject.save();

    super.basicTest(matrixProject);

    for (MatrixBuild build : matrixProject.getBuilds()) {
        for (MatrixRun matrixRun : build.getRuns()) {
            jRule.assertLogNotContains("\tat", matrixRun);
        }
    }
}
 
Example #9
Source File: PipelineApiTest.java    From blueocean-plugin with MIT License 5 votes vote down vote up
@Issue("JENKINS-52307")
@Test
public void matrixProjectEmptyBuild() throws Exception{
    MatrixProject mp = j.jenkins.createProject(MatrixProject.class, "mp1");
    List response = get("/organizations/jenkins/pipelines/", List.class);
    Assert.assertNotNull( response );
}
 
Example #10
Source File: MatrixProjectImpl.java    From blueocean-plugin with MIT License 5 votes vote down vote up
@Override
public MatrixProjectImpl getPipeline(Item item, Reachable parent, BlueOrganization organization) {
    if (item instanceof MatrixProject) {
        return new MatrixProjectImpl(organization, (MatrixProject) item, parent.getLink());
    }
    return null;
}
 
Example #11
Source File: MatrixJobITest.java    From warnings-ng-plugin with MIT License 5 votes vote down vote up
/**
 * Build a matrix job with three configurations. For each configuration a different set of warnings will be parsed
 * with the same parser (GCC). After the successful build the total number of warnings at the root level should be
 * set to 12 (sum of all three configurations). Moreover, for each configuration the total number of warnings is
 * also verified (4, 6, and 2 warnings).
 *
 * @throws Exception in case of an error
 */
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
@Test
public void shouldCreateIndividualAxisResults() throws Exception {
    MatrixProject project = createProject(MatrixProject.class);
    copySingleFileToWorkspace(project, "matrix-warnings-one.txt", "user_axis/one/warnings.txt");
    copySingleFileToWorkspace(project, "matrix-warnings-two.txt", "user_axis/two/warnings.txt");
    copySingleFileToWorkspace(project, "matrix-warnings-three.txt", "user_axis/three/warnings.txt");
    IssuesRecorder publisher = new IssuesRecorder();
    Gcc4 tool = new Gcc4();
    tool.setPattern("**/*.txt");
    publisher.setTools(tool);
    project.getPublishersList().add(publisher);

    AxisList axis = new AxisList();
    TextAxis userAxis = new TextAxis("user_axis", "one two three");
    axis.add(userAxis);
    project.setAxes(axis);

    Map<String, Integer> warningsPerAxis = new HashMap<>();
    warningsPerAxis.put("one", 4);
    warningsPerAxis.put("two", 6);
    warningsPerAxis.put("three", 2);

    MatrixBuild build = project.scheduleBuild2(0).get();
    for (MatrixRun run : build.getRuns()) {
        getJenkins().assertBuildStatus(Result.SUCCESS, run);

        AnalysisResult result = getAnalysisResult(run);

        String currentAxis = run.getBuildVariables().values().iterator().next();
        assertThat(result.getTotalSize()).as("Result of axis " + currentAxis).isEqualTo(warningsPerAxis.get(currentAxis));
    }
    AnalysisResult aggregation = getAnalysisResult(build);
    assertThat(aggregation.getTotalSize()).isEqualTo(12);
}
 
Example #12
Source File: JobAnalyticsTest.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Test
public void testJobAnalytics() throws Exception {
    // Freestyle jobs
    j.createFreeStyleProject("freestyle1").save();
    j.createFreeStyleProject("freestyle2").save();

    // Matrix job
    j.createProject(MatrixProject.class, "bob");

    // Create single scripted pipeline
    WorkflowJob scriptedSingle = createWorkflowJobWithJenkinsfile(getClass(),"JobAnalyticsTest-scripted.jenkinsfile");
    WorkflowRun scriptedSingleRun = scriptedSingle.scheduleBuild2(0, new CauseAction()).waitForStart();
    j.waitForCompletion(scriptedSingleRun);

    // Create single declarative pipeline
    WorkflowJob declarativeSingle = createWorkflowJobWithJenkinsfile(getClass(),"JobAnalyticsTest-declarative.jenkinsfile");
    WorkflowRun declarativeSingleRun = declarativeSingle.scheduleBuild2(0, new CauseAction()).waitForStart();
    j.waitForCompletion(declarativeSingleRun);

    // Create Scripted MultiBranch
    createMultiBranch(sampleRepo);

    // Create Declarative MultiBranch
    createMultiBranch(sampleRepo2);

    AnalyticsImpl analytics = (AnalyticsImpl)Analytics.get();
    Assert.assertNotNull(analytics);

    JobAnalytics jobAnalytics = new JobAnalytics();
    jobAnalytics.calculateAndSend();

    Assert.assertNotNull(analytics.lastReq);
    Assert.assertEquals("job_stats", analytics.lastReq.name);

    Map<String, Object> properties = analytics.lastReq.properties;
    Assert.assertEquals("singlePipelineDeclarative", 1, properties.get("singlePipelineDeclarative"));
    Assert.assertEquals("singlePipelineScripted",1, properties.get("singlePipelineScripted"));
    Assert.assertEquals("pipelineDeclarative",1, properties.get("pipelineDeclarative"));
    Assert.assertEquals("pipelineScripted",1, properties.get("pipelineScripted"));
    Assert.assertEquals("freestyle",2, properties.get("freestyle"));
    Assert.assertEquals("matrix",1, properties.get("matrix"));
    Assert.assertEquals("other",0, properties.get("other"));
}
 
Example #13
Source File: AbstractPRTest.java    From github-integration-plugin with MIT License 4 votes vote down vote up
public void basicTest(Job job) throws Exception {
    // fails with workflow
    if (job instanceof FreeStyleProject || job instanceof MatrixProject) {
        jRule.configRoundtrip(job); // activate trigger
    }

    // update trigger (maybe useless)
    GitHubPRTrigger trigger = ghPRTriggerFromJob(job);
    if (job instanceof WorkflowJob) {
        trigger.start(job, true); // hack configRountrip that doesn't work with workflow
    }

    await().pollInterval(3, TimeUnit.SECONDS)
            .timeout(100, SECONDS)
            .until(ghTriggerRunAndEnd(trigger));

    jRule.waitUntilNoActivity();

    assertThat(job.getLastBuild(), is(nullValue()));

    GitHubPRRepository ghPRRepository = job.getAction(GitHubPRRepository.class);
    assertThat("Action storage should be available", ghPRRepository, notNullValue());

    Map<Integer, GitHubPRPullRequest> pulls = ghPRRepository.getPulls();
    assertThat("Action storage should be empty", pulls.entrySet(), Matchers.hasSize(0));

    final GHPullRequest pullRequest1 = ghRule.getGhRepo().createPullRequest("title with \"quote\" text",
            "branch-1", "master", "body");

    await().pollInterval(2, SECONDS)
            .timeout(100, SECONDS)
            .until(ghPRAppeared(pullRequest1));

    await().pollInterval(3, TimeUnit.SECONDS)
            .timeout(100, SECONDS)
            .until(ghTriggerRunAndEnd(trigger));

    jRule.waitUntilNoActivity();

    // refresh objects
    ghPRRepository = job.getAction(GitHubPRRepository.class);
    assertThat("Action storage should be available", ghPRRepository, notNullValue());

    pulls = ghPRRepository.getPulls();
    assertThat("Pull request 1 should appear in action storage", pulls.entrySet(), Matchers.hasSize(1));

    jRule.assertBuildStatusSuccess(job.getLastBuild());
    assertThat(job.getBuilds().size(), is(1));

    // now push changes that should trigger again
    ghRule.commitFileToBranch(BRANCH1, BRANCH1 + ".file2", "content", "commit 2 for " + BRANCH1);

    trigger.doRun(null);

    await().pollInterval(5, TimeUnit.SECONDS)
            .timeout(100, SECONDS)
            .until(ghTriggerRunAndEnd(trigger));

    jRule.waitUntilNoActivity();

    // refresh objects
    ghPRRepository = job.getAction(GitHubPRRepository.class);
    assertThat("Action storage should be available", ghPRRepository, notNullValue());

    pulls = ghPRRepository.getPulls();
    assertThat("Pull request 1 should appear in action storage", pulls.entrySet(), Matchers.hasSize(1));

    jRule.assertBuildStatusSuccess(job.getLastBuild());
    assertThat(job.getBuilds().size(), is(2));
}
 
Example #14
Source File: CancelQueuedJobRunnerForCauseTest.java    From github-integration-plugin with MIT License 4 votes vote down vote up
@Test
public void testCancelQueuedMatrixProject() throws Exception {
    cancelQueued(MatrixProject.class);
}
 
Example #15
Source File: AbortRunningJobRunnerCauseTest.java    From github-integration-plugin with MIT License 4 votes vote down vote up
@Test
@RandomlyFails(value = "No idea why matrix doesn't work normally")
public void testAbortRunningMatrixProject() throws Exception {

    MockFolder folder = j.createFolder("Matrix_folder");

    MatrixProject job1 = folder.createProject(MatrixProject.class, "project1");
    job1.setDisplayName("project1 display name");
    job1.setConcurrentBuild(true);
    job1.getBuildersList().add(new SleepBuilder());
    job1.setAxes(
            new AxisList(
                    new TextAxis("first_axis", "first_value1"),
                    new TextAxis("second_axis", "sec_value1")
            )
    );
    configRoundTripUnsecure(job1);
    job1.save();

    MatrixProject job2 = folder.createProject(MatrixProject.class, "project2");
    job2.setDisplayName("project1 display name");
    job2.setConcurrentBuild(true);
    job2.getBuildersList().add(new SleepBuilder());
    job2.setAxes(
            new AxisList(
                    new TextAxis("first_axis", "first_value1"),
                    new TextAxis("second_axis", "sec_value1")
            )
    );
    configRoundTripUnsecure(job2);
    job2.save();

    MatrixProject job3 = folder.createProject(MatrixProject.class, "project3");
    job3.setDisplayName("project1 display name");
    job3.setConcurrentBuild(true);
    job3.getBuildersList().add(new SleepBuilder());
    job3.setAxes(
            new AxisList(
                    new TextAxis("first_axis", "first_value1"),
                    new TextAxis("second_axis", "sec_value1")
            )
    );
    configRoundTripUnsecure(job3);
    job3.save();

    testAbortRunning(job1, job2, job3);

    assertThat(job1.getBuilds(), hasSize(3));

    for (MatrixBuild matrixBuild : job1.getBuilds()) {
        assertThat(matrixBuild.getResult(), is(Result.ABORTED));
        assertThat(matrixBuild.getRuns(), not(empty()));
        for (MatrixRun matrixRun : matrixBuild.getRuns()) {
            assertThat(matrixRun.getResult(), is(Result.ABORTED));
        }
    }
}
 
Example #16
Source File: BranchITest.java    From github-integration-plugin with MIT License 4 votes vote down vote up
public void smokeTest(Job<?, ?> job) throws Exception {
    GitHubBranchTrigger trigger;
    // fails with workflow
    if (job instanceof FreeStyleProject || job instanceof MatrixProject) {
        jRule.configRoundtrip(job); // activate trigger
        trigger = ghBranchTriggerFromJob(job);
    } else {
        trigger = ghBranchTriggerFromJob(job);
        trigger.start(job, true);
    }

    await().pollInterval(3, TimeUnit.SECONDS)
            .timeout(100, SECONDS)
            .until(ghTriggerRunAndEnd(trigger));

    jRule.waitUntilNoActivity();

    assertThat(job.getBuilds(), hasSize(3));

    GitHubBranchRepository ghRepository = job.getAction(GitHubBranchRepository.class);
    assertThat("Action storage should be available", ghRepository, notNullValue());

    Map<String, GitHubBranch> branches = ghRepository.getBranches();

    assertThat("Action storage should not to be empty", branches.entrySet(), Matchers.hasSize(3));


    ghRule.commitFileToBranch("branch-4", "someFile", "content", "With this magessage");
    await().pollInterval(3, TimeUnit.SECONDS)
            .timeout(100, SECONDS)
            .until(ghTriggerRunAndEnd(trigger));

    jRule.waitUntilNoActivity();

    // refresh objects
    ghRepository = job.getAction(GitHubBranchRepository.class);
    assertThat("Action storage should be available", ghRepository, notNullValue());

    branches = ghRepository.getBranches();
    assertThat(branches.entrySet(), Matchers.hasSize(4));

    assertThat(job.getBuilds().size(), is(4));

    jRule.assertBuildStatusSuccess(job.getLastBuild());
}
 
Example #17
Source File: MatrixAnalyticsCheck.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Override
public Boolean apply(Item item) {
    return item.getClass().getName().equals("hudson.matrix.MatrixConfiguration") || item.getParent() instanceof MatrixProject;
}
 
Example #18
Source File: MatrixMultiBranchProject.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
@Override
protected MatrixProject newTemplate() {
    return new MatrixProject(this, TemplateDrivenMultiBranchProject.TEMPLATE);
}
 
Example #19
Source File: MatrixMultiBranchProject.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
@Nonnull
@Override
protected BranchProjectFactory<MatrixProject, MatrixBuild> newProjectFactory() {
    return new MatrixBranchProjectFactory();
}
 
Example #20
Source File: MatrixBranchProjectFactory.java    From multi-branch-project-plugin with MIT License 4 votes vote down vote up
@Override
public MatrixProject newInstance(Branch branch) {
    MatrixProject project = new MatrixProject(getOwner(), branch.getEncodedName());
    setBranch(project, branch);
    return project;
}
 
Example #21
Source File: MatrixAnalyticsCheck.java    From blueocean-plugin with MIT License 4 votes vote down vote up
@Override
public Boolean apply(Item item) {
    return item instanceof MatrixProject;
}
 
Example #22
Source File: MatrixProjectImpl.java    From blueocean-plugin with MIT License 4 votes vote down vote up
public MatrixProjectImpl(BlueOrganization organization, MatrixProject folder, Link parent) {
    super(organization, folder, parent);
    this.matrixProject = folder;
}
 
Example #23
Source File: TemplateUtils.java    From ez-templates with Apache License 2.0 4 votes vote down vote up
public static void handleTemplateImplementationSaved(AbstractProject implementationProject, TemplateImplementationProperty property) throws IOException {
	
    if (property.getTemplateJobName().equals("null")) {
        LOG.warning(String.format("Implementation [%s] was saved. No template selected.", implementationProject.getFullDisplayName()));
        return;
    }
	
    LOG.info(String.format("Implementation [%s] was saved. Syncing with [%s].", implementationProject.getFullDisplayName(), property.getTemplateJobName()));
    
    AbstractProject templateProject = property.findTemplate();        
    if (templateProject == null) {
    	
    	// If the template can't be found, then it's probably a bug
        throw new IllegalStateException(String.format("Cannot find template [%s] used by job [%s]", property.getTemplateJobName(), implementationProject.getFullDisplayName()));
    }

    //Capture values we want to keep
    @SuppressWarnings("unchecked")
    boolean implementationIsTemplate = implementationProject.getProperty(TemplateProperty.class) != null;
    List<ParameterDefinition> oldImplementationParameters = findParameters(implementationProject);
    @SuppressWarnings("unchecked")
    Map<TriggerDescriptor, Trigger> oldTriggers = implementationProject.getTriggers();
    boolean shouldBeDisabled = implementationProject.isDisabled();
    String description = implementationProject.getDescription();
    String displayName = implementationProject.getDisplayNameOrNull();
    AuthorizationMatrixProperty oldAuthMatrixProperty = (AuthorizationMatrixProperty) implementationProject.getProperty(AuthorizationMatrixProperty.class);
    SCM oldScm = (SCM) implementationProject.getScm();
    JobProperty oldOwnership = implementationProject.getProperty("com.synopsys.arc.jenkins.plugins.ownership.jobs.JobOwnerJobProperty");
    Label oldLabel = implementationProject.getAssignedLabel();

    AxisList oldAxisList = null;
    if (implementationProject instanceof MatrixProject && !property.getSyncMatrixAxis()) {
        MatrixProject matrixProject = (MatrixProject) implementationProject;
        oldAxisList = matrixProject.getAxes();
    }

    implementationProject = synchronizeConfigFiles(implementationProject, templateProject);

    // Reverse all the fields that we've marked as "Don't Sync" so that they appear that they haven't changed.

    //Set values that we wanted to keep via reflection to prevent infinite save recursion
    fixProperties(implementationProject, property, implementationIsTemplate);
    fixParameters(implementationProject, oldImplementationParameters);

    ReflectionUtils.setFieldValue(AbstractItem.class, implementationProject, "displayName", displayName);

    if (!property.getSyncBuildTriggers()) {
        fixBuildTriggers(implementationProject, oldTriggers);
    }

    if (!property.getSyncDisabled()) {
        ReflectionUtils.setFieldValue(AbstractProject.class, implementationProject, "disabled", shouldBeDisabled);
    }

    if (oldAxisList != null && implementationProject instanceof MatrixProject && !property.getSyncMatrixAxis()) {
        fixAxisList((MatrixProject) implementationProject, oldAxisList);
    }

    if (!property.getSyncDescription() && description != null) {
        ReflectionUtils.setFieldValue(AbstractItem.class, implementationProject, "description", description);
    }

    if (!property.getSyncSecurity() && oldAuthMatrixProperty != null) {
        implementationProject.removeProperty(AuthorizationMatrixProperty.class);
        implementationProject.addProperty(oldAuthMatrixProperty);
    }

    if (!property.getSyncScm() && oldScm != null) {
        implementationProject.setScm(oldScm);
    }

    if (!property.getSyncOwnership() && oldOwnership != null) {
        implementationProject.removeProperty(oldOwnership.getClass());
        implementationProject.addProperty(oldOwnership);
    }

    if (!property.getSyncAssignedLabel()) {
        implementationProject.setAssignedLabel(oldLabel);
    }

    if (Jenkins.getInstance().getPlugin("promoted-builds") != null) {
        PromotedBuildsTemplateUtils.addPromotions(implementationProject, templateProject);
    } 

    ProjectUtils.silentSave(implementationProject);
}