Skip to content

Commit e6bcaa1

Browse files
chore(git): add visibility to repo config (#245)
1 parent 6fc4ea1 commit e6bcaa1

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/codegen/git/schemas/enums.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ class DiffChangeType(StrEnum):
2727
DELETED = "D"
2828
RENAMED = "R"
2929
MODIFIED = "M"
30+
31+
32+
class RepoVisibility(StrEnum):
33+
PRIVATE = auto()
34+
PUBLIC = auto()
35+
INTERNAL = auto()

src/codegen/git/schemas/repo_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
from pydantic import BaseModel
55

6+
from codegen.git.schemas.enums import RepoVisibility
7+
68
logger = logging.getLogger(__name__)
79

810

@@ -19,6 +21,7 @@ class RepoConfig(BaseModel):
1921
id: int
2022
name: str
2123
full_name: str
24+
visibility: RepoVisibility | None = None
2225

2326
# Org fields
2427
organization_id: int

tests/integration/codegen/git/conftest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ def mock_config():
1818

1919

2020
@pytest.fixture(autouse=True)
21-
def repo_config() -> RepoConfig:
21+
def repo_config():
2222
with patch("codegen.git.utils.clone.get_authenticated_clone_url_for_repo_config") as mock_clone_url:
2323
mock_clone_url.return_value = "https://github.com/codegen-sh/Kevin-s-Adventure-Game.git"
24-
repo_config = RepoConfig(id=321, name="Kevin-s-Adventure-Game", full_name="codegen-sh/Kevin-s-Adventure-Game", organization_id="123", organization_name="codegen-sh")
24+
repo_config = RepoConfig(
25+
id=321,
26+
name="Kevin-s-Adventure-Game",
27+
full_name="codegen-sh/Kevin-s-Adventure-Game",
28+
organization_id="123",
29+
organization_name="codegen-sh",
30+
)
2531
yield repo_config

0 commit comments

Comments
 (0)