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

repo description is changed to Option #26

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/scm/driver/github/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub struct GithubRepository {
pub default_branch: String,
pub created_at: String,
pub updated_at: String,
pub description: String,
pub description: Option<String>,
}

#[derive(Debug, Deserialize, Serialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/scm/driver/gitlab/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub struct GitlabRepository {
pub http_url: String,
pub namespace: GitlabNamespace,
pub created_at: String,
pub description: String,
pub description: Option<String>,
// pub updated_at: String,
}

Expand Down
2 changes: 1 addition & 1 deletion src/scm/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct Repository {
pub link: String,
pub created: String,
pub updated: String,
pub description: String,
pub description: Option<String>,
}

/// Provides access to repository resources.
Expand Down
7 changes: 5 additions & 2 deletions tests/scm/driver/github/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::common::mock;

const REPO: &str = "octocat/Hello-World";
const REFERENCE: &str = "master";
const DESCRIPTION: &str = "My first repository on GitHub!";
const DESCRIPTION: Option<&str> = Some("My first repository on GitHub!");

#[test]
fn test_find() {
Expand All @@ -36,5 +36,8 @@ fn test_find() {

let repo = result.unwrap().unwrap();
assert_eq!(repo.branch, REFERENCE.to_string());
assert_eq!(repo.description, DESCRIPTION.to_string());
assert_eq!(
repo.description.unwrap_or_default(),
DESCRIPTION.unwrap_or_default()
);
}
7 changes: 5 additions & 2 deletions tests/scm/driver/gitlab/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::common::mock;

const REPO: &str = "octocat/Hello-World";
const REFERENCE: &str = "master";
const DESCRIPTION: &str = "Repository used by GitLab CE/EE and Gitaly tests";
const DESCRIPTION: Option<&str> = Some("Repository used by GitLab CE/EE and Gitaly tests");

#[test]
fn test_find() {
Expand All @@ -36,5 +36,8 @@ fn test_find() {

let repo = result.unwrap().unwrap();
assert_eq!(repo.branch, REFERENCE.to_string());
assert_eq!(repo.description, DESCRIPTION.to_string());
assert_eq!(
repo.description.unwrap_or_default(),
DESCRIPTION.unwrap_or_default()
);
}