We use strings to refer to file system directories and files across the code base. These strings can be found in functions as well as in classes (data classes, Pydantic models, configurations), as properties. Some examples below:
class MainSettings(BaseSettings):
model_config = SettingsConfigDict(env_prefix="INFRAHUB_")
docs_index_path: str = Field(
default="/opt/infrahub/docs/build/search-index.json",
description="Full path of saved json containing pre-indexed documentation",
)
class Worktree(BaseModel):
identifier: str
directory: str # Directory in the FS
commit: str
branch: Optional[str] = None
In an effort to consolidate the code base and make it consistent with using the pathlib module where appropriate, we should do the same for class properties referring to directories or files.
Component
API Server / GraphQL, Git Integration, Python SDK
Task Description
We use strings to refer to file system directories and files across the code base. These strings can be found in functions as well as in classes (data classes, Pydantic models, configurations), as properties. Some examples below:
In an effort to consolidate the code base and make it consistent with using the
pathlib
module where appropriate, we should do the same for class properties referring to directories or files.