From 82a42953d84d5dfd8bf707e574dfee1c38e4d560 Mon Sep 17 00:00:00 2001 From: RepoDynamicsBot <80158628+AAriam@users.noreply.github.com> Date: Tue, 24 Oct 2023 20:25:23 +0200 Subject: [PATCH] fix --- pyproject.toml | 2 +- src/repodynamics/actions/init.py | 5 +++++ src/repodynamics/datatype.py | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f8a03b3a..4a93daeb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ namespaces = true # ----------------------------------------- Project Metadata ------------------------------------- # [project] -version = "0.0.0.dev152" +version = "0.0.0.dev153" name = "RepoDynamics" dependencies = [ "packaging >= 23.2, < 24", diff --git a/src/repodynamics/actions/init.py b/src/repodynamics/actions/init.py index 7cb87b01..1a613f98 100644 --- a/src/repodynamics/actions/init.py +++ b/src/repodynamics/actions/init.py @@ -334,7 +334,9 @@ def event_pull_request(self): ) commits = self.get_commits() + self.logger.success(f"Found {len(commits)} commits.") for commit in commits: + self.logger.info(f"Processing commit: {commit}") if commit.group_data.group == CommitGroup.SECONDARY_CUSTOM: changelog_manager.add_change( changelog_id=commit.group_data.changelog_id, @@ -343,6 +345,7 @@ def event_pull_request(self): change_details=commit.msg.body, ) entries = changelog_manager.get_all_entries() + self.logger.success(f"Found {len(entries)} changelog entries.", str(entries)) curr_body = self.pull_body.strip() if self.pull_body else "" if curr_body: curr_body += "\n\n" @@ -1143,6 +1146,7 @@ def get_commits(self) -> list[Commit]: # + list(self.metadata["commit"]["secondary_custom"].keys()) # ) commits = self.git.get_commits(f"{self.hash_before}..{self.hash_after}") + self.logger.success("Read commits from git history", json.dumps(commits, indent=4)) parser = CommitParser(types=self.meta.manager.get_all_conventional_commit_types()) parsed_commits = [] for commit in commits: @@ -1239,6 +1243,7 @@ def assemble_summary(self) -> tuple[str, str]: ) summaries = html.ElementCollection(self.summary_sections) path_logs = self.meta.input_path.dir_local_log_repodynamics_action + path_logs.mkdir(parents=True, exist_ok=True) with open(path_logs / "log.html", "w") as f: f.write(str(logs)) with open(path_logs / "report.html", "w") as f: diff --git a/src/repodynamics/datatype.py b/src/repodynamics/datatype.py index becc83bd..b4f13821 100644 --- a/src/repodynamics/datatype.py +++ b/src/repodynamics/datatype.py @@ -213,6 +213,9 @@ def action(self) -> PrimaryActionCommitType: def conv_type(self) -> str: return self._conv_type + def __repr__(self): + return f"PrimaryActionCommit(action={self.action}, conv_type={self.conv_type})" + class PrimaryCustomCommit(GroupedCommit): def __init__(self, group_id: str, conv_type: str): @@ -229,6 +232,9 @@ def id(self) -> str: def conv_type(self) -> str: return self._conv_type + def __repr__(self): + return f"PrimaryCustomCommit(id={self.id}, conv_type={self.conv_type})" + class SecondaryActionCommit(GroupedCommit): def __init__(self, action: SecondaryActionCommitType, conv_type: str): @@ -245,6 +251,9 @@ def action(self) -> SecondaryActionCommitType: def conv_type(self) -> str: return self._conv_type + def __repr__(self): + return f"SecondaryActionCommit(action={self.action}, conv_type={self.conv_type})" + class SecondaryCustomCommit(GroupedCommit): def __init__(self, conv_type: str, changelog_id: str, changelog_section_id: str): @@ -266,12 +275,22 @@ def changelog_id(self) -> str: def changelog_section_id(self) -> str: return self._changelog_section_id + def __repr__(self): + return ( + f"SecondaryCustomCommit(" + f"conv_type={self.conv_type}, changelog_id={self.changelog_id}, " + f"changelog_section_id={self.changelog_section_id})" + ) + class NonConventionalCommit(GroupedCommit): def __init__(self): super().__init__(CommitGroup.NON_CONV) return + def __repr__(self): + return "NonConventionalCommit()" + class Commit(NamedTuple): hash: str