-
Notifications
You must be signed in to change notification settings - Fork 1
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
[WIP] Rework jobs and projects response types. #48
base: development
Are you sure you want to change the base?
Conversation
#[derive(Serialize, Deserialize, Default, JsonSchema)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ProjectStats { | ||
pub licenses: LicensesStats, | ||
pub issue_status: IssueStatusStats, | ||
pub dependencies: DependenciesStats, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem to be related to a job and not a project. Should this be JobStats
?
pub struct JobProject { | ||
pub id: ProjectId, | ||
pub name: String, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To support group-owned projects, this probably also needs an optional group name.
pub struct JobScore { | ||
pub value: f64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be really helpful to have the per-axis scores for the job included along side the overall job score.
/// Response type for the API /jobs/<job id> endpoint. | ||
#[derive(Serialize, Deserialize, JsonSchema)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct JobResponse { | ||
#[serde(flatten)] | ||
pub essentials: JobEssentials, | ||
pub status: Status, | ||
pub package_statuses: Vec<PackageStatusExtended>, | ||
pub action: Action, | ||
pub thresholds: ProjectThresholds, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A list of issues would be a good addition here
|
This is a proposal for how we could restructure the API response types for jobs and projects in order to provide more consistent data across these endpoints.
In this PR, I figure we could have some discussion to talk about the structure of these response types and whether or not the way that I've reworked it makes sense. I've tried to preserve all data that had already existed for each type, however it has been restructured a bit. Please let me know if you notice that I've missed anything.
I haven't put in the work to preserve backwards compatability yet, as this PR is just a discussion piece. When the time comes to actually implement these changes, that will be done.
Some particular things to note:
Still need to figure out a few things... I will add relevant reviewers when this is ready to be looked at!