Skip to content

Commit

Permalink
fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
defreng committed May 28, 2023
1 parent b835ec8 commit 7d70f25
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 46 deletions.
78 changes: 39 additions & 39 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/foxops/cli/v1_compat_reconcile/reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import typer
from pydantic import SecretStr
from ruamel.yaml import YAML

from foxops.cli.v1_compat_reconcile.api import foxops_api
Expand Down Expand Up @@ -45,7 +46,7 @@ def cmd_reconcile(
raise typer.Exit(1)

logger.debug("configuring settings for reconciliation")
settings = Settings()
settings = Settings(static_token=SecretStr("dummysecret"))
logger.debug("configured settings", settings=settings)

logger.debug(
Expand Down Expand Up @@ -130,7 +131,6 @@ def expand_dir(path: Path) -> list[Path]:
)
incarnation_id = incarnation_before_update.id
dis_patch = DesiredIncarnationStatePatch(
template_repository=config.template_repository,
template_repository_version=config.template_repository_version,
template_data=config.template_data,
automerge=config.automerge,
Expand Down
10 changes: 5 additions & 5 deletions src/foxops/engine/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import copy
from dataclasses import asdict, dataclass
from pathlib import Path
from typing import Mapping
from typing import Annotated, Mapping

from pydantic import BaseModel, Field
from ruamel.yaml import YAML
Expand Down Expand Up @@ -65,10 +65,10 @@ def load_incarnation_state_from_string(incarnation_state: str) -> IncarnationSta
class VariableDefinition(BaseModel):
type: str = Field(..., description="The type of the variable")
description: str = Field(..., help="The description for this variable")
default: TemplateDataValue | None = Field(
None,
help="The default value for this variable (setting this makes the variable optional)",
)
default: Annotated[
TemplateDataValue | None,
Field(help="The default value for this variable (setting this makes the variable optional)"),
] = None

def is_required(self) -> bool:
return self.default is None
Expand Down
1 change: 1 addition & 0 deletions src/foxops/services/change.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ async def get_change_with_merge_request(self, change_id: int) -> ChangeWithMerge
if change_in_db.type != ChangeType.MERGE_REQUEST:
raise ValueError(f"Change {change_id} is not a merge request change.")
assert change_in_db.merge_request_id is not None
assert change_in_db.merge_request_branch_name is not None

status = await self._hoster.get_merge_request_status(
incarnation_repository=incarnation_in_db.incarnation_repository,
Expand Down
1 change: 1 addition & 0 deletions tests/services/test_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ async def initialized_incarnation(
target_directory=".",
template_repository=git_repo_template,
commit_sha="dummy",
merge_request_id=None,
)


Expand Down

0 comments on commit 7d70f25

Please sign in to comment.