-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactored to use common git file repository class (#568)
secureli-XXX This PR refactors GitRepo and RepoFilesRepository classes into a common GitRepo class which is an implementation of a new abstract class VersionControlRepoAbstraction. VersionControlRepoAbstraction replaces the RepoAbstraction class. ## Changes <!-- A detailed list of changes --> * ## Testing <!-- Mention updated tests and any manual testing performed. Are aspects not yet tested or not easily testable? Feel free to include screenshots if appropriate. --> * ## Clean Code Checklist <!-- This is here to support you. Some/most checkboxes may not apply to your change --> - [x] Meets acceptance criteria for issue - [ ] New logic is covered with automated tests - [ ] Appropriate exception handling added - [ ] Thoughtful logging included - [ ] Documentation is updated - [ ] Follow-up work is documented in TODOs - [ ] TODOs have a ticket associated with them - [ ] No commented-out code included <!-- Github-flavored markdown reference: https://docs.github.com/en/get-started/writing-on-github --> --------- Co-authored-by: Ian Bowden <ian.bowden@slalom>
- Loading branch information
1 parent
cba32c3
commit 7707615
Showing
11 changed files
with
96 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
secureli/modules/shared/abstractions/version_control_repo.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from abc import ABC, abstractmethod | ||
from pathlib import Path | ||
|
||
|
||
class VersionControlRepoAbstraction(ABC): | ||
""" | ||
Abstracts common version control repository functions | ||
""" | ||
|
||
@abstractmethod | ||
def list_repo_files(self, folder_path: Path) -> list[Path]: | ||
pass | ||
|
||
@abstractmethod | ||
def list_staged_files(self, folder_path: Path) -> list[Path]: | ||
pass | ||
|
||
@abstractmethod | ||
def load_file(self, file_path: Path) -> str: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.