Skip to content

Commit

Permalink
Update tech debt val (#74)
Browse files Browse the repository at this point in the history
* skip validations if tech debt file is missing
  • Loading branch information
duarte-castano authored Nov 15, 2023
1 parent 6685387 commit 48f8346
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/azure_devops/multistage/scripts/tech_debt_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Python modules
import argparse
import json
import os


# Custom exceptions
Expand Down Expand Up @@ -47,7 +48,16 @@ class TechDebtAnalysisException(Exception):
# Check if tech debt level of each app in the pipeline scope is below defined threshold
for manifest_app in trigger_manifest["ApplicationVersions"]:
app_name = manifest_app["ApplicationName"].replace(' ', '_')
findings = json.load(open("{}/TechDebt.{}.application.cache".format(techdebt_data_folder, app_name), "r"))

findings_file = "{}/TechDebt.{}.application.cache".format(techdebt_data_folder, app_name)
findings = {}

if os.path.isfile(findings_file):
findings = json.load(open(findings_file, "r"))
else:
print("Validation skipped for {}: No technical debt data found.".format(app_name), flush=True)
break

for app in findings["Applications"]:
techdebt_lvl_info = next(filter(lambda x: x["GUID"] == app["LevelGUID"], levels["Levels"]), None)
techdebt_lvl_idx = levels["Levels"].index(techdebt_lvl_info)
Expand Down

0 comments on commit 48f8346

Please sign in to comment.