Skip to content

Commit

Permalink
Return descriptions for extensions (#7869)
Browse files Browse the repository at this point in the history
This PR updates the extensions API to return descriptions for
extensions.

Release Notes:

- N/A
  • Loading branch information
maxdeviant authored Feb 15, 2024
1 parent 694e184 commit e6766e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/collab/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ pub struct ExtensionMetadata {
pub name: String,
pub version: String,
pub authors: Vec<String>,
pub description: String,
pub repository: String,
#[serde(serialize_with = "serialize_iso8601")]
pub published_at: PrimitiveDateTime,
Expand Down
1 change: 1 addition & 0 deletions crates/collab/src/db/queries/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl Database {
.split(',')
.map(|author| author.trim().to_string())
.collect::<Vec<_>>(),
description: version.description,
repository: version.repository,
published_at: version.published_at,
download_count: extension.total_download_count as u64,
Expand Down
8 changes: 7 additions & 1 deletion crates/collab/src/db/tests/extension_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ async fn test_extensions(db: &Arc<Database>) {
name: "Extension One".into(),
version: "0.0.2".into(),
authors: vec!["max".into(), "marshall".into()],
description: "a good extension".into(),
repository: "ext1/repo".into(),
published_at: t0,
download_count: 0,
Expand All @@ -93,6 +94,7 @@ async fn test_extensions(db: &Arc<Database>) {
name: "Extension Two".into(),
version: "0.2.0".into(),
authors: vec!["marshall".into()],
description: "a great extension".into(),
repository: "ext2/repo".into(),
published_at: t0,
download_count: 0
Expand Down Expand Up @@ -129,6 +131,7 @@ async fn test_extensions(db: &Arc<Database>) {
name: "Extension Two".into(),
version: "0.2.0".into(),
authors: vec!["marshall".into()],
description: "a great extension".into(),
repository: "ext2/repo".into(),
published_at: t0,
download_count: 7
Expand All @@ -138,6 +141,7 @@ async fn test_extensions(db: &Arc<Database>) {
name: "Extension One".into(),
version: "0.0.2".into(),
authors: vec!["max".into(), "marshall".into()],
description: "a good extension".into(),
repository: "ext1/repo".into(),
published_at: t0,
download_count: 5,
Expand Down Expand Up @@ -165,7 +169,7 @@ async fn test_extensions(db: &Arc<Database>) {
vec![NewExtensionVersion {
name: "Extension Two".into(),
version: semver::Version::parse("0.1.0").unwrap(),
description: "an old extension".into(),
description: "an old extension".into(),
authors: vec!["marshall".into()],
repository: "ext2/repo".into(),
published_at: t0,
Expand Down Expand Up @@ -201,6 +205,7 @@ async fn test_extensions(db: &Arc<Database>) {
name: "Extension Two".into(),
version: "0.2.0".into(),
authors: vec!["marshall".into()],
description: "a great extension".into(),
repository: "ext2/repo".into(),
published_at: t0,
download_count: 7
Expand All @@ -210,6 +215,7 @@ async fn test_extensions(db: &Arc<Database>) {
name: "Extension One".into(),
version: "0.0.3".into(),
authors: vec!["max".into(), "marshall".into()],
description: "a real good extension".into(),
repository: "ext1/repo".into(),
published_at: t0,
download_count: 5,
Expand Down

0 comments on commit e6766e1

Please sign in to comment.