Skip to content

Commit 74efee5

Browse files
[server] Fix context setting for PRs for insights (#20456)
1 parent be9e7a8 commit 74efee5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

components/dashboard/src/insights/download/download-sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const downloadUsageCSV = async ({
8383
}: Args): Promise<DownloadUsageCSVResponse> => {
8484
const start = dayjs(from?.toDate()).format("YYYYMMDD");
8585
const end = dayjs(to?.toDate()).format("YYYYMMDD");
86-
const filename = `gitpod-usage-${organizationName}-${start}-${end}.csv`;
86+
const filename = `gitpod-sessions-${organizationName}-${start}-${end}.csv`;
8787

8888
const records = await getAllWorkspaceSessions({
8989
organizationId,

components/public-api/typescript-common/src/public-api-converter.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ import {
170170
WorkspaceSession_Owner,
171171
WorkspaceSession_WorkspaceContext,
172172
WorkspaceSession_WorkspaceContext_Repository,
173-
WorkspaceSession_WorkspaceContext_RefType
173+
WorkspaceSession_WorkspaceContext_RefType,
174174
} from "@gitpod/public-api/lib/gitpod/v1/workspace_pb";
175175
import { BigIntToJson } from "@gitpod/gitpod-protocol/lib/util/stringify";
176176
import { getPrebuildLogPath } from "./prebuild-utils";
@@ -211,7 +211,9 @@ export class PublicAPIConverter {
211211
const { metrics } = arg.instance.status;
212212
result.metrics = new WorkspaceSession_Metrics({
213213
totalImageSize: metrics?.image?.totalSize ? BigInt(metrics.image.totalSize) : undefined,
214-
workspaceImageSize: metrics?.image?.workspaceImageSize ? BigInt(metrics.image.workspaceImageSize) : undefined,
214+
workspaceImageSize: metrics?.image?.workspaceImageSize
215+
? BigInt(metrics.image.workspaceImageSize)
216+
: undefined,
215217
});
216218

217219
result.id = arg.instance.id;
@@ -460,10 +462,12 @@ export class PublicAPIConverter {
460462

461463
toWorkspaceSessionContext(arg: WorkspaceContext): WorkspaceSession_WorkspaceContext {
462464
const result = new WorkspaceSession_WorkspaceContext();
463-
if (NavigatorContext.is(arg)) {
465+
if (CommitContext.is(arg)) {
464466
result.revision = arg.revision;
465467
result.refType = this.toRefType(arg.refType);
466-
result.path = arg.path;
468+
if (NavigatorContext.is(arg)) {
469+
result.path = arg.path;
470+
}
467471
result.repository = new WorkspaceSession_WorkspaceContext_Repository({
468472
cloneUrl: arg.repository.cloneUrl,
469473
host: arg.repository.host,

0 commit comments

Comments
 (0)