Skip to content
Merged
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
17 changes: 17 additions & 0 deletions ctf/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def stats(
stats["number_of_flags_per_track"] = {}
stats["number_of_points_per_track"] = {}
stats["not_integrated_with_scenario"] = []
stats["qa_not_done"] = []
challenge_designers = set()
flags = []
for track in distinct_tracks:
Expand Down Expand Up @@ -121,8 +122,15 @@ def stats(
if service["port"] not in stats["number_of_services_per_port"]:
stats["number_of_services_per_port"][service["port"]] = 0
stats["number_of_services_per_port"][service["port"]] += 1
track_designers = set()
for challenge_designer in track_yaml["contacts"]["dev"]:
challenge_designers.add(challenge_designer.lower())
track_designers.add(challenge_designer)
qa = set()
for qa_member in track_yaml["contacts"].get("qa", []):
qa.add(qa_member.lower())
if not qa - track_designers:
stats["qa_not_done"].append(track)

if os.path.exists(
path=(files_directory := os.path.join(challenges_directory, track, "files"))
Expand Down Expand Up @@ -203,6 +211,15 @@ def stats(
+ str(stats["number_of_tracks"]),
),
)
write_badge(
"qa_done",
pybadges.badge( # type: ignore
left_text="QA Done",
right_text=str(stats["number_of_tracks"] - len(stats["qa_not_done"]))
+ "/"
+ str(stats["number_of_tracks"]),
),
)

if charts:
if not _has_matplotlib:
Expand Down