Skip to content

Commit 8e3a5f8

Browse files
authored
feat(emerge): Add git info to frontend (#97457)
<img width="520" height="720" alt="image" src="https://github.com/user-attachments/assets/f849d89c-9599-403a-923b-d86eae055217" />
1 parent 13f8e31 commit 8e3a5f8

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

static/app/views/preprod/sidebar/buildDetailsSidebarContent.tsx

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,63 @@ export function BuildDetailsSidebarContent(props: BuildDetailsSidebarContentProp
3636
return <Alert type="error">No build details found</Alert>;
3737
}
3838

39+
// TODO: Linkify
3940
const vcsInfoContentItems: KeyValueDataContentProps[] = [
4041
{
4142
item: {
4243
key: 'SHA',
4344
subject: 'SHA',
44-
value: buildDetailsData.vcs_info?.commit_id ?? '-',
45+
value: buildDetailsData.vcs_info.head_sha ?? '-',
4546
},
4647
},
4748
{
4849
item: {
4950
key: 'Base SHA',
5051
subject: 'Base SHA',
51-
value: '-', // TODO: Implement in the future when available
52-
},
53-
},
54-
{
55-
item: {
56-
key: 'Previous SHA',
57-
subject: 'Previous SHA',
58-
value: '-', // TODO: Implement in the future when available
52+
value: buildDetailsData.vcs_info.base_sha ?? '-',
5953
},
6054
},
6155
{
6256
item: {
6357
key: 'PR Number',
6458
subject: 'PR Number',
65-
value: '-', // TODO: Implement in the future when available
59+
value: buildDetailsData.vcs_info.pr_number ?? '-',
6660
},
6761
},
6862
{
6963
item: {
7064
key: 'Branch',
7165
subject: 'Branch',
72-
value: '-', // TODO: Implement in the future when available
66+
value: buildDetailsData.vcs_info.head_ref ?? '-',
67+
},
68+
},
69+
{
70+
item: {
71+
key: 'Base Branch',
72+
subject: 'Base Branch',
73+
value: buildDetailsData.vcs_info.base_ref ?? '-',
7374
},
7475
},
7576
{
7677
item: {
7778
key: 'Repo Name',
7879
subject: 'Repo Name',
79-
value: '-', // TODO: Implement in the future when available
80+
value: buildDetailsData.vcs_info.head_repo_name ?? '-',
8081
},
8182
},
8283
];
8384

85+
// Base repo name is only available for forks, so we shouldn't show it if it's not present
86+
if (buildDetailsData.vcs_info.base_repo_name) {
87+
vcsInfoContentItems.push({
88+
item: {
89+
key: 'Base Repo Name',
90+
subject: 'Base Repo Name',
91+
value: buildDetailsData.vcs_info.base_repo_name,
92+
},
93+
});
94+
}
95+
8496
return (
8597
<Flex direction="column" gap="2xl">
8698
{/* App info */}

static/app/views/preprod/types/buildDetailsTypes.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ export interface BuildDetailsAppInfo {
2222
}
2323

2424
interface BuildDetailsVcsInfo {
25-
commit_id: string | null;
26-
// repo?: string; // Uncomment when available
27-
// provider?: string; // Uncomment when available
28-
// branch?: string; // Uncomment when available
25+
base_ref?: string;
26+
base_repo_name?: string;
27+
base_sha?: string;
28+
head_ref?: string;
29+
head_repo_name?: string;
30+
head_sha?: string;
31+
pr_number?: number;
32+
provider?: 'github' | 'github_enterprise' | 'gitlab' | 'bitbucket' | 'bitbucket_server';
2933
}
3034

3135
export interface BuildDetailsSizeInfo {

0 commit comments

Comments
 (0)