Skip to content
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

Fix no components #503

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 19 additions & 10 deletions backend/bot/statuspage/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,30 @@ def update(channel_id: str, status: str, message: str):
# Update incident
# If resolved, return components to operational
# If not resolved, preserve original statuses
components = None
incident_updates = sp_incident_data.get("incident_updates")
if status == "resolved":
components = sp_components.formatted_components_update(
sp_components.list_of_names, "operational"
)
elif incident_updates:
affected_components = incident_updates[-1:][0].get(
"affected_components", []
)
if affected_components:
components = {
obj.get("code"): obj.get("new_status")
for obj in sp_incident_data.get("incident_updates", [])[
-1:
][0].get("affected_components")
}
update_data = {
"id": incident_data.sp_incident_id,
"body": message,
"status": status,
"components": sp_components.formatted_components_update(
sp_components.list_of_names, "operational"
)
if status == "resolved"
else {
obj.get("code"): obj.get("new_status")
for obj in sp_incident_data.get("incident_updates")[-1:][
0
].get("affected_components")
},
"components": components,
}

payload = {
"incident": {
"status": update_data.get("status"),
Expand Down
2 changes: 1 addition & 1 deletion backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from iblog import logger, log_level
from typing import Dict, List

__version__ = "v1.10.3"
__version__ = "v1.10.4"

# .env parse
dotenv_path = os.path.join(os.path.dirname(__file__), ".env")
Expand Down
4 changes: 2 additions & 2 deletions deploy/charts/incident-bot/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.10.3
version: 1.10.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: '1.10.3'
appVersion: '1.10.4'
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bases:

images:
- name: eb129/incident-bot
newTag: v1.10.3
newTag: v1.10.4

configMapGenerator:
- name: incident-bot-config
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy/overlays/production/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bases:

images:
- name: eb129/incident-bot-docs
newTag: v1.10.3
newTag: v1.10.4

generatorOptions:
disableNameSuffixHash: true
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.10.3
v1.10.4
Loading