Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stage_all_and_commit to work with v0 and v1 #59

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions ge_releaser/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,3 @@ class GxFile(str, enum.Enum):
TEAMS = ".github/teams.yml"
DOCS_DATA_COMPONENT = "docs/docusaurus/docs/components/_data.jsx"
DOCS_CONFIG = "docs/docusaurus/docusaurus.config.js"


FILES_TO_COMMIT = (
GxFile.CHANGELOG_MD_V1,
GxFile.CHANGELOG_MD_V0,
GxFile.DOCS_DATA_COMPONENT,
GxFile.DOCS_CONFIG,
GxFile.DEPLOYMENT_VERSION,
)
10 changes: 8 additions & 2 deletions ge_releaser/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import github
from github.PullRequest import PullRequest

from ge_releaser.constants import FILES_TO_COMMIT
from ge_releaser.constants import GxFile


class GitService:
Expand Down Expand Up @@ -59,7 +59,13 @@ def verify_no_untracked_files(self) -> None:
)

def stage_all_and_commit(self, message: str) -> None:
self._git.git.add([file_class.value for file_class in FILES_TO_COMMIT])
files_to_commit = [
GxFile.CHANGELOG_MD_V0 if self.trunk_is_0ver else GxFile.CHANGELOG_MD_V1,
GxFile.DOCS_DATA_COMPONENT,
GxFile.DOCS_CONFIG,
GxFile.DEPLOYMENT_VERSION,
]
self._git.git.add([file.value for file in files_to_commit])
self._git.git.commit("-m", message, "--no-verify")

def get_release_timestamp(self, version: str) -> dt.datetime:
Expand Down