Skip to content

Commit bdb4471

Browse files
committed
De-serialize author association as part of the GitHub issue
1 parent e914e5d commit bdb4471

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/github.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bytes::Bytes;
44
use chrono::{DateTime, FixedOffset, Utc};
55
use futures::{future::BoxFuture, FutureExt};
66
use hyper::header::HeaderValue;
7-
use octocrab::models::Author;
7+
use octocrab::models::{Author, AuthorAssociation};
88
use regex::Regex;
99
use reqwest::header::{AUTHORIZATION, USER_AGENT};
1010
use reqwest::{Client, Request, RequestBuilder, Response, StatusCode};
@@ -396,6 +396,9 @@ pub struct Issue {
396396
pub milestone: Option<Milestone>,
397397
/// Whether a PR has merge conflicts.
398398
pub mergeable: Option<bool>,
399+
400+
/// How the author is associated with the repository
401+
pub author_association: AuthorAssociation,
399402
}
400403

401404
#[derive(Debug, serde::Deserialize, Eq, PartialEq)]

src/handlers/shortcut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use crate::{
66
config::ShortcutConfig,
77
db::issue_data::IssueData,
8-
github::{Event, Label},
8+
github::{AuthorAssociation, Event, Label},
99
handlers::Context,
1010
interactions::ErrorComment,
1111
};

src/tests/github.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ pub fn issue(
7171
state,
7272
milestone: None,
7373
mergeable: None,
74+
author_association: octocrab::models::AuthorAssociation::None,
7475
}
7576
}
7677

0 commit comments

Comments
 (0)