Skip to content

Commit

Permalink
- Experiments.
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpojer committed Jun 25, 2024
1 parent 928c5fb commit 092aee2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/github_integration/model/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,9 @@ def __merge_commit_author(self) -> Optional[str]:
return None

return self.__merge_commits[0].author

def register_commit(self, commit: Commit):
if self.__merge_commits is None:
self.__merge_commits = []

self.__merge_commits.append(commit)
9 changes: 9 additions & 0 deletions src/release_notes/model/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Optional

from github_integration.github_manager import GithubManager
from github_integration.model.commit import Commit
from github_integration.model.issue import Issue
from github_integration.model.pull_request import PullRequest

Expand Down Expand Up @@ -135,6 +136,14 @@ def pull_request(self, index: int = 0) -> PullRequest:
def register_pull_request(self, pull):
self.__pulls.append(pull)

def register_commit(self, pull_nr: int, commit: Commit):
for pull in self.__pulls:
if pull.number == pull_nr:
pull.register_commit(commit)
return

logging.error(f"Commit {commit.sha} not registered in any PR of record {self.__gh_issue.number}")

# TODO add user defined row format feature
# - what else replaceable information could be interesting?
def to_chapter_row(self, row_format="", increment_in_chapters=True) -> str:
Expand Down

0 comments on commit 092aee2

Please sign in to comment.