[WIP] Rework jobs and projects response types.#48
Draft
mathew-horner wants to merge 1 commit intodevelopmentfrom
Draft
[WIP] Rework jobs and projects response types.#48mathew-horner wants to merge 1 commit intodevelopmentfrom
mathew-horner wants to merge 1 commit intodevelopmentfrom
Conversation
kylewillmon
reviewed
Aug 23, 2022
Comment on lines
+97
to
+103
| #[derive(Serialize, Deserialize, Default, JsonSchema)] | ||
| #[serde(rename_all = "camelCase")] | ||
| pub struct ProjectStats { | ||
| pub licenses: LicensesStats, | ||
| pub issue_status: IssueStatusStats, | ||
| pub dependencies: DependenciesStats, | ||
| } |
Contributor
There was a problem hiding this comment.
These seem to be related to a job and not a project. Should this be JobStats?
Comment on lines
+47
to
+50
| pub struct JobProject { | ||
| pub id: ProjectId, | ||
| pub name: String, | ||
| } |
Contributor
There was a problem hiding this comment.
To support group-owned projects, this probably also needs an optional group name.
Comment on lines
+54
to
+55
| pub struct JobScore { | ||
| pub value: f64, |
Contributor
There was a problem hiding this comment.
It would be really helpful to have the per-axis scores for the job included along side the overall job score.
Comment on lines
+25
to
+35
| /// 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, | ||
| } |
Contributor
There was a problem hiding this comment.
A list of issues would be a good addition here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!