Skip to content

Commit 7c98d6d

Browse files
committed
Fix CI: mypy entity_ctx typing and commit validator repo
1 parent 9932235 commit 7c98d6d

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.ci/scripts/validate_commit_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
sys.exit("This PR is not ready for consumption.")
3838

3939
g = Github(os.environ.get("GITHUB_TOKEN"))
40-
repo = g.get_repo("pulp/pulp-cli-workflow")
40+
repo = g.get_repo("daviddavis/pulp-cli-workflow")
4141

4242

4343
def check_status(issue: str) -> None:

src/pulpcore/cli/workflow/workflow.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
pulp_command,
1313
)
1414

15-
from pulp_glue.common.context import DATETIME_FORMATS
15+
from pulp_glue.common.context import DATETIME_FORMATS, PulpEntityContext
1616
from pulp_glue.common.i18n import get_translation
1717
from pulp_glue.workflow.context import PulpWorkflowContext
1818

@@ -51,14 +51,16 @@
5151
@pass_pulp_context
5252
def create(
5353
pulp_ctx: PulpCLIContext,
54-
entity_ctx: PulpWorkflowContext,
54+
entity_ctx: PulpEntityContext,
5555
/,
5656
name: str,
5757
start_time: t.Optional[datetime],
5858
tasks: tuple[str, ...],
5959
pulp_labels: tuple[str, ...],
6060
) -> None:
6161
"""Create a workflow."""
62+
assert isinstance(entity_ctx, PulpWorkflowContext)
63+
6264
body: dict[str, t.Any] = {"name": name}
6365

6466
if start_time is not None:
@@ -95,10 +97,12 @@ def create(
9597
@pass_pulp_context
9698
def cancel(
9799
pulp_ctx: PulpCLIContext,
98-
entity_ctx: PulpWorkflowContext,
100+
entity_ctx: PulpEntityContext,
99101
/,
100102
) -> None:
101103
"""Cancel a waiting or running workflow."""
104+
assert isinstance(entity_ctx, PulpWorkflowContext)
105+
102106
entity = entity_ctx.entity
103107
if entity["state"] not in ("waiting", "running"):
104108
raise click.ClickException(

0 commit comments

Comments
 (0)