*/
private Boolean summaryCommentEnabled;
+ /**
+ * Boolean to know if this SonarQube project is part of a monorepo
+ * Only valid for Azure
+ * It will be null when the ALM is other than Azure
+ */
+ private Boolean monorepo;
+
private long updatedAt;
private long createdAt;
return this;
}
+ public Boolean getMonorepo() {
+ return monorepo;
+ }
+
+ public ProjectAlmSettingDto setMonorepo(Boolean monorepo) {
+ this.monorepo = monorepo;
+ return this;
+ }
+
long getUpdatedAt() {
return updatedAt;
}
p.alm_repo as almRepo,
p.alm_slug as almSlug,
p.summary_comment_enabled as summaryCommentEnabled,
+ p.monorepo as monorepo,
p.created_at as createdAt,
p.updated_at as updatedAt
</sql>
alm_repo,
alm_slug,
summary_comment_enabled,
+ monorepo,
created_at,
updated_at
)
#{dto.almRepo, jdbcType=VARCHAR},
#{dto.almSlug, jdbcType=VARCHAR},
#{dto.summaryCommentEnabled, jdbcType=BOOLEAN},
+ #{dto.monorepo, jdbcType=BOOLEAN},
#{now, jdbcType=BIGINT},
#{now, jdbcType=BIGINT}
)
alm_repo,
alm_slug,
summary_comment_enabled,
+ monorepo,
created_at,
updated_at
)
#{dto.almRepo, jdbcType=VARCHAR},
#{dto.almSlug, jdbcType=VARCHAR},
#{dto.summaryCommentEnabled, jdbcType=NUMERIC},
+ #{dto.monorepo, jdbcType=NUMERIC},
#{now, jdbcType=BIGINT},
#{now, jdbcType=BIGINT}
)
alm_repo = #{dto.almRepo, jdbcType=VARCHAR},
alm_slug = #{dto.almSlug, jdbcType=VARCHAR},
summary_comment_enabled = #{dto.summaryCommentEnabled, jdbcType=BOOLEAN},
+ monorepo = #{dto.monorepo, jdbcType=BOOLEAN},
updated_at = #{now, jdbcType=BIGINT}
WHERE
project_uuid = #{dto.projectUuid, jdbcType=VARCHAR}
alm_repo = #{dto.almRepo, jdbcType=VARCHAR},
alm_slug = #{dto.almSlug, jdbcType=VARCHAR},
summary_comment_enabled = #{dto.summaryCommentEnabled, jdbcType=NUMERIC},
+ monorepo = #{dto.monorepo, jdbcType=NUMERIC},
updated_at = #{now, jdbcType=BIGINT}
WHERE
project_uuid = #{dto.projectUuid, jdbcType=VARCHAR}
"ALM_SLUG" VARCHAR(256),
"UPDATED_AT" BIGINT NOT NULL,
"CREATED_AT" BIGINT NOT NULL,
- "SUMMARY_COMMENT_ENABLED" BOOLEAN
+ "SUMMARY_COMMENT_ENABLED" BOOLEAN,
+ "MONOREPO" BOOLEAN NOT NULL
);
ALTER TABLE "PROJECT_ALM_SETTINGS" ADD CONSTRAINT "PK_PROJECT_ALM_SETTINGS" PRIMARY KEY("UUID");
CREATE UNIQUE INDEX "UNIQ_PROJECT_ALM_SETTINGS" ON "PROJECT_ALM_SETTINGS"("PROJECT_UUID");
.extracting(ProjectAlmSettingDto::getUuid, ProjectAlmSettingDto::getAlmSettingUuid, ProjectAlmSettingDto::getProjectUuid,
ProjectAlmSettingDto::getAlmRepo, ProjectAlmSettingDto::getAlmSlug,
ProjectAlmSettingDto::getCreatedAt, ProjectAlmSettingDto::getUpdatedAt,
- ProjectAlmSettingDto::getSummaryCommentEnabled)
+ ProjectAlmSettingDto::getSummaryCommentEnabled, ProjectAlmSettingDto::getMonorepo)
.containsExactly(A_UUID, githubAlmSettingDto.getUuid(), project.getUuid(),
githubProjectAlmSettingDto.getAlmRepo(), githubProjectAlmSettingDto.getAlmSlug(),
- A_DATE, A_DATE, githubProjectAlmSettingDto.getSummaryCommentEnabled());
+ A_DATE, A_DATE, githubProjectAlmSettingDto.getSummaryCommentEnabled(), false);
assertThat(underTest.selectByProject(dbSession, anotherProject)).isNotPresent();
}
return insertProjectAlmSetting(newAzureProjectAlmSettingDto(azureAlmSetting, project));
}
+ public ProjectAlmSettingDto insertAzureMonoRepoProjectAlmSetting(AlmSettingDto azureAlmSetting, ProjectDto project) {
+ return insertProjectAlmSetting(newAzureProjectAlmSettingDto(azureAlmSetting, project), d -> d.setMonorepo(true));
+ }
+
public ProjectAlmSettingDto insertGitlabProjectAlmSetting(AlmSettingDto gitlabAlmSetting, ProjectDto project) {
return insertProjectAlmSetting(newGitlabProjectAlmSettingDto(gitlabAlmSetting, project));
}
.setAlmSettingUuid(githubAlmSetting.getUuid())
.setProjectUuid(project.getUuid())
.setAlmRepo(randomAlphanumeric(256))
- .setSummaryCommentEnabled(true);
+ .setSummaryCommentEnabled(true)
+ .setMonorepo(false);
}
static ProjectAlmSettingDto newGitlabProjectAlmSettingDto(AlmSettingDto gitlabAlmSetting, ProjectDto project) {
return new ProjectAlmSettingDto()
.setAlmSettingUuid(gitlabAlmSetting.getUuid())
- .setProjectUuid(project.getUuid());
+ .setProjectUuid(project.getUuid())
+ .setMonorepo(false);
}
static ProjectAlmSettingDto newAzureProjectAlmSettingDto(AlmSettingDto azureAlmSetting, ProjectDto project) {
.setAlmSettingUuid(azureAlmSetting.getUuid())
.setProjectUuid(project.getUuid())
.setAlmSlug(randomAlphanumeric(256))
- .setAlmRepo(randomAlphanumeric(256));
+ .setAlmRepo(randomAlphanumeric(256))
+ .setMonorepo(false);
}
public static ProjectAlmSettingDto newBitbucketProjectAlmSettingDto(AlmSettingDto githubAlmSetting, ProjectDto project) {
.setAlmSettingUuid(githubAlmSetting.getUuid())
.setProjectUuid(project.getUuid())
.setAlmRepo(randomAlphanumeric(256))
- .setAlmSlug(randomAlphanumeric(256));
+ .setAlmSlug(randomAlphanumeric(256))
+ .setMonorepo(false);
}
}
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.sonar.server.platform.db.migration.version.v87;
import java.sql.SQLException;
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.sonar.server.platform.db.migration.version.v87;
import java.sql.SQLException;
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.sonar.server.platform.db.migration.version.v87;
import java.sql.SQLException;
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.sonar.server.platform.db.migration.version.v87;
import java.sql.SQLException;
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.sonar.server.platform.db.migration.version.v87;
import java.sql.SQLException;
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.sonar.server.platform.db.migration.version.v87;
import java.sql.SQLException;
.setParam("project", request.getProject())
.setParam("projectName", request.getProjectName())
.setParam("repositoryName", request.getRepositoryName())
+ .setParam("monorepo", request.getMonorepo())
.setMediaType(MediaTypes.JSON)).content();
}
private String project;
private String repositoryName;
private String projectName;
+ private String monorepo;
/**
* This is a mandatory parameter.
this.projectName = projectName;
return this;
}
+
+ public String getMonorepo() {
+ return monorepo;
+ }
+
+ public SetAzureBindingRequest setMonorepo(String monorepo) {
+ this.monorepo = monorepo;
+ return this;
+ }
}
optional string url = 4;
optional string slug = 5;
optional bool summaryCommentEnabled = 6;
+ optional bool monorepo = 7;
}
enum Alm {