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 add description #25

Merged
merged 1 commit 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: 2 additions & 0 deletions src/scm/driver/github/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub struct GithubRepository {
pub default_branch: String,
pub created_at: String,
pub updated_at: String,
pub description: String,
}

#[derive(Debug, Deserialize, Serialize)]
Expand All @@ -72,6 +73,7 @@ impl From<GithubRepository> for Repository {
link: val.html_url,
created: val.created_at,
updated: val.updated_at,
description: val.description,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/scm/driver/gitlab/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub struct GitlabRepository {
pub http_url: String,
pub namespace: GitlabNamespace,
pub created_at: String,
pub description: String,
// pub updated_at: String,
}

Expand All @@ -75,6 +76,7 @@ impl From<GitlabRepository> for Repository {
link: val.web_url,
created: val.created_at,
updated: "".to_string(),
description: val.description,
};

if !val.namespace.full_path.is_empty() {
Expand Down
1 change: 1 addition & 0 deletions src/scm/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub struct Repository {
pub link: String,
pub created: String,
pub updated: String,
pub description: String,
}

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

const REPO: &str = "octocat/Hello-World";
const REFERENCE: &str = "master";
const DESCRIPTION: &str = "My first repository on GitHub!";

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

let repo = result.unwrap().unwrap();
assert_eq!(repo.branch, REFERENCE.to_string());
assert_eq!(repo.description, DESCRIPTION.to_string());
}
2 changes: 2 additions & 0 deletions tests/scm/driver/gitlab/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +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";

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

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