Skip to content

Commit

Permalink
Merge pull request #2677 from parca-dev/shareability-fix
Browse files Browse the repository at this point in the history
Shareability fixes
  • Loading branch information
brancz committed Mar 2, 2023
2 parents 8123277 + bca64ef commit 501bf54
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COPY ui .
COPY --from=ui-deps /app/node_modules ./node_modules
RUN yarn workspace @parca/web build

FROM docker.io/golang:1.20.1-alpine@sha256:48f336ef8366b9d6246293e3047259d0f614ee167db1869bdbc343d6e09aed8a AS builder
FROM docker.io/golang:1.20.1-alpine@sha256:87d0a3309b34e2ca732efd69fb899d3c420d3382370fd6e7e6d2cb5c930f27f9 AS builder

# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.20.1
Expand Down Expand Up @@ -45,7 +45,7 @@ COPY ./gen /app/gen

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -gcflags="all=-N -l" -o parca ./cmd/parca

FROM docker.io/golang:1.20.1-alpine@sha256:48f336ef8366b9d6246293e3047259d0f614ee167db1869bdbc343d6e09aed8a
FROM docker.io/golang:1.20.1-alpine@sha256:87d0a3309b34e2ca732efd69fb899d3c420d3382370fd6e7e6d2cb5c930f27f9

COPY --from=builder /go/bin/dlv /
COPY --from=builder /go/bin/grpc-health-probe /
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.go.dev
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vim: ft=dockerfile
# Designed to only used by Tilt to iterate faster on the API.
FROM docker.io/golang:1.20.1-alpine@sha256:48f336ef8366b9d6246293e3047259d0f614ee167db1869bdbc343d6e09aed8a AS builder
FROM docker.io/golang:1.20.1-alpine@sha256:87d0a3309b34e2ca732efd69fb899d3c420d3382370fd6e7e6d2cb5c930f27f9 AS builder

# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.20.1
Expand Down Expand Up @@ -36,7 +36,7 @@ COPY ./gen /app/gen
# goreleaser build --single-target
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags="all=-N -l" -o parca ./cmd/parca

FROM docker.io/golang:1.20.1-alpine@sha256:48f336ef8366b9d6246293e3047259d0f614ee167db1869bdbc343d6e09aed8a
FROM docker.io/golang:1.20.1-alpine@sha256:87d0a3309b34e2ca732efd69fb899d3c420d3382370fd6e7e6d2cb5c930f27f9

COPY --from=builder /go/bin/dlv /
COPY --from=builder /go/bin/grpc-health-probe /
Expand Down
12 changes: 6 additions & 6 deletions ui/packages/shared/profile/src/ProfileExplorer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ const ProfileExplorerApp = ({
dashboard_items,
} = queryParams;

// eslint-disable-next-line @typescript-eslint/naming-convention
const expression_a = getExpressionAsAString(queryParams.expression_a);

// eslint-disable-next-line @typescript-eslint/naming-convention
const expression_b = getExpressionAsAString(queryParams.expression_b);

/* eslint-enable @typescript-eslint/naming-convention */
const [profileA, setProfileA] = useState<ProfileSelection | null>(null);
const [profileB, setProfileB] = useState<ProfileSelection | null>(null);
Expand Down Expand Up @@ -176,12 +182,6 @@ const ProfileExplorerApp = ({
from_a = sanitizedRange.from_a;
to_a = sanitizedRange.to_a;

// eslint-disable-next-line @typescript-eslint/naming-convention
const expression_a = getExpressionAsAString(queryParams.expression_a);

// eslint-disable-next-line @typescript-eslint/naming-convention
const expression_b = getExpressionAsAString(queryParams.expression_b);

if ((queryParams?.expression_a ?? '') !== '') queryParams.expression_a = expression_a;
if ((queryParams?.expression_b ?? '') !== '') queryParams.expression_b = expression_b;

Expand Down
11 changes: 9 additions & 2 deletions ui/packages/shared/profile/src/ProfileSelector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,19 @@ const ProfileSelector = ({
to={querySelection.to}
profile={profileSelection}
setTimeRange={(range: DateTimeRange) => {
const from = range.getFromMs();
const to = range.getToMs();
let mergedProfileParams = {};
if (query.profileType().delta) {
mergedProfileParams = {mergeFrom: from, mergeTo: to};
}
setTimeRangeSelection(range);
selectQuery({
expression: queryExpressionString,
from: range.getFromMs(),
to: range.getToMs(),
from,
to,
timeSelection: range.getRangeKey(),
...mergedProfileParams,
});
}}
addLabelMatcher={addLabelMatcher}
Expand Down

0 comments on commit 501bf54

Please sign in to comment.