Skip to content

Commit

Permalink
#569: Remove warning for missing release_config.yml (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada authored May 13, 2024
1 parent 50ca28c commit 5bf476a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 251 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public class DeletedFilesValidator implements Validator {
Path.of(GITHUB_WORKFLOWS, "release_droid_print_quick_checksum.yml"), RELEASE_DROID_WORKFLOW_WARNING,
Path.of(GITHUB_WORKFLOWS, "release_droid_release_on_maven_central.yml"), RELEASE_DROID_WORKFLOW_WARNING,
Path.of(GITHUB_WORKFLOWS, "release_droid_upload_github_release_assets.yml"), RELEASE_DROID_WORKFLOW_WARNING,
Path.of(GITHUB_WORKFLOWS, "release_droid_prepare_original_checksum.yml"), RELEASE_DROID_WORKFLOW_WARNING);
Path.of(GITHUB_WORKFLOWS, "release_droid_prepare_original_checksum.yml"), RELEASE_DROID_WORKFLOW_WARNING,
Path.of("release_config.yml"), "Release-droid configuration is replaced by release.yml");
private final Path projectDirectory;

/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public FileTemplatesFactory(final Logger logger, final String ownVersion, final
List<FileTemplate> getGlobalTemplates(final List<AnalyzedSource> sources) {
final List<FileTemplate> templates = new ArrayList<>();
templates.add(new FileTemplateFromResource(".github/workflows/broken_links_checker.yml", REQUIRE_EXACT));
templates.add(new FileTemplateFromResource("release_config.yml", REQUIRE_EXIST));
templates.add(new FileTemplateFromResource(".vscode/settings.json", REQUIRE_EXIST));
final Optional<AnalyzedSource> mvnRoot = sources.stream().filter(this::isMvnRootProject).findFirst();
templates.add(new FileTemplateFromResource("templates/gitattributes", ".gitattributes", REQUIRE_EXIST)
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

//[utest->dsn~required-files-validator~1]
class ProjectFilesValidatorTest {
private static final String VSCODE_SETTINGS_JSON = ".vscode/settings.json";
private static final String OWN_VERSION = "version";
private static final Set<ProjectKeeperModule> DEFAULT_MODULE = Set.of(ProjectKeeperModule.DEFAULT);

Expand Down Expand Up @@ -77,17 +78,17 @@ void testFixDifferentContent() throws IOException {
void testMissingFileWithAnyContent() throws IOException {
final ProjectFilesValidator validator = testee();
fixAllFindings(validator);
final Path testFile = this.tempDir.resolve("release_config.yml");
final Path testFile = this.tempDir.resolve(VSCODE_SETTINGS_JSON);
deleteFile(testFile);
assertThat(validator, validationErrorMessages(
contains("E-PK-CORE-17: Missing required file: '" + testFile.getFileName() + "'")));
contains("E-PK-CORE-17: Missing required file: '" + VSCODE_SETTINGS_JSON + "'")));
}

@Test
void testRequireExistsIgnoresContent() throws IOException {
final ProjectFilesValidator validator = testee();
fixAllFindings(validator);
final Path testFile = this.tempDir.resolve("release_config.yml");
final Path testFile = this.tempDir.resolve(VSCODE_SETTINGS_JSON);
changeFile(testFile);
assertThat(validator, hasNoValidationFindings());
}
Expand All @@ -96,7 +97,7 @@ void testRequireExistsIgnoresContent() throws IOException {
void testRequireExistsDoesNotModifyContent() throws IOException {
final ProjectFilesValidator validator = testee();
fixAllFindings(validator);
final Path testFile = this.tempDir.resolve("release_config.yml");
final Path testFile = this.tempDir.resolve(VSCODE_SETTINGS_JSON);
changeFile(testFile);
assertAll(() -> assertThat(validator, hasNoMoreFindingsAfterApplyingFixes()),
() -> assertThat(new String(Files.readAllBytes(testFile), StandardCharsets.UTF_8),
Expand All @@ -107,7 +108,7 @@ void testRequireExistsDoesNotModifyContent() throws IOException {
void testFixMissingFileWithAnyContent() throws IOException {
final ProjectFilesValidator validator = testee();
fixAllFindings(validator);
final Path testFile = this.tempDir.resolve("release_config.yml");
final Path testFile = this.tempDir.resolve(VSCODE_SETTINGS_JSON);
deleteFile(testFile);
assertAll(() -> assertThat(validator, hasNoMoreFindingsAfterApplyingFixes()),
() -> assertTrue(Files.exists(testFile),
Expand Down
7 changes: 0 additions & 7 deletions release_config.yml

This file was deleted.

0 comments on commit 5bf476a

Please sign in to comment.