Skip to content

Commit

Permalink
repo add description
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahao6635 committed Jan 18, 2024
1 parent eb4a212 commit 8e2e39c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
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());
}

0 comments on commit 8e2e39c

Please sign in to comment.