Fix: linting errors fixed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 21s
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 30s
CI / typecheck (pull_request) Successful in 35s
CI / unit_tests (pull_request) Successful in 7m26s
CI / docker (pull_request) Successful in 1m0s
CI / benchmark-regression (pull_request) Successful in 20m7s
CI / coverage (pull_request) Successful in 48m7s
CI / integration_tests (pull_request) Successful in 2m21s
CI / quality (push) Successful in 18s
CI / lint (push) Successful in 21s
CI / build (push) Successful in 29s
CI / security (push) Successful in 36s
CI / typecheck (push) Successful in 59s
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Successful in 4m8s
CI / benchmark-publish (push) Successful in 11m33s
CI / unit_tests (push) Successful in 13m16s
CI / docker (push) Successful in 59s
CI / coverage (push) Successful in 23m28s
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 21s
CI / build (pull_request) Successful in 23s
CI / security (pull_request) Successful in 30s
CI / typecheck (pull_request) Successful in 35s
CI / unit_tests (pull_request) Successful in 7m26s
CI / docker (pull_request) Successful in 1m0s
CI / benchmark-regression (pull_request) Successful in 20m7s
CI / coverage (pull_request) Successful in 48m7s
CI / integration_tests (pull_request) Successful in 2m21s
CI / quality (push) Successful in 18s
CI / lint (push) Successful in 21s
CI / build (push) Successful in 29s
CI / security (push) Successful in 36s
CI / typecheck (push) Successful in 59s
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Successful in 4m8s
CI / benchmark-publish (push) Successful in 11m33s
CI / unit_tests (push) Successful in 13m16s
CI / docker (push) Successful in 59s
CI / coverage (push) Successful in 23m28s
This commit was merged in pull request #381.
This commit is contained in:
@@ -21,7 +21,6 @@ try:
|
||||
from cleveragents.domain.models.core.plan import (
|
||||
AutomationProfileProvenance,
|
||||
AutomationProfileRef,
|
||||
Plan,
|
||||
PlanPhase,
|
||||
ProcessingState,
|
||||
)
|
||||
@@ -34,7 +33,6 @@ except ModuleNotFoundError:
|
||||
from cleveragents.domain.models.core.plan import (
|
||||
AutomationProfileProvenance,
|
||||
AutomationProfileRef,
|
||||
Plan,
|
||||
PlanPhase,
|
||||
ProcessingState,
|
||||
)
|
||||
|
||||
@@ -172,7 +172,10 @@ def step_set_reversion_count(context: Context) -> None:
|
||||
)
|
||||
service: PlanLifecycleService = context.service
|
||||
plan_id = context.plan_id
|
||||
if plan.phase == PlanPhase.STRATEGIZE and plan.processing_state == ProcessingState.QUEUED:
|
||||
if (
|
||||
plan.phase == PlanPhase.STRATEGIZE
|
||||
and plan.processing_state == ProcessingState.QUEUED
|
||||
):
|
||||
service.start_strategize(plan_id)
|
||||
service.complete_strategize(plan_id)
|
||||
service.execute_plan(plan_id)
|
||||
@@ -324,7 +327,9 @@ def step_check_reversion_count(context: Context, count: int) -> None:
|
||||
assert context.plan.reversion_count == count
|
||||
|
||||
|
||||
@then('a reversion decision should be recorded with source "{source}" and target "{target}"')
|
||||
@then(
|
||||
'a reversion decision should be recorded with source "{source}" and target "{target}"'
|
||||
)
|
||||
def step_check_reversion_decision(context: Context, source: str, target: str) -> None:
|
||||
"""Verify a reversion decision was recorded."""
|
||||
decisions = context.plan.decisions
|
||||
@@ -351,8 +356,10 @@ def step_check_max_reversion_error(context: Context) -> None:
|
||||
"""Verify a PlanError was raised about max reversions."""
|
||||
assert context.raised_error is not None
|
||||
assert isinstance(context.raised_error, PlanError)
|
||||
assert "maximum reversion count" in str(context.raised_error).lower() or \
|
||||
"max" in str(context.raised_error).lower()
|
||||
assert (
|
||||
"maximum reversion count" in str(context.raised_error).lower()
|
||||
or "max" in str(context.raised_error).lower()
|
||||
)
|
||||
|
||||
|
||||
@then("the plan should remain in Apply phase")
|
||||
|
||||
@@ -1238,9 +1238,7 @@ class PlanLifecycleService:
|
||||
raise InvalidPhaseTransitionError(
|
||||
plan.phase,
|
||||
to_phase,
|
||||
message=(
|
||||
f"Cannot revert from {plan.phase.value} to {to_phase.value}"
|
||||
),
|
||||
message=(f"Cannot revert from {plan.phase.value} to {to_phase.value}"),
|
||||
)
|
||||
|
||||
return self._perform_reversion(plan, to_phase, reason or "manual reversion")
|
||||
|
||||
@@ -1928,8 +1928,7 @@ def revert_plan(
|
||||
except ValueError as exc:
|
||||
valid_phases = ", ".join(p.value for p in PlanPhase)
|
||||
console.print(
|
||||
f"[red]Invalid phase:[/red] {to_phase}. "
|
||||
f"Valid phases: {valid_phases}"
|
||||
f"[red]Invalid phase:[/red] {to_phase}. Valid phases: {valid_phases}"
|
||||
)
|
||||
raise typer.Abort() from exc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user