Content-Length: 425815 | pFad | http://github.com/keephq/keep/pull/4995/commits/94ac0ef49fb1bb1cb88a2cc462f3009ee369c37c

55 feat: Stronger incident-level ticketing integration (#4981) by ns-rboyd · Pull Request #4995 · keephq/keep · GitHub
Skip to content

feat: Stronger incident-level ticketing integration (#4981) #4995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
929a679
feat: Add incident form schema system for dynamic incident creation (…
ns-rboyd Jun 5, 2025
e4e6657
feat: integrate dynamic form schema into incident creation UI (#4981)
ns-rboyd Jun 5, 2025
3b52323
feat: add example workflows and documentation for incident ticketing …
ns-rboyd Jun 5, 2025
f1e8d0f
feat: add ticket link column to incidents table (#4981)
ns-rboyd Jun 5, 2025
10e27b7
fix: populate incident enrichments in GET /incidents endpoint
ns-rboyd Jun 9, 2025
9d8b918
fix: resolve incident form schema storage and authentication issues
ns-rboyd Jun 9, 2025
533d8ce
docs: add comprehensive incident ticketing integration documentation
ns-rboyd Jun 9, 2025
e6a117d
Merge branch 'main' into 4981-incident-level-ticketing-integration
talboren Jun 9, 2025
a1de690
Merge branch 'main' into 4981-incident-level-ticketing-integration
talboren Jun 10, 2025
cb40cff
feat: Support multiple incident form schemas per tenant
ns-rboyd Jun 20, 2025
2781f30
fix: Fix Vercel build errors
ns-rboyd Jun 20, 2025
15eb865
fix: Properly expose field validation errors in DynamicIncidentForm
ns-rboyd Jun 20, 2025
5cd941a
fix: Hide Additional Information section when no form schema exists
ns-rboyd Jun 25, 2025
0849c86
Fix: Required fields in dynamic form now properly control submit butt…
ns-rboyd Jun 25, 2025
5c7099c
Update E2E test to verify enriched fields in incident details
ns-rboyd Jun 25, 2025
af96c4e
Fix display of boolean and number enrichments in incident details
ns-rboyd Jun 25, 2025
6724c39
Fix enrichment editing to support boolean and number types
ns-rboyd Jun 25, 2025
b957114
fix: Update E2E test locator for Affected Users field
ns-rboyd Jun 25, 2025
fe14794
chore: Remove E2E test artifacts
ns-rboyd Jun 25, 2025
35bff9f
Merge branch 'main' into 4981-incident-level-ticketing-integration
ns-rboyd Jun 25, 2025
0b688de
fix: Remove unused imports to pass ruff linting
ns-rboyd Jun 25, 2025
7ac09bf
fix: Use SQLModel datetime field pattern for IncidentFormSchema
ns-rboyd Jun 25, 2025
8cdb00b
fix: Use AutoString instead of TEXT for MySQL compatibility
ns-rboyd Jun 26, 2025
4202054
feat: Add date field support to incident form schema
ns-rboyd Jun 26, 2025
74417cc
Remove old test files and artifacts
ns-rboyd Jun 26, 2025
4bd92de
Add incident cleanup to E2E tests and remove unnecessary files
ns-rboyd Jun 26, 2025
94ac0ef
Add incident cleanup to E2E tests
ns-rboyd Jun 26, 2025
ec49fe4
Remove .swp file and add to .gitignore
ns-rboyd Jun 26, 2025
005ad3c
Merge remote-tracking branch 'upstream/main' into 4981-incident-level…
ns-rboyd Jun 26, 2025
87966f2
Fix incident enrichment SQL alias reference
ns-rboyd Jun 27, 2025
b811924
Merge branch 'main' into 4981-incident-level-ticketing-integration
ns-rboyd Jun 30, 2025
4586717
Merge branch 'main' into 4981-incident-level-ticketing-integration
ns-rboyd Jul 9, 2025
b0f628b
Merge branch 'main' into 4981-incident-level-ticketing-integration
shahargl Jul 14, 2025
9988f2f
docs: add new workflow examples for Jira incident ticketing across mu…
ns-rboyd Jul 15, 2025
3be77ef
fix: update incident ticketing workflows to pass validation
ns-rboyd Jul 15, 2025
2aa0e77
fix: use 'if' field instead of 'condition' array in incident enrichme…
ns-rboyd Jul 15, 2025
e8b7b5e
docs: update provider snippets with new workflow examples
ns-rboyd Jul 15, 2025
7611a0a
Merge branch 'main' into 4981-incident-level-ticketing-integration
ns-rboyd Jul 15, 2025
7b0dfda
Merge branch 'main' into 4981-incident-level-ticketing-integration
ns-rboyd Jul 16, 2025
70dd33b
Merge branch 'main' into 4981-incident-level-ticketing-integration
ns-rboyd Jul 17, 2025
31f6845
feat: Introduce PydanticListType for JSON serialization in IncidentFo…
ns-rboyd Jul 18, 2025
f5efb3e
fix: Update index name in incident form schema migration
ns-rboyd Jul 18, 2025
8664a01
refactor: Clean up imports in types.py and incidents.py
ns-rboyd Jul 18, 2025
65e5b9c
refactor: Update EnrichmentEditableField to use Promise for update an…
ns-rboyd Jul 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add incident cleanup to E2E tests
- Add delete_incident() function to clean up test incidents via API
- Update test_create_incident_with_dynamic_fields to capture incident ID and delete it
- Update test_required_field_validation to capture incident ID if created
- Ensure tests clean up both incidents and form schemas in finally blocks
  • Loading branch information
ns-rboyd committed Jun 26, 2025
commit 94ac0ef49fb1bb1cb88a2cc462f3009ee369c37c
81 changes: 77 additions & 4 deletions tests/e2e_tests/test_incident_form_schema_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ def delete_form_schema(tenant_id: str, schema_id: str) -> None:
response.raise_for_status()


def delete_incident(tenant_id: str, incident_id: str) -> None:
"""Delete an incident via API"""
response = requests.delete(
f"http://localhost:8080/incidents/{incident_id}",
headers={
"Authorization": f"Bearer {get_token(tenant_id)}",
},
)
# It's OK if it's already deleted or doesn't exist
if response.status_code not in [200, 204, 404]:
response.raise_for_status()


def test_no_additional_information_without_schema(browser: Page):
"""Test that Additional Information section is NOT shown when no schema exists"""
log_entries = []
Expand Down Expand Up @@ -241,6 +254,7 @@ def test_create_incident_with_dynamic_fields(browser: Page):
log_entries = []
tenant_id = get_tenant_id()
schema = None
incident_id = None
incident_name = f"E2E Test Incident {generate_random_string()}"

try:
Expand Down Expand Up @@ -388,6 +402,11 @@ def test_create_incident_with_dynamic_fields(browser: Page):
if "/alerts" in browser.url or "/incident/" in browser.url:
# We were redirected, which means the incident was created
print(f"✓ Incident created successfully (redirected to details): {incident_name}")
# Extract incident ID from URL if it's in the format /incidents/{id}
url_match = re.search(r'/incidents/([a-f0-9-]+)', browser.url)
if url_match:
incident_id = url_match.group(1)
print(f" Incident ID: {incident_id}")
else:
# We're still on the incidents list
# Refresh the page to ensure we see the latest data
Expand Down Expand Up @@ -423,9 +442,28 @@ def test_create_incident_with_dynamic_fields(browser: Page):

print(f"✓ Incident created successfully (verified via API): {incident_name}")
print(f" Incident ID: {our_incident['id']}")
incident_id = our_incident['id']
raise AssertionError("Incident created but not visible in UI")

print(f"✓ Incident created successfully: {incident_name}")

# Get the incident ID from the API before clicking
api_response = requests.get(
"http://localhost:8080/incidents",
headers={
"Authorization": f"Bearer {get_token(tenant_id)}",
},
)
api_response.raise_for_status()
incidents = api_response.json().get("items", [])

# Find our incident
for inc in incidents:
if inc.get("user_generated_name") == incident_name:
incident_id = inc['id']
print(f" Incident ID: {incident_id}")
break

# Click on the incident to view details
incident_link.click()
browser.wait_for_load_state("networkidle")
Expand Down Expand Up @@ -483,8 +521,12 @@ def test_create_incident_with_dynamic_fields(browser: Page):
save_failure_artifacts(browser, log_entries, "test_create_incident_with_dynamic_fields")
raise e
finally:
# Cleanup: delete the schema
# Cleanup: delete the incident and schema
if incident_id:
print(f"Cleaning up: Deleting incident {incident_id}")
delete_incident(tenant_id, incident_id)
if schema:
print(f"Cleaning up: Deleting schema {schema['id']}")
delete_form_schema(tenant_id, schema["id"])


Expand All @@ -494,6 +536,8 @@ def test_required_field_validation(browser: Page):
log_entries = []
tenant_id = get_tenant_id()
schema = None
incident_id = None
incident_name = f"Test Validation Incident {generate_random_string()}"

try:
# Create form schema
Expand Down Expand Up @@ -523,7 +567,7 @@ def test_required_field_validation(browser: Page):

# Fill only the incident name (required)
name_input = browser.locator("input[placeholder='Incident Name']")
name_input.fill("Test Validation Incident")
name_input.fill(incident_name)

# Check if button is still disabled (missing other required fields)
browser.wait_for_timeout(500)
Expand Down Expand Up @@ -563,15 +607,44 @@ def test_required_field_validation(browser: Page):
submit_button.click(force=True)
print("✓ Able to submit when all required fields are filled")

# Close modal
# Wait for submission to complete
browser.wait_for_timeout(3000)

# Try to get the incident ID from the URL if redirected
if "/incidents/" in browser.url:
url_match = re.search(r'/incidents/([a-f0-9-]+)', browser.url)
if url_match:
incident_id = url_match.group(1)
print(f" Created incident ID: {incident_id}")
else:
# If not redirected, try to find via API
api_response = requests.get(
"http://localhost:8080/incidents",
headers={
"Authorization": f"Bearer {get_token(tenant_id)}",
},
)
if api_response.status_code == 200:
incidents = api_response.json().get("items", [])
for inc in incidents:
if inc.get("user_generated_name") == incident_name:
incident_id = inc['id']
print(f" Created incident ID: {incident_id}")
break

# Close modal if still open
browser.keyboard.press("Escape")

except Exception as e:
save_failure_artifacts(browser, log_entries, "test_required_field_validation")
raise e
finally:
# Cleanup: delete the schema
# Cleanup: delete the incident and schema
if incident_id:
print(f"Cleaning up: Deleting incident {incident_id}")
delete_incident(tenant_id, incident_id)
if schema:
print(f"Cleaning up: Deleting schema {schema['id']}")
delete_form_schema(tenant_id, schema["id"])


Expand Down
Loading








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/keephq/keep/pull/4995/commits/94ac0ef49fb1bb1cb88a2cc462f3009ee369c37c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy