Skip to content

Commit

Permalink
Accomodate API endpoint response cleanup. (#1394)
Browse files Browse the repository at this point in the history
* Update phylum-types to remove deserialization for soon-to-be removed API fields.

* Remove issue_impacts

* Delete removed fields from test fixtures.
  • Loading branch information
mathew-horner authored Apr 16, 2024
1 parent 0c05e09 commit c6e1f78
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions cli/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,8 @@ mod tests {
],
"msg": "Project met threshold requirements",
"pass": true,
"action": "warn",
"project": "test-project",
"total_jobs": 1,
"score": 1.0,
"ecosystem": "npm"
},
{
Expand All @@ -653,10 +651,8 @@ mod tests {
],
"msg": "Project met threshold requirements",
"pass": true,
"action": "break",
"project": "test-project",
"total_jobs": 1,
"score": 1.0,
"ecosystem": "npm"
}
Expand Down Expand Up @@ -716,12 +712,6 @@ mod tests {
"total_pull_request_count": 476,
"open_pull_request_avg_duration": 474
},
"issueImpacts": {
"low": 0,
"medium": 0,
"high": 0,
"critical": 0
},
"complete": false
}
}
Expand Down
12 changes: 0 additions & 12 deletions cli/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ pub struct Package {
pub issues: Vec<Issue>,
pub authors: Vec<Author>,
pub developer_responsiveness: Option<DeveloperResponsiveness>,
pub issue_impacts: IssueImpacts,
pub complete: bool,
pub release_data: Option<PackageReleaseData>,
pub repo_url: Option<String>,
Expand Down Expand Up @@ -271,17 +270,6 @@ pub struct DeveloperResponsiveness {
pub open_pull_request_avg_duration: Option<u32>,
}

/// The number of issues a package has, broken down by severity.
#[derive(Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
#[serde(default)]
pub struct IssueImpacts {
pub low: u32,
pub medium: u32,
pub high: u32,
pub critical: u32,
}

/// Information about when package releases have happened.
#[derive(Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
Expand Down
1 change: 0 additions & 1 deletion extensions/phylum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ export class PhylumApi {
* total_pull_request_count: 0,
* open_pull_request_avg_duration: null
* },
* issueImpacts: { low: 0, medium: 0, high: 0, critical: 0 },
* complete: true
* }
* ```
Expand Down

0 comments on commit c6e1f78

Please sign in to comment.