Skip to content

check50 waits and reports wrong remote with a different remote set in config #214

@Jelleas

Description

@Jelleas

In its remote (not local) operation check50 uses lib50.push to push to GitHub:

check50/check50/__main__.py

Lines 350 to 353 in 5a90acd

if not args.local:
commit_hash = lib50.push("check50", SLUG, internal.CONFIG_LOADER, data={"check50": True})[1]
with lib50.ProgressBar("Waiting for results") if "ansi" in args.output else nullcontext():
tag_hash, results = await_results(commit_hash, SLUG)

Then starts to ping submit.cs50.io (hardcoded) for results.

check50/check50/__main__.py

Lines 184 to 192 in 5a90acd

def await_results(commit_hash, slug, pings=45, sleep=2):
"""
Ping {url} until it returns a results payload, timing out after
{pings} pings and waiting {sleep} seconds between pings.
"""
for _i in range(pings):
# Query for check results.
res = requests.get(f"https://submit.cs50.io/api/results/check50", params={"commit_hash": commit_hash, "slug": slug})

However, a tool may have set a different remote in its config. In which case check50 will hang for some time, until finally wrongly redirecting to submit.cs50.io.

We discussed this last Summer, but didn't get to implement it it seems. If I remember correctly we settled on redirecting the student immediately to the remote if it was set to something different than submit.cs50.io (rather than ping and wait for results).

Metadata

Metadata

Assignees

Labels

4.xIssues relating to check50 4.xbug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions