Skip to content
Snippets Groups Projects
Verified Commit ba99996e authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

add input step that prompts for Sharepoint checklist creation

Adds new entry to oss-params for sharepoint checklist site url
parent c21df0e3
No related branches found
No related tags found
1 merge request!170add input step that prompts for Sharepoint checklist creation
......@@ -91,5 +91,8 @@
"starttls_enabled": true,
"smtp_username": "username",
"smtp_password": "password"
},
"SHAREPOINT": {
"checklist_site_url": "https://example.sharepoint.com/sites/example-site"
}
}
......@@ -166,6 +166,13 @@ class EmailParams(BaseSettings):
smtp_password: str | None
class SharepointParams(BaseSettings):
"""Settings for different Sharepoint sites."""
# TODO: Stricter typing after pydantic 2.x upgrade
checklist_site_url: str
class OSSParams(BaseSettings):
"""The set of parameters required for running :term:`GSO`."""
......@@ -177,6 +184,7 @@ class OSSParams(BaseSettings):
CELERY: CeleryParams
THIRD_PARTY_API_KEYS: dict[str, str]
EMAIL: EmailParams
SHAREPOINT: SharepointParams
def load_oss_params() -> OSSParams:
......
......@@ -14,12 +14,13 @@ from pydantic import validator
from pydantic_forms.core import ReadOnlyField
from gso.products.product_blocks.router import RouterRole
from gso.products.product_types.router import RouterInactive
from gso.products.product_types.router import RouterInactive, RouterProvisioning
from gso.products.product_types.site import Site
from gso.services import infoblox, subscriptions
from gso.services.crm import get_customer_by_name
from gso.services.netbox_client import NetboxClient
from gso.services.provisioning_proxy import pp_interaction
from gso.settings import load_oss_params
from gso.utils.helpers import generate_fqdn, iso_from_ipv4
from gso.utils.shared_enums import PortNumber, Vendor
from gso.utils.workflow_steps import deploy_base_config_dry, deploy_base_config_real, run_checks_after_base_config
......@@ -222,6 +223,26 @@ def prompt_insert_in_radius(subscription: RouterInactive) -> FormGenerator:
return {}
@inputstep("Prompt for new Sharepoint checklist", assignee=Assignee.SYSTEM)
def prompt_start_new_checklist(subscription: RouterProvisioning) -> FormGenerator:
"""Prompt the operator to start a new checklist in Sharepoint for approving this new router."""
oss_params = load_oss_params()
class SharepointPrompt(FormPage):
class Config:
title = "Start new checklist"
info_label_1: Label = (
f"Visit {oss_params.SHAREPOINT.checklist_site_url} and start a new Sharepoint checklist for "
f"{subscription.router.router_fqdn}." # type: ignore[assignment]
)
info_label_2: Label = "Once this is done, click proceed to finish the workflow." # type: ignore[assignment]
yield SharepointPrompt
return {}
@workflow(
"Create router",
initial_input_form=wrap_create_initial_input_form(initial_input_form_generator),
......@@ -254,6 +275,7 @@ def create_router() -> StepList:
>> router_is_nokia(create_netbox_device)
>> pp_interaction(run_checks_after_base_config)
>> set_status(SubscriptionLifecycle.PROVISIONING)
>> prompt_start_new_checklist
>> resync
>> done
)
......@@ -94,6 +94,9 @@ def test_create_nokia_router_success(
result, step_log = assert_pp_interaction_success(result, process_stat, step_log)
assert_suspended(result)
result, step_log = resume_workflow(process_stat, step_log, input_data=USER_CONFIRM_EMPTY_FORM)
assert_complete(result)
state = extract_state(result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment