1.2: Sandboxing #7

Open
qpismont wants to merge 7 commits from 1.2 into main
3 changed files with 6 additions and 9 deletions
Showing only changes of commit a29051b0e4 - Show all commits
+6 -1
View File
@@ -9,7 +9,12 @@
"rust-analyzer": { "rust-analyzer": {
"initialization_options": { "initialization_options": {
"check": { "check": {
"command": "clippy" "command": "clippy",
"extraArgs": [
"--",
"-D",
"warnings"
]
} }
} }
} }
-1
View File
@@ -20,7 +20,6 @@ pub struct ReviewResult {
pub struct ReviewItem { pub struct ReviewItem {
pub filename: String, pub filename: String,
pub line: Option<u64>, pub line: Option<u64>,
pub code: String,
pub message: String, pub message: String,
} }
-7
View File
@@ -197,7 +197,6 @@ pub struct ReviewPayload {
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
pub struct PullRequest { pub struct PullRequest {
pub id: u64,
pub diff_url: String, pub diff_url: String,
pub number: u64, pub number: u64,
pub title: String, pub title: String,
@@ -207,12 +206,10 @@ pub struct PullRequest {
pub struct Comment { pub struct Comment {
pub id: u64, pub id: u64,
pub body: String, pub body: String,
pub user: User,
} }
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
pub struct User { pub struct User {
pub id: u64,
pub login: String, pub login: String,
} }
@@ -282,10 +279,8 @@ mod tests {
match result.unwrap() { match result.unwrap() {
WebhookType::Review(payload) => { WebhookType::Review(payload) => {
assert_eq!(payload.action, "created"); assert_eq!(payload.action, "created");
assert_eq!(payload.pull_request.id, 42);
assert_eq!(payload.comment.id, 7); assert_eq!(payload.comment.id, 7);
assert_eq!(payload.comment.body, "@test_bot LGTM"); assert_eq!(payload.comment.body, "@test_bot LGTM");
assert_eq!(payload.comment.user.id, 100);
} }
} }
} }
@@ -375,10 +370,8 @@ mod tests {
let payload: ReviewPayload = serde_json::from_value(json).unwrap(); let payload: ReviewPayload = serde_json::from_value(json).unwrap();
assert_eq!(payload.action, "created"); assert_eq!(payload.action, "created");
assert_eq!(payload.pull_request.id, 99);
assert_eq!(payload.comment.id, 12); assert_eq!(payload.comment.id, 12);
assert_eq!(payload.comment.body, "Needs work"); assert_eq!(payload.comment.body, "Needs work");
assert_eq!(payload.comment.user.id, 200);
} }
#[test] #[test]