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

24w1 changes #466

Merged
merged 82 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
c2b658a
see #109; improving table export
rtholmes Apr 30, 2024
b85930e
make title optional
rtholmes Apr 30, 2024
beef7cc
better header names for metadata rows
rtholmes Apr 30, 2024
917927f
fix #109; cleanups and tested in prod
rtholmes Apr 30, 2024
030aba3
wrong cell
rtholmes Apr 30, 2024
91230ca
offsets
rtholmes Apr 30, 2024
d822400
sort colsWithMetadata
rtholmes Apr 30, 2024
34bc7a3
see #109; improving table export
rtholmes Apr 30, 2024
557476c
make title optional
rtholmes Apr 30, 2024
9dea4c9
better header names for metadata rows
rtholmes Apr 30, 2024
34b029e
fix #109; cleanups and tested in prod
rtholmes Apr 30, 2024
de8dc88
wrong cell
rtholmes Apr 30, 2024
e648315
offsets
rtholmes Apr 30, 2024
13df441
sort colsWithMetadata
rtholmes Apr 30, 2024
16366c1
Merge branch 'cs310_24w1' of github.com:ubccpsc310/classy into cs310_…
rtholmes Jun 12, 2024
036b444
update comment
rtholmes Jun 17, 2024
066a55c
Merge branch 'main' into cs310_24w1
winstan Aug 31, 2024
4713244
Improving template provisioning; all unnecessary branches not being r…
rtholmes Sep 6, 2024
b96f941
lint
rtholmes Sep 6, 2024
64479b2
more verbose logging of team creation during provisioning
rtholmes Sep 6, 2024
a1ee7b4
better repo name logging
rtholmes Sep 6, 2024
e3c2b73
encode branch name in default grader image for 310
rtholmes Sep 9, 2024
e5ddf85
add the ability to update template repos (the createRepo endpoint all…
rtholmes Sep 9, 2024
1b75da4
fix update endpoint
rtholmes Sep 9, 2024
f34237f
update endpoint working, decreasing verbosity
rtholmes Sep 9, 2024
a2c4c57
see #112 add ability to display bucket grades to students instead of …
rtholmes Sep 13, 2024
a1c5b16
logging
rtholmes Sep 15, 2024
bef24eb
better logging so we know what's happening with the custom course con…
rtholmes Sep 16, 2024
43d7cd7
enhanced plugin logging
rtholmes Sep 16, 2024
52101cf
user-select ignored on safari; trying webkit prefix
rtholmes Sep 18, 2024
fdb245f
more select support
rtholmes Sep 18, 2024
8b166e6
add the ability to bulk delete extraneous branches
rtholmes Sep 19, 2024
d25f8bf
remove duplicated code for branch removal
rtholmes Sep 19, 2024
30e3e43
improve timeout string
rtholmes Oct 7, 2024
0b8ae02
see #114 allow grades that are not numbers to be uploaded
rtholmes Oct 8, 2024
5ee2908
see #114 get displayScore to show up in admin view
rtholmes Oct 8, 2024
1150053
docs
rtholmes Oct 8, 2024
5b324c3
add notion of (optional) DISPLAY column to CSV upload
rtholmes Oct 8, 2024
ff22ffa
comments
rtholmes Oct 8, 2024
866f366
see #114 handle github id uploads better in CSVs
rtholmes Oct 9, 2024
bb8a256
remove .only
rtholmes Oct 9, 2024
5d1a78d
add sorting for buckets in UI
rtholmes Oct 9, 2024
f09fa55
see #114 better csv upload error handling
rtholmes Oct 9, 2024
16d19e0
see #114 csv parsing (and some table sorting)
rtholmes Oct 9, 2024
d6327df
more table sorting
rtholmes Oct 9, 2024
9ac6538
see #114; forgot an assignement after slice
rtholmes Oct 9, 2024
7025aac
improve admin teams tab usability by having more flexibility for defa…
rtholmes Oct 11, 2024
754254d
improved usability for dashboard and result tabs
rtholmes Oct 11, 2024
f7458de
fix e2e test broken by csv improvements
rtholmes Oct 11, 2024
1829e0a
See #115, allow more verbose feedback for requestFeedbackDelay (aka a…
rtholmes Oct 13, 2024
bff6327
see #115
rtholmes Oct 13, 2024
ca14038
better fullmessage tracking (#115)
rtholmes Oct 16, 2024
f1fa9f2
expose settabvisibility (and let it make tabs visible, not just invis…
rtholmes Oct 17, 2024
b045f4f
see #116 provide mechanism for results to contribute custom fields ba…
rtholmes Oct 18, 2024
2ed439f
minor tweak
rtholmes Oct 18, 2024
bc90766
better instrumentation in stdio.html
rtholmes Oct 23, 2024
0b1243e
add simplify view for stdio
rtholmes Oct 23, 2024
837cb63
use indexOf consistently
rtholmes Oct 23, 2024
d1619de
change prefix/postfix to more inclusive keys
rtholmes Oct 23, 2024
33fe74d
update matching
rtholmes Oct 23, 2024
9502487
better separation for start/end events
rtholmes Oct 23, 2024
c07e081
add 310 guard, just to be safe
rtholmes Oct 23, 2024
da08d3b
brief by default
rtholmes Oct 23, 2024
e6c0c3e
update logging
rtholmes Oct 23, 2024
a61fa5f
more stdio keywords for highlighting
rtholmes Oct 23, 2024
5f5b328
add one last keyword
rtholmes Oct 23, 2024
479d1d9
better logging in getPushRecord
rtholmes Oct 29, 2024
252e361
see project-resources#557; trying to debug cases where multiple pushe…
rtholmes Oct 29, 2024
b11ca24
cleanup push event modelling
rtholmes Oct 29, 2024
6e10422
add some debugging for empty payloads for comment/push events
rtholmes Oct 29, 2024
6e88f3b
more push instrumentation
rtholmes Oct 29, 2024
b34f2bf
more push logging
rtholmes Oct 30, 2024
1114465
see #117; disable caching
rtholmes Nov 1, 2024
5db9f24
logging work
rtholmes Nov 3, 2024
e1a8730
add warning when container not specified for deliverable (console-fac…
rtholmes Nov 4, 2024
1ac2aa4
logging
rtholmes Nov 6, 2024
a84c67c
see #118; enable grade CSVs to be uploaded with StudentNumber as the …
rtholmes Dec 17, 2024
e9916ea
see #118 make caps consistent, also provide useful error message if G…
rtholmes Dec 17, 2024
a2a98c6
remove errant .only
rtholmes Dec 17, 2024
9936ac0
See #118 more robustly track errors for student numbers that are unknown
rtholmes Dec 17, 2024
8ad1040
see #118 work with truthyness of find better
rtholmes Dec 17, 2024
1d59247
dissallow #dev use by non-admins
rtholmes Dec 18, 2024
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
20 changes: 18 additions & 2 deletions packages/autotest/src/autotest/AutoTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ export abstract class AutoTest implements IAutoTest {
const totalJobsRunning = that.jobs.length;
Log.info("AutoTest::tick::tickQueue(..) [JOB] - job start: " + queue.getName() + "; deliv: " +
(info.target.delivId + ";").padEnd(8, " ") + " repo: " + (info.target.repoId + ";").padEnd(18, " ") + " SHA: " +
Util.shaHuman(info.target.commitSHA) + "; # running: " + totalJobsRunning + "; # queued: " + totalNumQueued +
Util.shaHuman(info.target.commitSHA) + "; # running: " + totalJobsRunning +
"; # queued: " + (totalNumQueued + "").padStart(4, " ") +
" ( e: " + that.expressQueue.length() + ", s: " + that.standardQueue.length() + ", l: " + that.lowQueue.length() + " )");

let gradingJob: GradingJob;
Expand Down Expand Up @@ -607,6 +608,8 @@ export abstract class AutoTest implements IAutoTest {
Log.info("AutoTest::handleTick(..) - stale job; old container: " +
input.containerConfig.dockerImage + "; new container: " + containerConfig.dockerImage);
input.containerConfig = containerConfig;
} else if (containerConfig === null) {
Log.warn("AutoTest::handleTick(..) - no container found for delivId: " + input.target.delivId);
}
} catch (err) {
Log.warn("AutoTest::handleTick(..) - problem updating container config: " + err.message);
Expand All @@ -620,13 +623,18 @@ export abstract class AutoTest implements IAutoTest {

try {
await job.prepare();

Log.info("AutoTest::handleTick(..) - prepared; deliv: " + input.target.delivId +
"; repo: " + input.target.repoId + "; SHA: " + Util.shaHuman(
input.target.commitSHA));

record = await job.run(this.docker);

Log.info("AutoTest::handleTick(..) - executed; deliv: " + input.target.delivId +
"; repo: " + input.target.repoId + "; SHA: " + Util.shaHuman(input.target.commitSHA));

let score = -1;
if (record.output.report !== null && typeof record.output.report.scoreOverall !== "undefined") {
if (record?.output?.report?.scoreOverall) {
score = record.output.report.scoreOverall;
}
const githubHost = Config.getInstance().getProp(ConfigKey.githubHost);
Expand All @@ -643,6 +651,14 @@ export abstract class AutoTest implements IAutoTest {
timestamp: input.target.timestamp,
custom: {}
};
// provide a way for the grade controller to contribute data directly
// to the grade record
if (record?.output?.custom) {
gradePayload.custom.output = record.output.custom;
}
if (record?.output?.report?.custom) {
gradePayload.custom.result = record.output.report.custom;
}
} catch (err) {
Log.error("AutoTest::handleTick(..) - ERROR in execution for SHA: " + input.target.commitSHA + "; ERROR: " + err);
} finally {
Expand Down
19 changes: 11 additions & 8 deletions packages/autotest/src/autotest/ClassPortal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export interface IClassPortal {
* @param timestamp
*/
requestFeedbackDelay(delivId: string, personId: string, timestamp: number):
Promise<{ accepted: boolean, message: string } | null>;
Promise<{ accepted: boolean, message: string, fullMessage?: string } | null>;
}

/**
Expand Down Expand Up @@ -286,8 +286,8 @@ export class ClassPortal implements IClassPortal {
body: JSON.stringify(grade)
};

Log.trace("ClassPortal::sendGrade(..) - sending to: " + url + "; deliv: " + grade.delivId +
"; repo: " + grade.repoId + "; url: " + grade.URL);
Log.trace("ClassPortal::sendGrade(..) - deliv: " + grade.delivId +
"; repo: " + grade.repoId + "; grade: " + grade.score + "; url: " + grade.URL);
Log.trace("ClassPortal::sendGrade(..) - payload: " + JSON.stringify(grade));
const res = await fetch(url, opts);

Expand Down Expand Up @@ -453,7 +453,8 @@ export class ClassPortal implements IClassPortal {

public async requestFeedbackDelay(delivId: string, personId: string, timestamp: number): Promise<{
accepted: boolean;
message: string
message: string;
fullMessage?: string;
} | null> {

const url = `${this.host}:${this.port}/portal/at/feedbackDelay`;
Expand All @@ -462,7 +463,7 @@ export class ClassPortal implements IClassPortal {
Log.info(`ClassPortal::requestFeedbackDelay(..) - start; person: ${personId}; delivId: ${delivId}`);

// default to null
let resp: { accepted: boolean, message: string } | null = null;
let resp: { accepted: boolean, message: string, fullMessage: string } | null = null;

try {
const opts: RequestInit = {
Expand All @@ -489,12 +490,14 @@ export class ClassPortal implements IClassPortal {
Log.trace("ClassPortal::requestFeedbackDelay(..) - types; json: " + typeof json +
"; json.accepted: " + typeof json?.accepted +
"; json.message: " + typeof json?.message +
"; json.notImplemented: " + typeof json?.notImplemented);
"; json.fullMessage: " + typeof json?.fullMessage);

if (typeof json?.accepted === "boolean" && typeof json?.message === "string") {
if (typeof json?.accepted === "boolean" &&
(typeof json?.message === "string" || typeof json?.fullMessage === "string")) {
resp = {
accepted: json.accepted,
message: json.message
message: json.message,
fullMessage: json.fullMessage
};
} else if (typeof json?.notImplemented === "boolean" && json.notImplemented === true) {
resp = null;
Expand Down
29 changes: 16 additions & 13 deletions packages/autotest/src/autotest/DataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {AutoTestResult, IFeedbackGiven} from "@common/types/AutoTestTypes";
import {CommitTarget} from "@common/types/ContainerTypes";

import Util from "@common/Util";
import {GitHubUtil} from "@autotest/github/GitHubUtil";

export interface IDataStore {

Expand Down Expand Up @@ -154,37 +155,39 @@ export class MongoDataStore implements IDataStore {

/**
* Gets the push event record for a given commitURL. If more than one exist,
* return the one for main/master. If there isn't a main/master push, return the
* return the one for main/master. If there is not a main/master push, return the
* most recent one.
*/
public async getPushRecord(commitURL: string): Promise<CommitTarget | null> {
Log.trace("MongoDataStore::getPushRecord(..) - start");
// Log.trace("MongoDataStore::getPushRecord(..) - start");
try {
const start = Date.now();
let res = await this.getRecords(this.PUSHCOLL, {commitURL: commitURL});
if (res === null) {
let records = await this.getRecords(this.PUSHCOLL, {commitURL: commitURL}) as CommitTarget[];
if (records === null) {
Log.trace("MongoDataStore::getPushRecord(..) - record not found for: " + commitURL);
} else {
Log.trace("MongoDataStore::getPushRecord(..) - found; took: " + Util.took(start));
if (res.length === 1) {
if (records.length === 1) {
Log.trace("MongoDataStore::getPushRecord(..) - one found; took: " + Util.took(start));
// the usual case
return res[0] as CommitTarget;
return records[0];
} else {
// return main/master if exists
for (const r of res as CommitTarget[]) {
if (typeof r.ref !== "undefined" && (r.ref === "refs/heads/main" || r.ref === "refs/heads/master")) {
return r as CommitTarget;
for (const r of records) {

if (typeof r.ref !== "undefined" && GitHubUtil.isMain(r.ref) === true) {
Log.trace("MongoDataStore::getPushRecord(..) - multiple found, returning main; took: " + Util.took(start));
return r;
}
}

// sort, should make the oldest record first
res = res.sort(function (c1: CommitTarget, c2: CommitTarget) {
records = records.sort(function (c1: CommitTarget, c2: CommitTarget) {
return c1.timestamp - c2.timestamp;
});
return res[0] as CommitTarget;
Log.trace("MongoDataStore::getPushRecord(..) - multiple found, returning oldest; took: " + Util.took(start));
return records[0] as CommitTarget;
}
}

} catch (err) {
Log.error("MongoDataStore::getPushRecord(..) - ERROR: " + err);
}
Expand Down
8 changes: 3 additions & 5 deletions packages/autotest/src/autotest/GradingJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,12 @@ export class GradingJob {
Log.trace("GradingJob::run() - updated: " + this.id);
const maxExecTime = this.input.containerConfig.maxExecTime;

Log.trace("GradingJob::run() - after container: " + this.id);

const stdio = fs.createWriteStream(this.path + "/staff/stdio.txt");
const stream = await container.attach({stream: true, stdout: true, stderr: true});
container.modem.demuxStream(stream, stdio, stdio);

const exitCode = await GradingJob.runContainer(container, maxExecTime);
Log.trace("GradingJob::run() - after run: " + this.id + "; exit code: " + exitCode);
Log.trace("GradingJob::run() - container complete: " + this.id + "; exit code: " + exitCode);

// NOTE: at this point, out just contains default values
const out = this.record.output;
Expand All @@ -149,7 +147,7 @@ export class GradingJob {
out.state = ContainerState.FAIL;
out.postbackOnComplete = true; // always send fail feedback
} else if (exitCode === -1) {
let msg = "Container did not complete for `" + this.input.target.delivId + "` in the allotted time. ";
let msg = "Container did not complete for **`#" + this.input.target.delivId + "`** in the allotted time. ";
msg += "This likely means that _our_ tests exposed a slow or non-terminating path in _your_ implementation. ";
msg += "You should augment your tests; a comprehensive local suite will uncover the problem.";

Expand All @@ -161,7 +159,7 @@ export class GradingJob {
} else if (reportRead === false) {
Log.warn("GradingJob::run() - No grading report for repo: " + this.input.target.repoId +
"; delivId: " + this.input.target.delivId + "; SHA: " + Util.shaHuman(this.input.target.commitSHA));
out.report.feedback = "Failed to read grade report. Make a new commit and try again.";
out.report.feedback = "Failed to read grade report for **`#" + this.input.target.delivId + "`**. Make a new commit and try again.";
out.report.result = ContainerState.NO_REPORT;
out.state = ContainerState.NO_REPORT;
} else {
Expand Down
Loading