From d952ad7ea40acd5a252ece23b1abd69a369edcdd Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 24 Dec 2023 13:42:59 +0100 Subject: [PATCH 1/2] fix: more logging --- CHANGELOG.md | 4 ++++ .../playbook/GithubComponentFactory.java | 3 +++ .../refinedsites/playbook/SiteFactory.java | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b96e4f..3c7b027 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed + +- Fixed insufficient logging. + ## [0.2.2] - 2023-12-24 ### Fixed diff --git a/src/main/java/com/refinedmods/refinedsites/playbook/GithubComponentFactory.java b/src/main/java/com/refinedmods/refinedsites/playbook/GithubComponentFactory.java index 08dbab2..aeebb86 100644 --- a/src/main/java/com/refinedmods/refinedsites/playbook/GithubComponentFactory.java +++ b/src/main/java/com/refinedmods/refinedsites/playbook/GithubComponentFactory.java @@ -31,6 +31,7 @@ class GithubComponentFactory implements ComponentFactory { final GitHub github = GitHub.connectUsingOAuth(token); this.repo = github.getRepository(config.getFullRepository()); final Semver minVersion = new Semver(config.getMinimumVersion()); + log.info("Retrieving tags from GitHub repository"); for (final var tag : repo.listTags().toList()) { final String tagName = tag.getName(); if (!tagName.startsWith("v")) { @@ -46,6 +47,8 @@ class GithubComponentFactory implements ComponentFactory { "v" + version.getValue(), false )); + } else { + log.info("Ignoring version {}", version); } } validTags.add(new Tag( diff --git a/src/main/java/com/refinedmods/refinedsites/playbook/SiteFactory.java b/src/main/java/com/refinedmods/refinedsites/playbook/SiteFactory.java index 226eac3..7646cdc 100644 --- a/src/main/java/com/refinedmods/refinedsites/playbook/SiteFactory.java +++ b/src/main/java/com/refinedmods/refinedsites/playbook/SiteFactory.java @@ -28,8 +28,10 @@ import com.google.gson.GsonBuilder; import com.vdurmont.semver4j.Semver; import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; @AllArgsConstructor +@Slf4j public class SiteFactory { private static final Gson GSON = new GsonBuilder().create(); @@ -37,17 +39,25 @@ public class SiteFactory { public Site getSite() { try { + log.info("Loading playbook"); final Path playbookPath = rootPath.resolve("playbook.json"); final PlaybookConfig json = GSON.fromJson(Files.readString(playbookPath), PlaybookConfig.class); + log.info("Loaded playbook"); final List components = json.getComponents().stream().flatMap(component -> { + log.info("Loading component {}", component.getName()); final ComponentFactory factory = getComponentFactory(component); - return factory.getComponents(); + final List result = factory.getComponents().toList(); + log.info("Component config yielded {} components", result.size()); + return result.stream(); }).collect(Collectors.toList()); + log.info("Adding root component"); addRootComponent(components, json); final Map> componentsByName = components.stream().collect(Collectors.groupingBy( Component::getName )); + log.info("Retrieving releases"); final Map releasesByComponentName = getReleases(json); + log.info("Site building complete"); return new Site( json.getName(), json.getUrl(), @@ -121,9 +131,11 @@ private static String getGhToken() { private ComponentFactory getComponentFactory(final ComponentConfig component) { if (component.getGithub() != null) { + log.info("Loading components from GitHub for {}", component.getName()); return new GithubComponentFactory(rootPath, component.getGithub(), component.getName(), getGhToken()); } if (component.getPath() != null) { + log.info("Loading local component {}", component.getName()); return new LocalComponentFactory( rootPath.resolve(component.getPath()), component.getName(), @@ -135,6 +147,7 @@ private ComponentFactory getComponentFactory(final ComponentConfig component) { ) ); } + log.info("Loading empty component {}", component.getName()); return () -> Stream.of(Component.builder() .name(component.getName()) .rootPath(null) From 3769ffb55d3508795887941ef961648dc86c09d5 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 24 Dec 2023 12:43:42 +0000 Subject: [PATCH 2/2] chore: prepare release v0.2.3 --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c7b027..f8931bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.2.3] - 2023-12-24 + ### Fixed -- Fixed insufficient logging. +- Fixed insufficient logging. ## [0.2.2] - 2023-12-24 @@ -47,7 +49,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Initial release. -[Unreleased]: https://github.com/refinedmods/refinedsites/compare/v0.2.2...HEAD +[Unreleased]: https://github.com/refinedmods/refinedsites/compare/v0.2.3...HEAD + +[0.2.3]: https://github.com/refinedmods/refinedsites/compare/v0.2.2...v0.2.3 [0.2.2]: https://github.com/refinedmods/refinedsites/compare/v0.2.1...v0.2.2