Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Oct 24, 2023
1 parent f21f657 commit 82a4295
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions src/repodynamics/actions/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions src/repodynamics/datatype.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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
Expand Down

0 comments on commit 82a4295

Please sign in to comment.