Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/app/api_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ class SummaryResponse(BaseModel):
timestamp: int
download_size: int
installed_size: int
commits: dict[str, str] | None = None
metadata: SummaryMetadata | None = None

class Config:
Expand Down
7 changes: 6 additions & 1 deletion backend/app/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def parse_summary(summary, sqldb):
refs, metadata = data.unpack()
xa_cache = metadata["xa.cache"]

for ref, (_, _, info) in refs:
for ref, (commit_bytes, _, info) in refs:
if not (valid_ref := validate_ref(ref)):
continue

Expand All @@ -209,6 +209,11 @@ def parse_summary(summary, sqldb):
)
summary_dict[app_id]["timestamp"] = timestamp

commit_hash = OSTree.checksum_from_bytes(commit_bytes)
if "commits" not in summary_dict[app_id]:
summary_dict[app_id]["commits"] = {}
summary_dict[app_id]["commits"][arch] = commit_hash

for ref in xa_cache:
if not (valid_ref := validate_ref(ref)):
continue
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/codegen/app/app.msw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,17 @@ export const getGetSummarySummaryAppIdGetResponseMock = (
timestamp: faker.number.int({ min: undefined, max: undefined }),
download_size: faker.number.int({ min: undefined, max: undefined }),
installed_size: faker.number.int({ min: undefined, max: undefined }),
commits: faker.helpers.arrayElement([
faker.helpers.arrayElement([
{
[faker.string.alphanumeric(5)]: faker.string.alpha({
length: { min: 10, max: 20 },
}),
},
null,
]),
undefined,
]),
metadata: faker.helpers.arrayElement([
faker.helpers.arrayElement([
{
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/codegen/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ export * from "./summaryPermissionsShared"
export * from "./summaryPermissionsSockets"
export * from "./summaryResponse"
export * from "./summaryResponseBranch"
export * from "./summaryResponseCommits"
export * from "./summaryResponseCommitsAnyOf"
export * from "./summaryResponseMetadata"
export * from "./tokenCancellation"
export * from "./tokenCancellationStatus"
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/codegen/model/summaryResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* OpenAPI spec version: 0.1.0
*/
import type { SummaryResponseBranch } from "./summaryResponseBranch"
import type { SummaryResponseCommits } from "./summaryResponseCommits"
import type { SummaryResponseMetadata } from "./summaryResponseMetadata"

/**
Expand All @@ -19,6 +20,7 @@ export interface SummaryResponse {
timestamp: number
download_size: number
installed_size: number
commits?: SummaryResponseCommits
metadata?: SummaryResponseMetadata
[key: string]: unknown
}
9 changes: 9 additions & 0 deletions frontend/src/codegen/model/summaryResponseCommits.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Flathub API
* OpenAPI spec version: 0.1.0
*/
import type { SummaryResponseCommitsAnyOf } from "./summaryResponseCommitsAnyOf"

export type SummaryResponseCommits = SummaryResponseCommitsAnyOf | null
8 changes: 8 additions & 0 deletions frontend/src/codegen/model/summaryResponseCommitsAnyOf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Flathub API
* OpenAPI spec version: 0.1.0
*/

export type SummaryResponseCommitsAnyOf = { [key: string]: string }
Loading