Skip to content

Commit 16d8fba

Browse files
committed
Big refactor to final design as discussed in VC in June
1 parent 7cc80ab commit 16d8fba

17 files changed

Lines changed: 275 additions & 221 deletions

common/src/errors/validate_submit_err.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ pub enum ValidateSubmitError {
77
InvalidAssignment,
88
#[error("task already validated and this result is not valid")]
99
InconsistentValidationState,
10-
#[error("multi-task validation in a single request is currently not implemented")]
11-
MultipleTasksDisallowed,
12-
#[error("too many groups meeting quorum were provided")]
13-
ValidityAmbiguous,
10+
#[error("all results are inconclusive, and no new assignment has finished to solve it")]
11+
ValidationImpossibleError,
12+
#[error("validation group contained assignments belonging to multiple tasks")]
13+
ValidationGroupTaskInconsistency,
14+
#[error("assignments referred to by group id cannot refer to an assignment other than itself")]
15+
ValidationGroupAssociationInconsistency,
1416
#[error("state transition forbidden")]
1517
StateTransitionForbidden,
1618
}

common/src/records/result.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub struct Result {
1313
pub stdout: String,
1414
pub stderr: String,
1515
pub exit_code: Option<i32>,
16+
pub group_assignment_id: Option<Id<Assignment>>
1617
}
1718

1819
#[non_exhaustive]

common/src/requests/validate_submit_request.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ use crate::{records::Assignment, types::Id};
66

77
#[derive(Clone, Debug, Serialize, Deserialize)]
88
pub struct ValidateSubmitRequest {
9-
pub assignments: HashMap<Id<Assignment>, Option<i32>>,
9+
//First id is the assignment id that will change state, second is the "group id" it belongs with
10+
pub assignments: HashMap<Id<Assignment>, Id<Assignment>>,
1011
}

server/.sqlx/query-237bcc75f090ec14f8703b28013f94f224b083c68ff691b6bbeffdb171a83a47.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

server/.sqlx/query-2daeacfdb74c4d12e2e5801d58931e6b9e29f27da54f8ed525dc71e8f3162a0a.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.sqlx/query-388759d95b0eab3626a0b06330964fab1d44214a7f136306282a38c25536b22f.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.sqlx/query-83491616ec19de1b1ac1a01dc64f388ef07ce490f99c4a9127e30153eb840824.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

server/.sqlx/query-86323f9f5243c3f94a679b49c361a5f19cd315d0a1881afb695861f4221cf4ca.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

server/.sqlx/query-9d2127cb05e7631e969e289ff57ffd170787045c3233daad045204b9aa53f66c.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/.sqlx/query-10780f6fbc25a26cb46dec7bb5d47b9f00627ee7fdbc36d923db1cdf7f06aedf.json renamed to server/.sqlx/query-9ee75dbb5012a5310b8af01a05b6bf6e50cca4edd9b9c2b475201cc208720a2d.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)