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

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

Open
Jelleas opened this issue Jun 9, 2020 · 0 comments
Assignees
Labels
3.x Issues relating to check50 3.x bug

Comments

@Jelleas
Copy link
Contributor

Jelleas commented Jun 9, 2020

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).

@Jelleas Jelleas added bug 3.x Issues relating to check50 3.x labels Jun 9, 2020
@Jelleas Jelleas self-assigned this Jun 9, 2020
@Jelleas Jelleas mentioned this issue Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues relating to check50 3.x bug
Projects
None yet
Development

No branches or pull requests

1 participant