Skip to content

Commit

Permalink
Update comments about administrative flags.
Browse files Browse the repository at this point in the history
Also: update schemas to more rigorously reflect this.
  • Loading branch information
vdbergh authored and ppigazzini committed Jun 10, 2024
1 parent 002c051 commit d3e4e02
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
19 changes: 10 additions & 9 deletions server/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,30 +463,31 @@ def new_run(
"total_games": 0,
}

# administrative flags
# Administrative flags.
# If the following comments are incorrect then that's a bug!

# "finished"
# set in stop_run(), /api/stop_run, /tests/delete
# cleared in purge_run(), /tests/modify
# set in set_inactive_run()
# cleared in set_active_run()
new_run["finished"] = False

# "deleted"
# set in /tests/delete
# cleared in set_active_run()
new_run["deleted"] = False

# "failed"
# set in /api/stop_run
# cleared in /tests/modify
# cleared in set_active_run()
new_run["failed"] = False

# "is_green"
# set in stop_run()
# cleared in purge_run(), /tests/modify
# set in stop_run(), purge_run()
# cleared in purge_run(), set_active_run()
new_run["is_green"] = False

# "is_yellow"
# set in stop_run()
# cleared in purge_run(), /tests/modify
# set in stop_run(), purge_run()
# cleared in purge_run(), set_active_run()
new_run["is_yellow"] = False

if rescheduled_from:
Expand Down
16 changes: 12 additions & 4 deletions server/fishtest/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,18 @@ def total_games_must_match(run):
lax(ifthen({"approved": True}, {"approver": username}, {"approver": ""})),
lax(ifthen({"is_green": True}, {"is_yellow": False})),
lax(ifthen({"is_yellow": True}, {"is_green": False})),
lax(ifthen({"failed": True}, {"finished": True})),
lax(ifthen({"deleted": True}, {"finished": True})),
lax(ifthen({"finished": True}, {"workers": 0, "cores": 0})),
lax(ifthen({"finished": True}, {"tasks": [{"active": False}, ...]})),
lax(
ifthen(
{"finished": False},
{"is_green": False, "is_yellow": False, "failed": False, "deleted": False},
)
),
lax(
ifthen(
{"finished": True},
{"workers": 0, "cores": 0, "tasks": [{"active": False}, ...]},
)
),
valid_aggregated_data,
)

Expand Down

0 comments on commit d3e4e02

Please sign in to comment.