/**
* JWT (Json Web Token) to authenticate API requests on behalf
- * of the SonarCloud App.
+ * of the Github App.
*
* Token expires after {@link #EXPIRATION_PERIOD_IN_MINUTES} minutes.
*
* IMPORTANT
* Rate limit is 5'000 API requests per hour for ALL the clients
- * of the SonarCloud App (all instances of {@link AppToken} from Compute Engines/web servers
+ * of the Github App (all instances of {@link AppToken} from Compute Engines/web servers
* and from the other SonarSource services using the App). For example three calls with
* three different tokens will consume 3 hits. Remaining quota will be 4'997.
* When the token is expired, the rate limit is 60 calls per hour for the public IP
@Immutable
public class AppToken implements AccessToken {
- // SONARCLOUD-468 maximum allowed by GitHub is 10 minutes but we use 9 minutes just in case clocks are not synchronized
+ // maximum allowed by GitHub is 10 minutes but we use 9 minutes just in case clocks are not synchronized
static final int EXPIRATION_PERIOD_IN_MINUTES = 9;
private final String jwt;
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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.ce.cleaning;
-
-public class NoopCeCleaningSchedulerImpl implements CeCleaningScheduler {
- @Override
- public void startScheduling() {
- // do nothing
- }
-}
import org.sonar.ce.StandaloneCeDistributedInformation;
import org.sonar.ce.async.SynchronousAsyncExecution;
import org.sonar.ce.cleaning.CeCleaningModule;
-import org.sonar.ce.cleaning.NoopCeCleaningSchedulerImpl;
import org.sonar.ce.db.ReadOnlyPropertiesDao;
import org.sonar.ce.issue.index.NoAsyncIssueIndexing;
import org.sonar.ce.logging.CeProcessLogging;
import static org.sonar.core.extension.PlatformLevelPredicates.hasPlatformLevel;
import static org.sonar.core.extension.PlatformLevelPredicates.hasPlatformLevel4OrNone;
import static org.sonar.process.ProcessProperties.Property.CLUSTER_ENABLED;
-import static org.sonar.process.ProcessProperties.Property.SONARCLOUD_ENABLED;
public class ComputeEngineContainerImpl implements ComputeEngineContainer {
);
- if (props.valueAsBoolean(SONARCLOUD_ENABLED.getKey())) {
- // no cleaning job on sonarcloud and no distributed information
- container.add(
- NoopCeCleaningSchedulerImpl.class,
- StandaloneCeDistributedInformation.class);
- } else if (props.valueAsBoolean(CLUSTER_ENABLED.getKey())) {
+ if (props.valueAsBoolean(CLUSTER_ENABLED.getKey())) {
container.add(
new CeCleaningModule(),
@Nullable
private Boolean local;
- @Nullable
- private Boolean onboarded;
-
@Nullable
private Boolean root;
this.externalLogin = userDto.getExternalLogin();
this.externalIdentityProvider = userDto.getExternalIdentityProvider();
this.local = userDto.isLocal();
- this.onboarded = userDto.isOnboarded();
this.root = userDto.isRoot();
this.lastConnectionDate = userDto.getLastConnectionDate();
}
return this.local;
}
- @CheckForNull
- public Boolean isOnboarded() {
- return this.onboarded;
- }
-
@CheckForNull
public Boolean isRoot() {
return this.root;
addField(sb, "\"externalLogin\": ", this.externalLogin, true);
addField(sb, "\"externalIdentityProvider\": ", this.externalIdentityProvider, true);
addField(sb, "\"local\": ", ObjectUtils.toString(this.local), false);
- addField(sb, "\"onboarded\": ", ObjectUtils.toString(this.onboarded), false);
addField(sb, "\"root\": ", ObjectUtils.toString(this.root), false);
addField(sb, "\"lastConnectionDate\": ", this.lastConnectionDate == null ?
"" : DateUtils.formatDateTime(this.lastConnectionDate), true);
private String homepageParameter;
private boolean local = true;
private boolean root = false;
- private boolean onboarded = false;
private boolean resetPassword = false;
private boolean sonarlintAdSeen = false;
this.root = root;
}
- public boolean isOnboarded() {
- return onboarded;
- }
-
- public UserDto setOnboarded(boolean onboarded) {
- this.onboarded = onboarded;
- return this;
- }
-
public boolean isResetPassword() {
return resetPassword;
}
u.external_identity_provider as "externalIdentityProvider",
u.user_local as "local",
u.is_root as "root",
- u.onboarded as "onboarded",
u.reset_password as "resetPassword",
u.homepage_type as "homepageType",
u.homepage_parameter as "homepageParameter",
crypted_password,
hash_method,
is_root,
- onboarded,
last_sonarlint_connection,
sonarlint_ad_seen,
reset_password,
#{user.cryptedPassword,jdbcType=VARCHAR},
#{user.hashMethod,jdbcType=VARCHAR},
#{user.root,jdbcType=BOOLEAN},
- #{user.onboarded,jdbcType=BOOLEAN},
#{user.lastSonarlintConnectionDate,jdbcType=BIGINT},
#{user.sonarlintAdSeen,jdbcType=BOOLEAN},
#{user.resetPassword,jdbcType=BOOLEAN},
external_login = #{user.externalLogin, jdbcType=VARCHAR},
external_identity_provider = #{user.externalIdentityProvider, jdbcType=VARCHAR},
user_local = #{user.local, jdbcType=BOOLEAN},
- onboarded = #{user.onboarded, jdbcType=BOOLEAN},
reset_password = #{user.resetPassword, jdbcType=BOOLEAN},
salt = #{user.salt, jdbcType=VARCHAR},
crypted_password = #{user.cryptedPassword, jdbcType=BIGINT},
"EXTERNAL_ID" CHARACTER VARYING(255) NOT NULL,
"IS_ROOT" BOOLEAN NOT NULL,
"USER_LOCAL" BOOLEAN,
- "ONBOARDED" BOOLEAN NOT NULL,
"HOMEPAGE_TYPE" CHARACTER VARYING(40),
"HOMEPAGE_PARAMETER" CHARACTER VARYING(40),
"LAST_CONNECTION_DATE" BIGINT,
userDto.setExternalLogin("name");
userDto.setExternalIdentityProvider("github");
userDto.setLocal(false);
- userDto.setOnboarded(true);
userDto.setLastConnectionDate(System.currentTimeMillis());
UserNewValue userNewValue = new UserNewValue(userDto);
assertThat(user).isNotNull();
assertThat(user.getUuid()).isNotNull();
assertThat(user.isActive()).isTrue();
- assertThat(user.isOnboarded()).isFalse();
assertThat(user.isResetPassword()).isFalse();
assertThat(user.isLocal()).isTrue();
assertThat(user.isRoot()).isFalse();
.setEmail("jo@hn.com")
.setScmAccounts(",jo.hn,john2,")
.setActive(true)
- .setOnboarded(true)
.setResetPassword(true)
.setSalt("1234")
.setCryptedPassword("abcd")
assertThat(user.getName()).isEqualTo("John");
assertThat(user.getEmail()).isEqualTo("jo@hn.com");
assertThat(user.isActive()).isTrue();
- assertThat(user.isOnboarded()).isTrue();
assertThat(user.isResetPassword()).isTrue();
assertThat(user.getScmAccounts()).isEqualTo(",jo.hn,john2,");
assertThat(user.getSalt()).isEqualTo("1234");
.setEmail("jo@hn.com")
.setActive(true)
.setLocal(true)
- .setOnboarded(false)
.setResetPassword(false));
underTest.update(db.getSession(), newUserDto()
.setEmail("jodoo@hn.com")
.setScmAccounts(",jo.hn,john2,johndoo,")
.setActive(false)
- .setOnboarded(true)
.setResetPassword(true)
.setSalt("12345")
.setCryptedPassword("abcde")
assertThat(reloaded.getName()).isEqualTo("John Doo");
assertThat(reloaded.getEmail()).isEqualTo("jodoo@hn.com");
assertThat(reloaded.isActive()).isFalse();
- assertThat(reloaded.isOnboarded()).isTrue();
assertThat(reloaded.isResetPassword()).isTrue();
assertThat(reloaded.getScmAccounts()).isEqualTo(",jo.hn,john2,johndoo,");
assertThat(reloaded.getSalt()).isEqualTo("12345");
.setEmail("jo@hn.com")
.setActive(true)
.setLocal(true)
- .setOnboarded(false)
.setResetPassword(false));
UserDto updatedUser = newUserDto()
.setUuid(user.getUuid())
.setEmail("jodoo@hn.com")
.setScmAccounts(",jo.hn,john2,johndoo,")
.setActive(false)
- .setOnboarded(true)
.setResetPassword(true)
.setSalt("12345")
.setCryptedPassword("abcde")
assertThat(newValue)
.extracting(UserNewValue::getUserUuid, UserNewValue::getUserLogin, UserNewValue::getName, UserNewValue::getEmail, UserNewValue::isActive,
UserNewValue::getScmAccounts, UserNewValue::getExternalId, UserNewValue::getExternalLogin, UserNewValue::getExternalIdentityProvider,
- UserNewValue::isLocal, UserNewValue::isOnboarded, UserNewValue::isRoot, UserNewValue::getLastConnectionDate)
+ UserNewValue::isLocal, UserNewValue::isRoot, UserNewValue::getLastConnectionDate)
.containsExactly(updatedUser.getUuid(), updatedUser.getLogin(), updatedUser.getName(), updatedUser.getEmail(), updatedUser.isActive(),
updatedUser.getScmAccounts(), updatedUser.getExternalId(), updatedUser.getExternalLogin(), updatedUser.getExternalIdentityProvider(),
- updatedUser.isLocal(), updatedUser.isOnboarded(), updatedUser.isRoot(), updatedUser.getLastConnectionDate());
+ updatedUser.isLocal(), updatedUser.isRoot(), updatedUser.getLastConnectionDate());
assertThat(newValue.toString())
.contains("name")
.contains(DateUtils.formatDateTime(updatedUser.getLastConnectionDate()));
.setEmail("jo@hn.com")
.setActive(true)
.setLocal(true)
- .setOnboarded(false)
.setResetPassword(false));
verify(auditPersister).addUser(eq(db.getSession()), newValueCaptor.capture());
.setLogin(randomAlphanumeric(30))
.setName(randomAlphanumeric(30))
.setEmail(randomAlphanumeric(30))
- .setOnboarded(nextBoolean())
.setScmAccounts(singletonList(randomAlphanumeric(40)))
.setExternalId(randomAlphanumeric(40))
.setExternalLogin(randomAlphanumeric(40))
.add(6414, "Drop rules_metadata table", DropRuleMetadataTable.class)
.add(6415, "Migrate hotspot rule descriptions", MigrateHotspotRuleDescriptions.class)
+
+ .add(6416, "Remove onboarded column from User table", DropOnboardedColumnFromUserTable.class)
;
}
}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2022 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.v95;
+
+import org.sonar.db.Database;
+import org.sonar.server.platform.db.migration.step.DropColumnChange;
+
+public class DropOnboardedColumnFromUserTable extends DropColumnChange {
+
+ protected DropOnboardedColumnFromUserTable(Database db) {
+ super(db, "users", "onboarded");
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2022 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.v95;
+
+import java.sql.SQLException;
+import java.sql.Types;
+import org.junit.Rule;
+import org.junit.Test;
+import org.sonar.db.CoreDbTester;
+import org.sonar.server.platform.db.migration.step.DdlChange;
+
+public class DropOnboardedColumnFromUserTableTest {
+
+ private static final String COLUMN_NAME = "onboarded";
+ private static final String TABLE_NAME = "users";
+
+ @Rule
+ public final CoreDbTester db = CoreDbTester.createForSchema(DropOnboardedColumnFromUserTableTest.class, "schema.sql");
+
+ private final DdlChange dropRuleDescriptionColumn = new DropOnboardedColumnFromUserTable(db.database());
+
+ @Test
+ public void migration_should_drop_onboarded_column() throws SQLException {
+ db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.BOOLEAN, null, false);
+ dropRuleDescriptionColumn.execute();
+ db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
+ }
+
+ @Test
+ public void migration_should_be_reentrant() throws SQLException {
+ db.assertColumnDefinition(TABLE_NAME, COLUMN_NAME, Types.BOOLEAN, null, false);
+ dropRuleDescriptionColumn.execute();
+ // re-entrant
+ dropRuleDescriptionColumn.execute();
+ db.assertColumnDoesNotExist(TABLE_NAME, COLUMN_NAME);
+ }
+}
\ No newline at end of file
--- /dev/null
+CREATE TABLE "USERS"(
+ "UUID" CHARACTER VARYING(255) NOT NULL,
+ "LOGIN" CHARACTER VARYING(255) NOT NULL,
+ "NAME" CHARACTER VARYING(200),
+ "EMAIL" CHARACTER VARYING(100),
+ "CRYPTED_PASSWORD" CHARACTER VARYING(100),
+ "SALT" CHARACTER VARYING(40),
+ "HASH_METHOD" CHARACTER VARYING(10),
+ "ACTIVE" BOOLEAN DEFAULT TRUE,
+ "SCM_ACCOUNTS" CHARACTER VARYING(4000),
+ "EXTERNAL_LOGIN" CHARACTER VARYING(255) NOT NULL,
+ "EXTERNAL_IDENTITY_PROVIDER" CHARACTER VARYING(100) NOT NULL,
+ "EXTERNAL_ID" CHARACTER VARYING(255) NOT NULL,
+ "IS_ROOT" BOOLEAN NOT NULL,
+ "USER_LOCAL" BOOLEAN,
+ "ONBOARDED" BOOLEAN NOT NULL,
+ "HOMEPAGE_TYPE" CHARACTER VARYING(40),
+ "HOMEPAGE_PARAMETER" CHARACTER VARYING(40),
+ "LAST_CONNECTION_DATE" BIGINT,
+ "CREATED_AT" BIGINT,
+ "UPDATED_AT" BIGINT,
+ "RESET_PASSWORD" BOOLEAN NOT NULL,
+ "LAST_SONARLINT_CONNECTION" BIGINT,
+ "SONARLINT_AD_SEEN" BOOLEAN DEFAULT FALSE
+);
+ALTER TABLE "USERS" ADD CONSTRAINT "PK_USERS" PRIMARY KEY("UUID");
+CREATE UNIQUE INDEX "USERS_LOGIN" ON "USERS"("LOGIN" NULLS FIRST);
+CREATE INDEX "USERS_UPDATED_AT" ON "USERS"("UPDATED_AT" NULLS FIRST);
+CREATE UNIQUE INDEX "UNIQ_EXTERNAL_ID" ON "USERS"("EXTERNAL_IDENTITY_PROVIDER" NULLS FIRST, "EXTERNAL_ID" NULLS FIRST);
+CREATE UNIQUE INDEX "UNIQ_EXTERNAL_LOGIN" ON "USERS"("EXTERNAL_IDENTITY_PROVIDER" NULLS FIRST, "EXTERNAL_LOGIN" NULLS FIRST);
SONAR_UPDATECENTER_ACTIVATE("sonar.updatecenter.activate", "true"),
- SONARCLOUD_ENABLED("sonar.sonarcloud.enabled", DEFAULT_FALSE),
- SONARCLOUD_HOMEPAGE_URL("sonar.homepage.url", ""),
- SONAR_PRISMIC_ACCESS_TOKEN("sonar.prismic.accessToken", ""),
- SONAR_ANALYTICS_GTM_TRACKING_ID("sonar.analytics.gtm.trackingId", ""),
- ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS("sonar.onboardingTutorial.showToNewUsers", "true"),
-
/**
* Used by Orchestrator to ask for shutdown of monitor process
*/
assertThat(props.value("sonar.search.javaOpts")).contains("-Xmx");
assertThat(props.valueAsInt("sonar.jdbc.maxActive")).isEqualTo(60);
- assertThat(props.valueAsBoolean("sonar.sonarcloud.enabled")).isFalse();
assertThat(props.valueAsBoolean("sonar.updatecenter.activate")).isTrue();
}
import static org.sonar.api.CoreProperties.DEFAULT_ISSUE_ASSIGNEE;
import static org.sonar.core.util.Slug.slugify;
import static org.sonar.core.util.stream.MoreCollectors.toList;
-import static org.sonar.process.ProcessProperties.Property.ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS;
import static org.sonar.server.exceptions.BadRequestException.checkRequest;
@ServerSide
if (password != null) {
updateUser.setPassword(password);
}
- setOnboarded(reactivatedUser);
updateDto(dbSession, updateUser, reactivatedUser);
updateUser(dbSession, reactivatedUser);
addUserToDefaultGroup(dbSession, reactivatedUser);
}
setExternalIdentity(dbSession, userDto, newUser.externalIdentity());
- setOnboarded(userDto);
checkRequest(messages.isEmpty(), messages);
return userDto;
"A user with provider id '%s' and identity provider '%s' already exists", dto.getExternalId(), dto.getExternalIdentityProvider());
}
- private void setOnboarded(UserDto userDto) {
- boolean showOnboarding = config.getBoolean(ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS.getKey()).orElse(false);
- userDto.setOnboarded(!showOnboarding);
- }
-
private static boolean checkNotEmptyParam(@Nullable String value, String param, List<String> messages) {
if (isNullOrEmpty(value)) {
messages.add(format(Validation.CANT_BE_EMPTY_MESSAGE, param));
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.sonar.db.user.UserTesting.newUserDto;
-import static org.sonar.process.ProcessProperties.Property.ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS;
import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC;
public class UserRegistrarImplTest {
checkGroupMembership(user.get(), group1, group2, defaultGroup);
}
- @Test
- public void authenticate_new_user_sets_onboarded_flag_to_false_when_onboarding_setting_is_set_to_true() {
- settings.setProperty(ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS.getKey(), true);
-
- UserDto user = underTest.register(newUserRegistration());
-
- assertThat(db.users().selectUserByLogin(user.getLogin()).get().isOnboarded()).isFalse();
- }
-
- @Test
- public void authenticate_new_user_sets_onboarded_flag_to_true_when_onboarding_setting_is_set_to_false() {
- settings.setProperty(ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS.getKey(), false);
-
- UserDto user = underTest.register(newUserRegistration());
-
- assertThat(db.users().selectUserByLogin(user.getLogin()).get().isOnboarded()).isTrue();
- }
-
@Test
public void authenticate_new_user_sets_external_id_to_provider_login_when_id_is_null() {
UserIdentity newUser = UserIdentity.builder()
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.sonar.db.user.UserTesting.newLocalUser;
-import static org.sonar.process.ProcessProperties.Property.ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS;
import static org.sonar.server.user.ExternalIdentity.SQ_AUTHORITY;
public class UserUpdaterCreateTest {
assertThat(dbClient.userDao().selectByLogin(session, "user").getScmAccountsAsList()).containsOnly("u1");
}
- @Test
- public void create_not_onboarded_user_if_onboarding_setting_is_set_to_false() {
- settings.setProperty(ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS.getKey(), false);
- createDefaultGroup();
-
- underTest.createAndCommit(db.getSession(), NewUser.builder()
- .setLogin("user")
- .setName("User")
- .build(), u -> {
- });
-
- assertThat(dbClient.userDao().selectByLogin(session, "user").isOnboarded()).isTrue();
- }
-
- @Test
- public void create_onboarded_user_if_onboarding_setting_is_set_to_true() {
- settings.setProperty(ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS.getKey(), true);
- createDefaultGroup();
-
- underTest.createAndCommit(db.getSession(), NewUser.builder()
- .setLogin("user")
- .setName("User")
- .build(), u -> {
- });
-
- assertThat(dbClient.userDao().selectByLogin(session, "user").isOnboarded()).isFalse();
- }
-
@Test
public void create_user_and_index_other_user() {
createDefaultGroup();
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.sonar.process.ProcessProperties.Property.ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS;
public class UserUpdaterReactivateTest {
assertThat(groups.get(userDto.getLogin()).stream().anyMatch(g -> g.equals(defaultGroup.getName()))).isTrue();
}
- @Test
- public void reactivate_not_onboarded_user_if_onboarding_setting_is_set_to_false() {
- settings.setProperty(ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS.getKey(), false);
- UserDto user = db.users().insertDisabledUser(u -> u.setOnboarded(false));
- createDefaultGroup();
-
- underTest.reactivateAndCommit(db.getSession(), user, NewUser.builder()
- .setLogin(user.getLogin())
- .setName(user.getName())
- .build(), u -> {
- });
-
- assertThat(dbClient.userDao().selectByLogin(session, user.getLogin()).isOnboarded()).isTrue();
- }
-
- @Test
- public void reactivate_onboarded_user_if_onboarding_setting_is_set_to_true() {
- settings.setProperty(ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS.getKey(), true);
- UserDto user = db.users().insertDisabledUser(u -> u.setOnboarded(true));
- createDefaultGroup();
-
- underTest.reactivateAndCommit(db.getSession(), user, NewUser.builder()
- .setLogin(user.getLogin())
- .setName(user.getName())
- .build(), u -> {
- });
-
- assertThat(dbClient.userDao().selectByLogin(session, user.getLogin()).isOnboarded()).isFalse();
- }
-
@Test
public void fail_to_reactivate_user_when_login_already_exists() {
createDefaultGroup();
import java.util.Map;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.text.StrSubstitutor;
-import org.sonar.api.config.Configuration;
import org.sonar.api.measures.Metric;
import org.sonar.api.server.ServerSide;
import static org.sonar.api.measures.Metric.Level.ERROR;
import static org.sonar.api.measures.Metric.Level.OK;
import static org.sonar.api.measures.Metric.Level.WARN;
-import static org.sonar.process.ProcessProperties.Property.SONARCLOUD_ENABLED;
@ServerSide
public class SvgGenerator {
.put('\'', 3)
.build();
- private static final String TEMPLATES_SONARCLOUD = "templates/sonarcloud";
- private static final String TEMPLATES_SONARQUBE = "templates/sonarqube";
+ private static final String TEMPLATES_PATH = "templates/sonarqube";
private static final int MARGIN = 6;
private static final int ICON_WIDTH = 20;
private final String badgeTemplate;
private final Map<Metric.Level, String> qualityGateTemplates;
- public SvgGenerator(Configuration config) {
- boolean isOnSonarCloud = config.getBoolean(SONARCLOUD_ENABLED.getKey()).orElse(false);
- String templatePath = isOnSonarCloud ? TEMPLATES_SONARCLOUD : TEMPLATES_SONARQUBE;
+ public SvgGenerator() {
this.errorTemplate = readTemplate("templates/error.svg");
- this.badgeTemplate = readTemplate(templatePath + "/badge.svg");
- this.qualityGateTemplates = ImmutableMap.of(
- OK, readTemplate(templatePath + "/quality_gate_passed.svg"),
- WARN, readTemplate(templatePath + "/quality_gate_warn.svg"),
- ERROR, readTemplate(templatePath + "/quality_gate_failed.svg"));
+ this.badgeTemplate = readTemplate(TEMPLATES_PATH + "/badge.svg");
+ this.qualityGateTemplates = Map.of(
+ OK, readTemplate(TEMPLATES_PATH + "/quality_gate_passed.svg"),
+ WARN, readTemplate(TEMPLATES_PATH + "/quality_gate_warn.svg"),
+ ERROR, readTemplate(TEMPLATES_PATH + "/quality_gate_failed.svg"));
}
public String generateBadge(String label, String value, Color backgroundValueColor) {
import static org.sonar.core.platform.EditionProvider.Edition;
import static org.sonar.core.platform.EditionProvider.Edition.DATACENTER;
import static org.sonar.core.platform.EditionProvider.Edition.ENTERPRISE;
-import static org.sonar.process.ProcessProperties.Property.SONARCLOUD_ENABLED;
-import static org.sonar.process.ProcessProperties.Property.SONARCLOUD_HOMEPAGE_URL;
-import static org.sonar.process.ProcessProperties.Property.SONAR_ANALYTICS_GTM_TRACKING_ID;
-import static org.sonar.process.ProcessProperties.Property.SONAR_PRISMIC_ACCESS_TOKEN;
import static org.sonar.process.ProcessProperties.Property.SONAR_UPDATECENTER_ACTIVATE;
public class GlobalAction implements NavigationWsAction, Startable {
- private static final Set<String> DYNAMIC_SETTING_KEYS = ImmutableSet.of(
+ private static final Set<String> DYNAMIC_SETTING_KEYS = Set.of(
SONAR_LF_LOGO_URL,
SONAR_LF_LOGO_WIDTH_PX,
SONAR_LF_ENABLE_GRAVATAR,
@Override
public void start() {
this.systemSettingValuesByKey.put(SONAR_UPDATECENTER_ACTIVATE.getKey(), config.get(SONAR_UPDATECENTER_ACTIVATE.getKey()).orElse(null));
- boolean isOnSonarCloud = config.getBoolean(SONARCLOUD_ENABLED.getKey()).orElse(false);
- if (isOnSonarCloud) {
- this.systemSettingValuesByKey.put(SONAR_PRISMIC_ACCESS_TOKEN.getKey(), config.get(SONAR_PRISMIC_ACCESS_TOKEN.getKey()).orElse(null));
- this.systemSettingValuesByKey.put(SONAR_ANALYTICS_GTM_TRACKING_ID.getKey(), config.get(SONAR_ANALYTICS_GTM_TRACKING_ID.getKey()).orElse(null));
- this.systemSettingValuesByKey.put(SONARCLOUD_HOMEPAGE_URL.getKey(), config.get(SONARCLOUD_HOMEPAGE_URL.getKey()).orElse(null));
- }
}
@Override
.setChangelog(
new Change("6.5", "showOnboardingTutorial is now returned in the response"),
new Change("7.1", "'parameter' is replaced by 'component' and 'organization' in the response"),
- new Change("9.2", "boolean 'usingSonarLintConnectedMode' and 'sonarLintAdSeen' fields are now returned in the response"));
+ new Change("9.2", "boolean 'usingSonarLintConnectedMode' and 'sonarLintAdSeen' fields are now returned in the response"),
+ new Change("9.5", "showOnboardingTutorial is not returned anymore in the response"));
}
@Override
.addAllScmAccounts(user.getScmAccountsAsList())
.setPermissions(Permissions.newBuilder().addAllGlobal(getGlobalPermissions()).build())
.setHomepage(buildHomepage(dbSession, user))
- .setShowOnboardingTutorial(!user.isOnboarded())
.setUsingSonarLintConnectedMode(user.getLastSonarlintConnectionDate() != null)
.setSonarLintAdSeen(user.isSonarlintAdSeen());
ofNullable(emptyToNull(user.getEmail())).ifPresent(builder::setEmail);
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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.user.ws;
-
-import org.sonar.api.server.ws.Request;
-import org.sonar.api.server.ws.Response;
-import org.sonar.api.server.ws.WebService;
-import org.sonar.db.DbClient;
-import org.sonar.db.DbSession;
-import org.sonar.db.user.UserDto;
-import org.sonar.server.user.UserSession;
-
-import static com.google.common.base.Preconditions.checkState;
-import static org.sonarqube.ws.client.user.UsersWsParameters.ACTION_SKIP_ONBOARDING_TUTORIAL;
-
-public class SkipOnboardingTutorialAction implements UsersWsAction {
-
- private final UserSession userSession;
- private final DbClient dbClient;
-
- public SkipOnboardingTutorialAction(UserSession userSession, DbClient dbClient) {
- this.userSession = userSession;
- this.dbClient = dbClient;
- }
-
- @Override
- public void define(WebService.NewController context) {
- context.createAction(ACTION_SKIP_ONBOARDING_TUTORIAL)
- .setPost(true)
- .setInternal(true)
- .setDescription("Stores that the user has skipped the onboarding tutorial and does not want to see it after future logins.<br/>" +
- "Requires authentication.")
- .setSince("6.5")
- .setHandler(this);
- }
-
- @Override
- public void handle(Request request, Response response) throws Exception {
- userSession.checkLoggedIn();
- try (DbSession dbSession = dbClient.openSession(false)) {
- String userLogin = userSession.getLogin();
- UserDto userDto = dbClient.userDao().selectActiveUserByLogin(dbSession, userLogin);
- checkState(userDto != null, "User login '%s' cannot be found", userLogin);
- if (!userDto.isOnboarded()) {
- userDto.setOnboarded(true);
- // no need to update Elasticsearch, the field onBoarded
- // is not indexed
- dbClient.userDao().update(dbSession, userDto);
- dbSession.commit();
- }
- }
- response.noContent();
- }
-}
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" height="20" width="${totalWidth}">
- <!-- SONARCLOUD MEASURE -->
- <linearGradient id="b" x2="0" y2="100%">
- <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
- <stop offset="1" stop-opacity=".1"/>
- </linearGradient>
- <clipPath id="a">
- <rect width="${totalWidth}" height="20" rx="3" fill="#fff"/>
- </clipPath>
- <g clip-path="url(#a)">
- <rect fill="#555" height="20" width="${leftWidth}"/>
- <rect fill="${color}" height="20" width="${rightWidth}" x="${leftWidth}"/>
- <rect fill="url(#b)" height="20" width="${totalWidth}"/>
- </g>
- <g fill="#fff" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11" text-anchor="left">
- <text x="${iconWidthPlusMargin}" y="15" textLength="${labelWidth}" fill="#010101" fill-opacity=".3">${label}</text>
- <text x="${iconWidthPlusMargin}" y="14" textLength="${labelWidth}">${label}</text>
- <text x="${leftWidthPlusMargin}" y="15" textLength="${valueWidth}" fill="#010101" fill-opacity=".3">${value}</text>
- <text x="${leftWidthPlusMargin}" y="14" textLength="${valueWidth}">${value}</text>
- </g>
- <path fill="#010101" fill-opacity=".3" d="M19.58682 9.81722A3.78893 3.78893 0 0 0 17.78048 8.603v-.04378a3.77165 3.77165 0 1 0-7.5433 0v.05069a3.77165 3.77165 0 1 0 3.78317 6.28186 3.7705 3.7705 0 0 0 5.56416-5.0688zm-2.91802 5.21164a2.8247 2.8247 0 0 1-2.8224-2.82124.47463.47463 0 0 0-.94925 0 3.7486 3.7486 0 0 0 .53223 1.9296 2.8201 2.8201 0 1 1-1.08058-4.57805h.01152a1.3202 1.3202 0 0 1 .30758.14745.4747.4747 0 0 0 .61748-.72115 2.1266 2.1266 0 0 0-.61402-.32371 3.75898 3.75898 0 0 0-1.29946-.2304h-.182a2.82125 2.82125 0 1 1 4.45478 2.4192.47462.47462 0 1 0 .55066.773 3.78317 3.78317 0 0 0 1.44806-2.0736 2.8224 2.8224 0 0 1-.97574 5.46969z"/>
- <path fill="#f3702a" d="M19.58682 9.09722A3.78893 3.78893 0 0 0 17.78048 7.883v-.04378a3.77165 3.77165 0 1 0-7.5433 0v.05069a3.77165 3.77165 0 1 0 3.78317 6.28186 3.7705 3.7705 0 0 0 5.56416-5.0688zm-2.91802 5.21164a2.8247 2.8247 0 0 1-2.8224-2.82124.47463.47463 0 0 0-.94925 0 3.7486 3.7486 0 0 0 .53223 1.9296 2.8201 2.8201 0 1 1-1.08058-4.57805h.01152a1.3202 1.3202 0 0 1 .30758.14745.4747.4747 0 0 0 .61748-.72115 2.1266 2.1266 0 0 0-.61402-.32371 3.75898 3.75898 0 0 0-1.29946-.2304h-.182a2.82125 2.82125 0 1 1 4.45478 2.4192.47462.47462 0 1 0 .55066.773 3.78317 3.78317 0 0 0 1.44806-2.0736 2.8224 2.8224 0 0 1-.97574 5.46969z"/>
-</svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 350 262.5" width="128px" height="96px">
- <!-- SONARCLOUD QUALITY GATE FAIL -->
- <path fill="#fff" d="M328.4 259.5H21.3c-10.6 0-19.5-8.7-19.5-19.5V22c0-10.6 8.7-19.5 19.5-19.5h307.1c10.6 0 19.5 8.7 19.5 19.5v218c0 10.8-8.9 19.5-19.5 19.5z"/>
- <path fill="#cfd3d7" d="M328.4 260.4H21.3C10.1 260.4.9 251.2.9 240V22c0-11.2 9.2-20.4 20.4-20.4h307.1c11.2 0 20.4 9.2 20.4 20.4v218c0 11.2-9.3 20.4-20.4 20.4zM21.3 3.4C11 3.4 2.7 11.7 2.7 22v218c0 10.3 8.3 18.6 18.6 18.6h307.1c10.3 0 18.6-8.3 18.6-18.6V22c0-10.3-8.3-18.6-18.6-18.6H21.3z"/>
- <path fill="#434447" d="M94.9 54.3c0 2.7-.4 5-1.3 7-.9 1.9-2.1 3.5-3.6 4.6l5 3.9-2.5 2.2-5.9-4.7c-.9.2-1.9.3-2.9.3-2.2 0-4.1-.5-5.8-1.6-1.7-1.1-3-2.6-3.9-4.6-.9-2-1.4-4.3-1.4-6.9v-2c0-2.7.5-5 1.4-7.1.9-2.1 2.2-3.6 3.9-4.7s3.6-1.6 5.8-1.6c2.2 0 4.2.5 5.9 1.6 1.7 1.1 3 2.6 3.9 4.7.9 2 1.4 4.4 1.4 7.1v1.8zm-3.6-1.8c0-3.3-.7-5.8-2-7.6-1.3-1.8-3.2-2.7-5.6-2.7-2.3 0-4.1.9-5.5 2.6-1.3 1.8-2 4.2-2.1 7.4v2c0 3.2.7 5.7 2 7.5 1.3 1.8 3.2 2.8 5.6 2.8 2.4 0 4.2-.9 5.5-2.6 1.3-1.7 2-4.2 2-7.4v-2zM112.8 65.3c-1.4 1.6-3.4 2.4-6.1 2.4-2.2 0-3.9-.6-5-1.9-1.2-1.3-1.7-3.2-1.7-5.7V46.6h3.5V60c0 3.1 1.3 4.7 3.8 4.7 2.7 0 4.5-1 5.4-3v-15h3.5v20.7h-3.4v-2.1zM134.4 67.3c-.2-.4-.4-1.1-.5-2.2-1.6 1.7-3.6 2.6-5.9 2.6-2 0-3.7-.6-5-1.7-1.3-1.2-2-2.6-2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2.2 7.6V58h-14c.1 2 .6 3.7 1.8 4.9 1.1 1.3 2.6 1.9 4.3 1.9 1.2 0 2.3-.3 3.2-.8.9-.5 1.6-1.2 2.3-2l2.2 1.7c-1.9 2.7-4.5 4-8 4zm-.4-18.6c-1.4 0-2.6.5-3.6 1.6-1 1-1.6 2.5-1.8 4.4h10.4v-.3c-.1-1.8-.6-3.2-1.5-4.2s-2.1-1.5-3.5-1.5z"/>
- <g>
- <path fill="#ed333a" d="M213 162.9h-77.2c-17.6 0-31.9-14.4-31.9-31.9 0-17.6 14.4-31.9 31.9-31.9H213c17.6 0 31.9 14.4 31.9 31.9 0 17.6-14.3 31.9-31.9 31.9z"/>
- <path fill="#fff" d="M156.1 132.3h-12v12.4h-6.2v-30.3h19.7v5.1h-13.5v7.8h12v5zM174.4 138.4h-11l-2.1 6.2h-6.6l11.3-30.3h5.8l11.4 30.3h-6.6l-2.2-6.2zm-9.3-5h7.6l-3.8-11.4-3.8 11.4zM192.6 144.7h-6.2v-30.3h6.2v30.3zM204.6 139.7h13.3v5h-19.5v-30.3h6.2v25.3z"/>
- </g>
- <g id="SonarCloud_Black">
- <path fill="#f3702a" d="M302.5 204.3c-1.6-1.9-3.7-3.3-6-4v-.1c0-6.9-5.6-12.5-12.5-12.5s-12.5 5.6-12.5 12.5v.2c-5.1 1.6-8.8 6.3-8.8 11.9 0 6.9 5.6 12.5 12.5 12.5 3.3 0 6.5-1.3 8.8-3.6 2.3 2.2 5.4 3.6 8.8 3.6 6.9 0 12.5-5.6 12.5-12.5 0-2.9-1-5.8-2.8-8zm-9.7 17.3c-5.2 0-9.4-4.2-9.4-9.4 0-.9-.7-1.6-1.6-1.6s-1.6.7-1.6 1.6c0 2.3.6 4.5 1.8 6.4-1.8 1.9-4.2 3-6.8 3-5.2 0-9.4-4.2-9.4-9.4s4.2-9.4 9.4-9.4c1.1 0 2.2.2 3.2.6.4.1.9.4 1 .5.7.6 1.7.5 2.2-.2.6-.7.5-1.7-.2-2.2-.7-.6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2.6-2.8-4.7-5.9-4.7-4.2 0-6.7 3.7-6.7 8.6 0 4.5 2.2 8.3 6.6 8.3 2.7 0 5.2-1.8 5.9-4.8.1-.6.2-1.1.2-1.8l.1-3.9z"/>
- </g>
-</svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 350 262.5" width="128px" height="96px">
- <!-- SONARCLOUD QUALITY GATE PASS -->
- <path fill="#fff" d="M328.4 259.5H21.5C10.9 259.5 2 250.8 2 240V21.9C2 11.3 10.7 2.4 21.5 2.4h307.1c10.6 0 19.5 8.7 19.5 19.5V240c-.2 10.8-8.8 19.5-19.7 19.5z"/>
- <path fill="#cfd3d7" d="M328.4 260.4H21.5c-11.2 0-20.4-9.2-20.4-20.4V21.9c0-11.2 9-20.4 20.4-20.4h307.1c11.2 0 20.4 9.2 20.4 20.4V240c-.2 11.2-9.2 20.4-20.6 20.4zM21.5 3.3c-10.3 0-18.6 8.3-18.6 18.6V240c0 10.3 8.3 18.6 18.6 18.6h307.1c10.3 0 18.6-8.3 18.6-18.6V21.9c0-10.3-8.3-18.6-18.6-18.6H21.5z"/>
- <path fill="#434447" d="M94.9 54.1c0 2.7-.4 5-1.3 7-.9 1.9-2.1 3.5-3.6 4.6l5 3.9-2.5 2.3-5.9-4.7c-.9.2-1.9.3-2.9.3-2.2 0-4.1-.5-5.8-1.6-1.7-1.1-3-2.6-3.9-4.6-.9-2-1.4-4.3-1.4-6.9v-2c0-2.7.5-5 1.4-7.1.9-2.1 2.2-3.6 3.9-4.7s3.6-1.6 5.8-1.6c2.2 0 4.2.5 5.9 1.6 1.7 1.1 3 2.6 3.9 4.7.9 2 1.4 4.4 1.4 7.1v1.7zm-3.6-1.8c0-3.3-.7-5.8-2-7.6-1.3-1.8-3.2-2.7-5.6-2.7-2.3 0-4.1.9-5.5 2.6-1.3 1.8-2 4.2-2.1 7.4v2c0 3.2.7 5.7 2 7.5 1.3 1.8 3.2 2.8 5.6 2.8s4.2-.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4.3.2 6.1h-3.6l-.2-3.6h-.1c-1.1 1.8-3.4 4.2-7.4 4.2-3.5 0-7.7-1.9-7.7-9.8v-13.1h4.1v12.4c0 4.2 1.3 7.1 5 7.1 2.7 0 4.6-1.9 5.3-3.7.2-.6.4-1.3.4-2.1v-13.7h4.1V216h-.1zM246.2 189.4v27c0 2 0 4.2.2 5.8h-3.6l-.2-3.9h-.1c-1.2 2.5-4 4.4-7.6 4.4-5.4 0-9.5-4.6-9.5-11.3 0-7.4 4.6-12 10-12 3.4 0 5.7 1.6 6.7 3.4h.1v-13.3l4-.1zm-4 19.5c0-.5 0-1.2-.2-1.7-.6-2.6-2.8-4.7-5.9-4.7-4.2 0-6.7 3.7-6.7 8.6 0 4.5 2.2 8.3 6.6 8.3 2.7 0 5.2-1.8 5.9-4.8.1-.6.2-1.1.2-1.8l.1-3.9z"/>
- </g>
-</svg>
\ No newline at end of file
+++ /dev/null
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 350 262.5" width="128px" height="96px">
- <!-- SONARCLOUD QUALITY GATE WARN -->
- <path fill="#fff" d="M328.4 259.5H21.3c-10.6 0-19.5-8.7-19.5-19.5V22c0-10.6 8.7-19.5 19.5-19.5h307.1c10.6 0 19.5 8.7 19.5 19.5v218c0 10.8-8.9 19.5-19.5 19.5z"/>
- <path fill="#cfd3d7" d="M328.4 260.4H21.3C10.1 260.4.9 251.2.9 240V22c0-11.2 9.2-20.4 20.4-20.4h307.1c11.2 0 20.4 9.2 20.4 20.4v218c0 11.2-9.3 20.4-20.4 20.4zM21.3 3.4C11 3.4 2.7 11.7 2.7 22v218c0 10.3 8.3 18.6 18.6 18.6h307.1c10.3 0 18.6-8.3 18.6-18.6V22c0-10.3-8.3-18.6-18.6-18.6H21.3z"/>
- <path fill="#434447" d="M94.9 54.3c0 2.7-.4 5-1.3 7-.9 1.9-2.1 3.5-3.6 4.6l5 3.9-2.5 2.2-5.9-4.7c-.9.2-1.9.3-2.9.3-2.2 0-4.1-.5-5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-2.6 0-4.3 1.4-4.8 3.6-.1.5-.1 1-.1 1.6v11.4h-7V207zM167.9 221.3c-1.1.6-3.4 1.3-6.4 1.3-6.7 0-11.1-4.6-11.1-11.4 0-6.9 4.7-11.9 12-11.9 2.4 0 4.5.6 5.6 1.2l-.9 3.1c-1-.6-2.5-1.1-4.7-1.1-5.1 0-7.9 3.8-7.9 8.4 0 5.2 3.3 8.3 7.7 8.3 2.3 0 3.8-.6 5-1.1l.7 3.2zM170.9 189.4h4.1v32.7h-4.1v-32.7zM200.1 210.8c0 8.3-5.7 11.9-11.1 11.9-6 0-10.7-4.4-10.7-11.5 0-7.5 4.9-11.9 11.1-11.9 6.4 0 10.7 4.7 10.7 11.5zm-17.7.2c0 4.9 2.8 8.6 6.8 8.6 3.9 0 6.8-3.6 6.8-8.7 0-3.8-1.9-8.6-6.7-8.6-4.8.1-6.9 4.5-6.9 8.7zM222.1 216c0 2.3 0 4.3.2 6.1h-3.6l-.2-3.6h-.1c-1.1 1.8-3.4 4.2-7.4 4.2-3.5 0-7.7-1.9-7.7-9.8v-13.1h4.1v12.4c0 4.2 1.3 7.1 5 7.1 2.7 0 4.6-1.9 5.3-3.7.2-.6.4-1.3.4-2.1v-13.7h4.1V216h-.1zM246.2 189.4v27c0 2 0 4.2.2 5.8h-3.6l-.2-3.9h-.1c-1.2 2.5-4 4.4-7.6 4.4-5.4 0-9.5-4.6-9.5-11.3 0-7.4 4.6-12 10-12 3.4 0 5.7 1.6 6.7 3.4h.1v-13.3l4-.1zm-4 19.5c0-.5 0-1.2-.2-1.7-.6-2.6-2.8-4.7-5.9-4.7-4.2 0-6.7 3.7-6.7 8.6 0 4.5 2.2 8.3 6.6 8.3 2.7 0 5.2-1.8 5.9-4.8.1-.6.2-1.1.2-1.8l.1-3.9z"/>
- </g>
-</svg>
\ No newline at end of file
"local": true,
"externalIdentity": "obiwan.kenobi",
"externalProvider": "sonarqube",
- "showOnboardingTutorial": false,
"scmAccounts": ["obiwan:github", "obiwan:bitbucket"],
"groups": ["Jedi", "Rebel"],
"usingSonarLintConnectedMode": false,
@Rule
public DbTester db = DbTester.create();
- private final MapSettings mapSettings = new MapSettings().setProperty("sonar.sonarcloud.enabled", false);
+ private final MapSettings mapSettings = new MapSettings();
private final Configuration config = mapSettings.asConfig();
private final WsActionTester ws = new WsActionTester(
new MeasureAction(
db.getDbClient(),
new ProjectBadgesSupport(new ComponentFinder(db.getDbClient(), null), db.getDbClient(), config),
- new SvgGenerator(mapSettings.asConfig())));
+ new SvgGenerator()));
@Before
public void before(){
@Rule
public DbTester db = DbTester.create();
- private final MapSettings mapSettings = new MapSettings().setProperty("sonar.sonarcloud.enabled", false).setProperty(CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY, false);
+ private final MapSettings mapSettings = new MapSettings().setProperty(CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY, false);
private final Configuration config = mapSettings.asConfig();
private final WsActionTester ws = new WsActionTester(
new QualityGateAction(db.getDbClient(),
new ProjectBadgesSupport(new ComponentFinder(db.getDbClient(), null), db.getDbClient(), config),
- new SvgGenerator(mapSettings.asConfig())));
+ new SvgGenerator()));
@Before
@Rule
public DbTester db = DbTester.create();
- private MapSettings mapSettings = new MapSettings();
-
private SvgGenerator underTest;
@Test
public void generate_badge() {
- mapSettings.setProperty("sonar.sonarcloud.enabled", false);
initSvgGenerator();
String result = underTest.generateBadge("label", "10", DEFAULT);
@Test
public void generate_quality_gate() {
- mapSettings.setProperty("sonar.sonarcloud.enabled", false);
initSvgGenerator();
String result = underTest.generateQualityGate(ERROR);
@Test
public void generate_deprecated_warning_quality_gate() {
- mapSettings.setProperty("sonar.sonarcloud.enabled", false);
initSvgGenerator();
String result = underTest.generateQualityGate(WARN);
@Test
public void generate_error() {
- mapSettings.setProperty("sonar.sonarcloud.enabled", false);
initSvgGenerator();
String result = underTest.generateError("Error");
@Test
public void fail_when_unknown_character() {
- mapSettings.setProperty("sonar.sonarcloud.enabled", false);
initSvgGenerator();
assertThatThrownBy(() -> underTest.generateError("Méssage with accent"))
}
private void initSvgGenerator() {
- underTest = new SvgGenerator(mapSettings.asConfig());
+ underTest = new SvgGenerator();
}
private void checkBadge(String svg, String expectedLabel, String expectedValue, SvgGenerator.Color expectedColorValue) {
private final ChangeLogLevelServiceModule underTest = new ChangeLogLevelServiceModule(webServer);
@Test
- public void provide_returns_ChangeLogLevelClusterService_if_cluster_not_on_SonarCloud() {
+ public void provide_returns_ChangeLogLevelClusterService() {
when(webServer.isStandalone()).thenReturn(false);
ListContainer container = new ListContainer();
"}");
}
- @Test
- public void return_sonarcloud_settings() {
- settings.setProperty("sonar.sonarcloud.enabled", true);
- settings.setProperty("sonar.prismic.accessToken", "secret");
- settings.setProperty("sonar.analytics.gtm.trackingId", "gtm_id");
- settings.setProperty("sonar.homepage.url", "https://s3/homepage.json");
- init();
-
- assertJson(call()).isSimilarTo("{" +
- " \"settings\": {" +
- " \"sonar.prismic.accessToken\": \"secret\"," +
- " \"sonar.analytics.gtm.trackingId\": \"gtm_id\"," +
- " \"sonar.homepage.url\": \"https://s3/homepage.json\"" +
- " }" +
- "}");
- }
-
@Test
public void return_developer_info_disabled_setting() {
init();
.setLocal(true)
.setExternalLogin("obiwan")
.setExternalIdentityProvider("sonarqube")
- .setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket"))
- .setOnboarded(false));
+ .setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket")));
userSession.logIn(user);
CurrentWsResponse response = call();
assertThat(response)
.extracting(CurrentWsResponse::getIsLoggedIn, CurrentWsResponse::getLogin, CurrentWsResponse::getName, CurrentWsResponse::getEmail, CurrentWsResponse::getAvatar,
CurrentWsResponse::getLocal,
- CurrentWsResponse::getExternalIdentity, CurrentWsResponse::getExternalProvider, CurrentWsResponse::getScmAccountsList, CurrentWsResponse::getShowOnboardingTutorial)
+ CurrentWsResponse::getExternalIdentity, CurrentWsResponse::getExternalProvider, CurrentWsResponse::getScmAccountsList)
.containsExactly(true, "obiwan.kenobi", "Obiwan Kenobi", "obiwan.kenobi@starwars.com", "f5aa64437a1821ffe8b563099d506aef", true, "obiwan", "sonarqube",
- newArrayList("obiwan:github", "obiwan:bitbucket"), true);
+ newArrayList("obiwan:github", "obiwan:bitbucket"));
}
@Test
.setExternalLogin("obiwan.kenobi")
.setExternalIdentityProvider("sonarqube")
.setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket"))
- .setOnboarded(true)
.setHomepageType("PROJECT")
.setHomepageParameter("UUID-of-the-death-star"));
userSession
assertThat(definition.isInternal()).isTrue();
assertThat(definition.responseExampleAsString()).isNotEmpty();
assertThat(definition.params()).isEmpty();
- assertThat(definition.changelog()).hasSize(3);
+ assertThat(definition.changelog()).hasSize(4);
}
private CurrentWsResponse call() {
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2022 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.user.ws;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.api.server.ws.WebService;
-import org.sonar.db.DbTester;
-import org.sonar.db.user.UserDto;
-import org.sonar.server.exceptions.UnauthorizedException;
-import org.sonar.server.tester.UserSessionRule;
-import org.sonar.server.ws.TestResponse;
-import org.sonar.server.ws.WsActionTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-public class SkipOnboardingTutorialActionTest {
-
- @Rule
- public UserSessionRule userSession = UserSessionRule.standalone();
-
- @Rule
- public DbTester db = DbTester.create();
-
-
- private WsActionTester ws = new WsActionTester(new SkipOnboardingTutorialAction(userSession, db.getDbClient()));
-
- @Test
- public void mark_user_as_onboarded() {
- UserDto user = db.users().insertUser(u -> u
- .setOnboarded(false));
- userSession.logIn(user);
-
- call();
-
- UserDto userDto = selectUser(user.getLogin());
- assertThat(userDto.isOnboarded()).isTrue();
- }
-
- @Test
- public void does_nothing_if_user_already_onboarded() {
- UserDto user = db.users().insertUser(u -> u
- .setOnboarded(true));
- userSession.logIn(user);
-
- call();
-
- UserDto userDto = selectUser(user.getLogin());
- assertThat(userDto.isOnboarded()).isTrue();
- assertThat(userDto.getUpdatedAt()).isEqualTo(user.getUpdatedAt());
- }
-
- @Test
- public void fail_for_anonymous() {
- userSession.anonymous();
-
- assertThatThrownBy(() -> call())
- .isInstanceOf(UnauthorizedException.class)
- .hasMessage("Authentication is required");
- }
-
- @Test
- public void fail_with_ISE_when_user_login_in_db_does_not_exist() {
- db.users().insertUser(usert -> usert.setLogin("another"));
- userSession.logIn("obiwan.kenobi");
-
- assertThatThrownBy(() -> call())
- .isInstanceOf(IllegalStateException.class)
- .hasMessage("User login 'obiwan.kenobi' cannot be found");
- }
-
- @Test
- public void response_has_no_content() {
- UserDto user = db.users().insertUser(u -> u.setOnboarded(false));
- userSession.logIn(user);
-
- TestResponse response = call();
-
- assertThat(response.getStatus()).isEqualTo(204);
- assertThat(response.getInput()).isEmpty();
- }
-
- @Test
- public void test_definition() {
- WebService.Action def = ws.getDef();
- assertThat(def.isPost()).isTrue();
- assertThat(def.isInternal()).isTrue();
- assertThat(def.since()).isEqualTo("6.5");
- assertThat(def.params()).isEmpty();
- assertThat(def.changelog()).isEmpty();
- }
-
- private TestResponse call() {
- return ws.newRequest().setMethod("POST").execute();
- }
-
- private UserDto selectUser(String userLogin) {
- UserDto userDto = db.getDbClient().userDao().selectByLogin(db.getSession(), userLogin);
- assertThat(userDto).isNotNull();
- return userDto;
- }
-
-}
*/
package org.sonar.server.platform.web;
-import com.google.common.collect.ImmutableSet;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletContext;
import org.apache.commons.io.IOUtils;
-import org.sonar.api.config.Configuration;
import org.sonar.server.platform.OfficialDistribution;
import org.sonar.server.platform.Platform;
import org.sonar.server.platform.Platform.Status;
import static com.google.common.base.Preconditions.checkState;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;
-import static org.sonar.process.ProcessProperties.Property.SONARCLOUD_ENABLED;
import static org.sonar.server.platform.Platform.Status.UP;
public class WebPagesCache {
private static final String INSTANCE_PLACEHOLDER = "%INSTANCE%";
private static final String OFFICIAL_PLACEHOLDER = "%OFFICIAL%";
- private static final String SONARCLOUD_INSTANCE_VALUE = "SonarCloud";
private static final String SONARQUBE_INSTANCE_VALUE = "SonarQube";
private static final String INDEX_HTML_PATH = "/index.html";
- private static final Set<String> HTML_PATHS = ImmutableSet.of(INDEX_HTML_PATH);
+ private static final Set<String> HTML_PATHS = Set.of(INDEX_HTML_PATH);
private final Platform platform;
- private final Configuration configuration;
private final OfficialDistribution officialDistribution;
private ServletContext servletContext;
private Map<String, String> indexHtmlByPath;
private Status status;
- public WebPagesCache(Platform platform, Configuration configuration, OfficialDistribution officialDistribution) {
+ public WebPagesCache(Platform platform, OfficialDistribution officialDistribution) {
this.platform = platform;
- this.configuration = configuration;
this.indexHtmlByPath = new HashMap<>();
this.officialDistribution = officialDistribution;
}
private String provide(String path) {
getClass().getResourceAsStream(INDEX_HTML_PATH);
- boolean isSonarCloud = configuration.getBoolean(SONARCLOUD_ENABLED.getKey()).orElse(false);
- String instance = isSonarCloud ? SONARCLOUD_INSTANCE_VALUE : SONARQUBE_INSTANCE_VALUE;
- return loadHtmlFile(path, status.name(), instance);
+ return loadHtmlFile(path, status.name());
}
- private String loadHtmlFile(String path, String serverStatus, String instance) {
+ private String loadHtmlFile(String path, String serverStatus) {
try (InputStream input = servletContext.getResourceAsStream(path)) {
String template = IOUtils.toString(requireNonNull(input), UTF_8);
return template
- .replaceAll(WEB_CONTEXT_PLACEHOLDER, servletContext.getContextPath())
- .replaceAll(SERVER_STATUS_PLACEHOLDER, serverStatus)
- .replaceAll(INSTANCE_PLACEHOLDER, instance)
- .replaceAll(OFFICIAL_PLACEHOLDER, String.valueOf(officialDistribution.check()));
+ .replace(WEB_CONTEXT_PLACEHOLDER, servletContext.getContextPath())
+ .replace(SERVER_STATUS_PLACEHOLDER, serverStatus)
+ .replace(INSTANCE_PLACEHOLDER, WebPagesCache.SONARQUBE_INSTANCE_VALUE)
+ .replace(OFFICIAL_PLACEHOLDER, String.valueOf(officialDistribution.check()));
} catch (Exception e) {
throw new IllegalStateException("Fail to load file " + path, e);
}
import org.junit.Before;
import org.junit.Test;
import org.mockito.stubbing.Answer;
-import org.sonar.api.config.internal.MapSettings;
import org.sonar.server.platform.OfficialDistribution;
import org.sonar.server.platform.Platform;
private ServletContext servletContext = mock(ServletContext.class);
- private OfficialDistribution officialDistribution = mock(OfficialDistribution.class);
- private Platform platform = mock(Platform.class);
- private MapSettings mapSettings = new MapSettings();
+ private final OfficialDistribution officialDistribution = mock(OfficialDistribution.class);
+ private final Platform platform = mock(Platform.class);
- private WebPagesCache underTest = new WebPagesCache(platform, mapSettings.asConfig(), officialDistribution);
+ private final WebPagesCache underTest = new WebPagesCache(platform, officialDistribution);
@Before
public void setUp() {
.contains("SonarQube");
}
- @Test
- public void sonarcloud_setting_is_false() {
- mapSettings.setProperty("sonar.sonarcloud.enabled", false);
- doInit();
-
- assertThat(underTest.getContent("/foo"))
- .contains("SonarQube");
- }
-
- @Test
- public void sonarcloud_setting_is_true() {
- mapSettings.setProperty("sonar.sonarcloud.enabled", true);
- doInit();
-
- assertThat(underTest.getContent("/foo"))
- .contains("SonarCloud");
- }
-
@Test
public void content_is_updated_when_status_has_changed() {
doInit();
}
if (!measure.isFromCore() && NEWLY_CORE_METRICS_KEYS.contains(measure.metric().key())) {
- logOnce(measure.metric().key(), "Metric '{}' is an internal metric computed by SonarQube/SonarCloud. Provided value is ignored.", measure.metric().key());
+ logOnce(measure.metric().key(), "Metric '{}' is an internal metric computed by SonarQube. Provided value is ignored.", measure.metric().key());
return;
}
@Rule
public ScannerMediumTester tester = new ScannerMediumTester()
- .setEdition(SonarEdition.SONARCLOUD)
+ .setEdition(SonarEdition.COMMUNITY)
.registerPlugin("xoo", new XooPlugin())
.addDefaultQProfile("xoo", "Sonar Way")
.addDefaultQProfile("xoo2", "Sonar Way");
@Rule
public ScannerMediumTester tester = new ScannerMediumTester()
- .setEdition(SonarEdition.SONARCLOUD)
+ .setEdition(SonarEdition.COMMUNITY)
.registerPlugin("xoo", new XooPlugin())
.addDefaultQProfile("xoo", "Sonar Way")
.addRules(new XooRulesDefinition())
public static final String ACTION_CREATE = "create";
public static final String ACTION_DEACTIVATE = "deactivate";
public static final String ACTION_UPDATE = "update";
- public static final String ACTION_SKIP_ONBOARDING_TUTORIAL = "skip_onboarding_tutorial";
public static final String ACTION_CURRENT = "current";
public static final String ACTION_UPDATE_IDENTITY_PROVIDER = "update_identity_provider";
public static final String ACTION_DISMISS_SONARLINT_AD = "dismiss_sonarlint_ad";
.setMediaType(MediaTypes.JSON)).content();
}
- /**
- *
- * This is part of the internal API.
- * This is a POST request.
- * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/users/skip_onboarding_tutorial">Further information about this action online (including a response example)</a>
- * @since 6.5
- */
- public void skipOnboardingTutorial() {
- call(
- new PostRequest(path("skip_onboarding_tutorial"))
- .setMediaType(MediaTypes.JSON)).content();
- }
-
/**
*
* This is part of the internal API.
repeated string scmAccounts = 8;
repeated string groups = 9;
optional Permissions permissions = 10;
- optional bool showOnboardingTutorial = 11;
+ reserved 11; // showOnboardingTutorial removed
optional string avatar = 12;
optional Homepage homepage = 13;
reserved 15; // settings removed