@Test public void should_create_hidden_property() { PropertyDefinition def = PropertyDefinition.builder("hello") .name("Hello") .hidden() .build(); assertThat(def.key()).isEqualTo("hello"); assertThat(def.qualifiers()).isEmpty(); assertThat(def.global()).isFalse(); }
@Test public void does_not_return_hidden_properties() { logInAsAdmin(db.getDefaultOrganization()); propertyDefinitions.addComponent(PropertyDefinition.builder("foo").hidden().build()); ListDefinitionsWsResponse result = executeRequest(); assertThat(result.getDefinitionsList()).isEmpty(); }
.type(BOOLEAN) .defaultValue(String.valueOf(false)) .hidden() .build(), PropertyDefinition.builder(DISABLE_NOTIFICATION_ON_BUILT_IN_QPROFILES) .category(CATEGORY_ORGANIZATIONS) .type(BOOLEAN) .hidden() .build(), PropertyDefinition.builder(ORGANIZATIONS_CREATE_PERSONAL_ORG) .category(CATEGORY_ORGANIZATIONS) .type(BOOLEAN) .hidden() .build())); return defs;
.type(BOOLEAN) .defaultValue(String.valueOf(false)) .hidden() .build(), PropertyDefinition.builder(DISABLE_NOTIFICATION_ON_BUILT_IN_QPROFILES) .category(CATEGORY_ORGANIZATIONS) .type(BOOLEAN) .hidden() .build(), PropertyDefinition.builder(ORGANIZATIONS_CREATE_PERSONAL_ORG) .category(CATEGORY_ORGANIZATIONS) .type(BOOLEAN) .hidden() .build())); return defs;
.subCategory(GENERAL_SUBCATEGORY) .category(TYPESCRIPT_CATEGORY) .hidden() .build(), PropertyDefinition.builder(TS_EXCLUSIONS_KEY)
.subCategory(SUBCATEGORY).index(5).onlyOnQualifiers(Qualifiers.PROJECT).build(), PropertyDefinition.builder(GITLAB_COMMIT_SHA).name("GitLab Commit SHA").description("The commit revision for which project is built.").category(CATEGORY) .subCategory(SUBCATEGORY).index(6).hidden().multiValues(true).build(), PropertyDefinition.builder(GITLAB_REF_NAME).name("GitLab Ref Name").description("The commit revision for which project is built.").category(CATEGORY).subCategory(SUBCATEGORY) .index(7).hidden().build(), PropertyDefinition.builder(GITLAB_MAX_BLOCKER_ISSUES_GATE).name("Max Blocker Issues Gate").description("Max blocker issues to make the status fail.").category(CATEGORY) .subCategory(SUBCATEGORY).type(PropertyType.INTEGER).defaultValue(String.valueOf(0)).onlyOnQualifiers(Qualifiers.PROJECT).index(9).build(), .type(PropertyType.BOOLEAN).defaultValue(String.valueOf(false)).index(15).build(), PropertyDefinition.builder(GITLAB_ONLY_ISSUE_FROM_COMMIT_FILE).name("Show issue for commit file only").description("Issues will be reported if in current commit") .category(CATEGORY).subCategory(SUBCATEGORY).type(PropertyType.BOOLEAN).defaultValue(String.valueOf(false)).index(16).hidden().build(), PropertyDefinition.builder(GITLAB_BUILD_INIT_STATE).name("Build Initial State").description("State that should be the first when build commit status update is called.") .category(CATEGORY).subCategory(SUBCATEGORY).type(PropertyType.SINGLE_SELECT_LIST) .type(PropertyType.BOOLEAN).defaultValue(String.valueOf(false)).index(23).build(), PropertyDefinition.builder(GITLAB_ONLY_ISSUE_FROM_COMMIT_LINE).name("Show issue for commit line only").description("Issues will be reported if in current commit") .category(CATEGORY).subCategory(SUBCATEGORY).type(PropertyType.BOOLEAN).defaultValue(String.valueOf(false)).index(24).hidden().build(), PropertyDefinition.builder(GITLAB_PREFIX_DIRECTORY).name("Prefix directory for GitLab link").description("Add prefix for GitLab link").category(CATEGORY).subCategory(SUBCATEGORY) .type(PropertyType.STRING).defaultValue("").index(24).build(),
builder.add(PropertyDefinition.builder(SonarComponents.FAIL_ON_EXCEPTION_KEY) .defaultValue("false") .hidden() .name("Fail on exceptions") .description("when set to true, if an exception is thrown by the analyzer the analysis will fail") builder.add(PropertyDefinition.builder(SonarComponents.COLLECT_ANALYSIS_ERRORS_KEY) .defaultValue("false") .hidden() .name("Collect analysis error") .description("when set to true, if an exception is thrown by the analyzer, feedback will be collected and sent to server")
.name("Organization key") .description("Key of the organization that contains the project being analyzed. If unset, then the organization marked as default is used.") .hidden() .build(), PropertyDefinition.builder(BRANCH_NAME) .name("Optional name of SonarQube/SCM branch") .description("Provide a name for the branch being analyzed. It might match an existing branch of the project, otherwise a new branch will be created.") .hidden() .build(), PropertyDefinition.builder(BRANCH_TARGET) "Defines the target branch of the branch being analyzed. The main branch cannot have a target. " + "If no target is defined, the main branch is used as the target.") .hidden() .build(), PropertyDefinition.builder(PULL_REQUEST_BRANCH) .name("Optional name of pull request") .description("Provide a name for the pull request being analyzed. It might match an existing pull request of the project, otherwise a new pull request will be created.") .hidden() .build(), PropertyDefinition.builder(PULL_REQUEST_BASE) "Defines the target branch of the pull request being analyzed. " + "If no target is defined, the main branch is used as the target.") .hidden() .build());
.name("Skip design analysis") .type(PropertyType.BOOLEAN) .hidden() .build(),
.name("Generate XML Report") .type(PropertyType.BOOLEAN) .hidden() .build(),
public static List<PropertyDefinition> getProperties() { ImmutableList.Builder<PropertyDefinition> extensions = ImmutableList.builder(); extensions.add(PropertyDefinition.builder(SONAR_JAVA_BINARIES) .description("Comma-separated paths to directories containing the binary files (directories with class files).") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_LIBRARIES) .description("Comma-separated paths to libraries required by the project.") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_TEST_BINARIES) .description("Comma-separated paths to directories containing the binary files (directories with class files).") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_TEST_LIBRARIES) .description("Comma-separated paths to libraries required by the project.") .hidden() .build() ); return extensions.build(); } }
public static List<PropertyDefinition> getProperties() { ImmutableList.Builder<PropertyDefinition> extensions = ImmutableList.builder(); extensions.add(PropertyDefinition.builder(SONAR_JAVA_BINARIES) .description("Comma-separated paths to directories containing the binary files (directories with class files).") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_LIBRARIES) .description("Comma-separated paths to libraries required by the project.") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_TEST_BINARIES) .description("Comma-separated paths to directories containing the binary files (directories with class files).") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_TEST_LIBRARIES) .description("Comma-separated paths to libraries required by the project.") .hidden() .build() ); return extensions.build(); } }
public static List<PropertyDefinition> getProperties() { ImmutableList.Builder<PropertyDefinition> extensions = ImmutableList.builder(); extensions.add(PropertyDefinition.builder(SONAR_JAVA_BINARIES) .description("Comma-separated paths to directories containing the binary files (directories with class files).") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_LIBRARIES) .description("Comma-separated paths to libraries required by the project.") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_TEST_BINARIES) .description("Comma-separated paths to directories containing the binary files (directories with class files).") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_TEST_LIBRARIES) .description("Comma-separated paths to libraries required by the project.") .hidden() .build() ); return extensions.build(); } }
@SuppressWarnings("rawtypes") @Override public List getExtensions() { return Arrays .asList(PropertyDefinition.builder(CheckstyleConstants.CHECKER_FILTERS_KEY) .defaultValue(CheckstyleConstants.CHECKER_FILTERS_DEFAULT_VALUE) .category(CoreProperties.CATEGORY_JAVA) .subCategory(CHECKSTYLE_SUB_CATEGORY_NAME) .name("Checker Filters") .description(CHECKER_FILTERS_DESCRIPTION) .type(PropertyType.TEXT) .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE).build(), PropertyDefinition.builder(CheckstyleConstants.TREEWALKER_FILTERS_KEY) .defaultValue(CheckstyleConstants.TREEWALKER_FILTERS_DEFAULT_VALUE) .category(CoreProperties.CATEGORY_JAVA) .subCategory(CHECKSTYLE_SUB_CATEGORY_NAME) .name("Treewalker Filters") .description(TREEWALKER_FILTERS_DESCRIPTION) .type(PropertyType.TEXT) .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE).build(), PropertyDefinition.builder(CheckstyleConfiguration.PROPERTY_GENERATE_XML) .defaultValue("false").category(CoreProperties.CATEGORY_JAVA) .subCategory(CHECKSTYLE_SUB_CATEGORY_NAME) .name("Generate XML Report").type(PropertyType.BOOLEAN).hidden() .build(), CheckstyleSensor.class, CheckstyleConfiguration.class, CheckstyleExecutor.class, CheckstyleAuditListener.class, CheckstyleProfileExporter.class, CheckstyleProfileImporter.class, CheckstyleRulesDefinition.class); }
public static List<PropertyDefinition> getProperties() { ImmutableList.Builder<PropertyDefinition> extensions = ImmutableList.builder(); extensions.add(PropertyDefinition.builder(SONAR_JAVA_BINARIES) .description("Comma-separated paths to directories containing the binary files (directories with class files).") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_LIBRARIES) .description("Comma-separated paths to libraries required by the project.") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_TEST_BINARIES) .description("Comma-separated paths to directories containing the binary files (directories with class files).") .hidden() .build() ); extensions.add(PropertyDefinition.builder(SONAR_JAVA_TEST_LIBRARIES) .description("Comma-separated paths to libraries required by the project.") .hidden() .build() ); return extensions.build(); } }
@Override public List getExtensions() { return ImmutableList.of( PropertyDefinition.builder(PmdConfiguration.PROPERTY_GENERATE_XML) .defaultValue("false") .name("Generate XML Report") .hidden() .build(), PmdSensor.class, PmdConfiguration.class, PmdExecutor.class, PmdRulesDefinition.class, PmdUnitTestsRulesDefinition.class, PmdProfileExporter.class, PmdProfileImporter.class, PmdViolationRecorder.class); }
.name("Organization key") .description("Key of the organization that contains the project being analyzed. If unset, then the organization marked as default is used.") .hidden() .build(), PropertyDefinition.builder(BRANCH_NAME) .name("Optional name of SonarQube/SCM branch") .description("Provide a name for the branch being analyzed. It might match an existing branch of the project, otherwise a new branch will be created.") .hidden() .build(), PropertyDefinition.builder(BRANCH_TARGET) "Defines the target branch of the branch being analyzed. The main branch cannot have a target. " + "If no target is defined, the main branch is used as the target.") .hidden() .build(), PropertyDefinition.builder(PULL_REQUEST_BRANCH) .name("Optional name of pull request") .description("Provide a name for the pull request being analyzed. It might match an existing pull request of the project, otherwise a new pull request will be created.") .hidden() .build(), PropertyDefinition.builder(PULL_REQUEST_BASE) "Defines the target branch of the pull request being analyzed. " + "If no target is defined, the main branch is used as the target.") .hidden() .build());
@Test public void should_not_authorize_defining_ony_on_qualifiers_and_hidden() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Cannot be hidden and defining qualifiers on which to display"); PropertyDefinition.builder("foo").name("foo").onlyOnQualifiers(Qualifiers.PROJECT).hidden().build(); }
@Test public void remove_hidden_setting() { logInAsSystemAdministrator(); definitions.addComponent(PropertyDefinition.builder("foo").hidden().build()); propertyDb.insertProperties(newGlobalPropertyDto().setKey("foo").setValue("one")); executeRequestOnGlobalSetting("foo"); assertGlobalPropertyDoesNotExist("foo"); }
@Test public void should_not_authorize_defining_on_qualifiers_and_hidden() { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Cannot be hidden and defining qualifiers on which to display"); PropertyDefinition.builder("foo").name("foo").onQualifiers(Qualifiers.PROJECT).hidden().build(); }