Skip to content

Commit d8e2112

Browse files
authored
Merge pull request #119 from CodeGov-org/nathan/allow-changing-commit-sha
feat: allow changing commit sha on review form
2 parents b23d10c + 8fe3bac commit d8e2112

47 files changed

Lines changed: 364 additions & 1165 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ module.exports = {
5353
ecmaVersion: 'latest',
5454
project: ['./src/{docs,marketing}/tsconfig.json'],
5555
},
56+
rules: {
57+
'@typescript-eslint/triple-slash-reference': 0,
58+
},
5659
},
5760
{
5861
files: ['src/frontend/**/*.ts'],

src/backend/api/backend.did

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ type ProposalReview = record {
230230
last_updated_at : opt text;
231231
status : ProposalReviewStatus;
232232
summary : opt text;
233-
review_duration_mins : opt nat16;
234233
build_reproduced : opt bool;
235234
images_paths : vec text;
236235
proposal_review_commits : vec ProposalReviewCommitWithId;
@@ -245,7 +244,6 @@ type ProposalReviewWithId = record {
245244
type CreateProposalReviewRequest = record {
246245
proposal_id : text;
247246
summary : opt text;
248-
review_duration_mins : opt nat16;
249247
build_reproduced : opt bool;
250248
vote : opt ProposalVote;
251249
};
@@ -259,7 +257,6 @@ type UpdateProposalReviewRequest = record {
259257
proposal_id : text;
260258
status : opt ProposalReviewStatus;
261259
summary : opt text;
262-
review_duration_mins : opt nat16;
263260
build_reproduced : opt bool;
264261
vote : opt ProposalVote;
265262
};
@@ -296,7 +293,6 @@ type ReviewCommitState = variant {
296293
reviewed : record {
297294
matches_description : opt bool;
298295
comment : opt text;
299-
highlights : vec text;
300296
};
301297
not_reviewed;
302298
};

src/backend/api/src/proposal_review.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub struct ProposalReview {
2828
pub last_updated_at: Option<String>,
2929
pub status: ProposalReviewStatus,
3030
pub summary: Option<String>,
31-
pub review_duration_mins: Option<u16>,
3231
pub build_reproduced: Option<bool>,
3332
pub images_paths: Vec<String>,
3433
pub proposal_review_commits: Vec<ProposalReviewCommitWithId>,
@@ -45,7 +44,6 @@ pub struct ProposalReviewWithId {
4544
pub struct CreateProposalReviewRequest {
4645
pub proposal_id: String,
4746
pub summary: Option<String>,
48-
pub review_duration_mins: Option<u16>,
4947
pub build_reproduced: Option<bool>,
5048
pub vote: Option<ProposalVote>,
5149
}
@@ -57,7 +55,6 @@ pub struct UpdateProposalReviewRequest {
5755
pub proposal_id: String,
5856
pub status: Option<ProposalReviewStatus>,
5957
pub summary: Option<String>,
60-
pub review_duration_mins: Option<u16>,
6158
pub build_reproduced: Option<bool>,
6259
pub vote: Option<ProposalVote>,
6360
}

src/backend/api/src/proposal_review_commit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ pub enum ReviewCommitState {
66
Reviewed {
77
matches_description: Option<bool>,
88
comment: Option<String>,
9-
highlights: Vec<String>,
109
},
1110
#[serde(rename = "not_reviewed")]
1211
NotReviewed,

src/backend/impl/src/controllers/proposal_review_commit_controller.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ mod tests {
142142
state: backend_api::ReviewCommitState::Reviewed {
143143
matches_description: Some(true),
144144
comment: Some("comment".to_string()),
145-
highlights: vec![],
146145
},
147146
};
148147
let response = CreateProposalReviewCommitResponse {
@@ -184,7 +183,6 @@ mod tests {
184183
state: backend_api::ReviewCommitState::Reviewed {
185184
matches_description: Some(true),
186185
comment: Some("comment".to_string()),
187-
highlights: vec![],
188186
},
189187
};
190188
let error = ApiError::permission_denied(&format!(
@@ -221,7 +219,6 @@ mod tests {
221219
state: backend_api::ReviewCommitState::Reviewed {
222220
matches_description: Some(true),
223221
comment: Some("comment".to_string()),
224-
highlights: vec![],
225222
},
226223
};
227224

@@ -255,7 +252,6 @@ mod tests {
255252
state: backend_api::ReviewCommitState::Reviewed {
256253
matches_description: Some(true),
257254
comment: Some("comment".to_string()),
258-
highlights: vec![],
259255
},
260256
};
261257
let error = ApiError::permission_denied(&format!(

src/backend/impl/src/controllers/proposal_review_controller.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ mod tests {
254254
let request = CreateProposalReviewRequest {
255255
proposal_id: "proposal_id".to_string(),
256256
summary: Some("summary".to_string()),
257-
review_duration_mins: Some(10),
258257
build_reproduced: Some(true),
259258
vote: Some(ProposalVote::Yes),
260259
};
@@ -297,7 +296,6 @@ mod tests {
297296
let request = CreateProposalReviewRequest {
298297
proposal_id: "proposal_id".to_string(),
299298
summary: Some("summary".to_string()),
300-
review_duration_mins: Some(10),
301299
build_reproduced: Some(true),
302300
vote: Some(ProposalVote::No),
303301
};
@@ -338,7 +336,6 @@ mod tests {
338336
proposal_id: fixtures::proposal_id().to_string(),
339337
status: None,
340338
summary: Some("summary".to_string()),
341-
review_duration_mins: Some(10),
342339
build_reproduced: Some(true),
343340
vote: Some(ProposalVote::Yes),
344341
};
@@ -374,7 +371,6 @@ mod tests {
374371
proposal_id: fixtures::proposal_id().to_string(),
375372
status: None,
376373
summary: Some("summary".to_string()),
377-
review_duration_mins: Some(10),
378374
build_reproduced: Some(true),
379375
vote: None,
380376
};

src/backend/impl/src/fixtures/id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn principal_b() -> Principal {
1414

1515
#[fixture]
1616
pub fn principal_c() -> Principal {
17-
Principal::from_slice(&[1])
17+
Principal::from_slice(&[2])
1818
}
1919

2020
#[fixture]

src/backend/impl/src/fixtures/proposal_review.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub fn proposal_review_draft() -> ProposalReview {
1313
last_updated_at: None,
1414
status: ProposalReviewStatus::Draft,
1515
summary: Some("Proposal review summary".to_string()),
16-
review_duration_mins: Some(60),
1716
build_reproduced: Some(true),
1817
images_ids: vec![],
1918
vote: ProposalVote::Unspecified,
@@ -29,7 +28,6 @@ pub fn proposal_review_published() -> ProposalReview {
2928
last_updated_at: None,
3029
status: ProposalReviewStatus::Published,
3130
summary: Some("Proposal review summary".to_string()),
32-
review_duration_mins: Some(60),
3331
build_reproduced: Some(true),
3432
images_ids: vec![uuid()],
3533
vote: ProposalVote::Yes,

src/backend/impl/src/fixtures/proposal_review_commit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub fn proposal_review_commit_reviewed() -> ProposalReviewCommit {
1515
state: ReviewCommitState::Reviewed(ReviewedCommitState {
1616
matches_description: Some(true),
1717
comment: Some("Review commit comment".to_string()),
18-
highlights: vec![],
1918
}),
2019
}
2120
}

src/backend/impl/src/mappings/proposal_review.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ impl From<ProposalReview> for backend_api::ProposalReview {
5252
last_updated_at: proposal_review.last_updated_at.map(|dt| dt.to_string()),
5353
status: proposal_review.status.into(),
5454
summary: proposal_review.summary,
55-
review_duration_mins: proposal_review.review_duration_mins,
5655
build_reproduced: proposal_review.build_reproduced,
5756
images_paths: vec![],
5857
proposal_review_commits: vec![],

0 commit comments

Comments
 (0)