8000 Deployment Versioning Updates by Alex-Tideman · Pull Request #2764 · temporalio/ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Deployment Versioning Updates #2764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 16, 2025
Merged
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
2 changes: 1 addition & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/labstack/echo/v4 v4.13.3
github.com/stretchr/testify v1.10.0
github.com/urfave/cli/v2 v2.3.0
go.temporal.io/api v1.49.1
go.temporal.io/api v1.50.0
golang.org/x/net v0.38.0
golang.org/x/oauth2 v0.30.0
google.golang.org/grpc v1.66.0
Expand Down
4 changes: 2 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
go.temporal.io/api v1.49.1 h1:CdiIohibamF4YP9k261DjrzPVnuomRoh1iC//gZ1puA=
go.temporal.io/api v1.49.1/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
go.temporal.io/api v1.50.0 h1:7s8Cn+fKfNx9G0v2Ge9We6X2WiCA3JvJ9JryeNbx1Bc=
go.temporal.io/api v1.50.0/go.mod h1:iaxoP/9OXMJcQkETTECfwYq4cw/bj4nwov8b3ZLVnXM=
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
Expand Down
15 changes: 5 additions & 10 deletions src/lib/components/deployments/deployment-status.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
import type { DeploymentStatus } from '$lib/types/deployments';

export let status: DeploymentStatus;
export let version: string;
export let label: string;

const icon: Record<DeploymentStatus, IconName> = {
const icon: Partial<Record<DeploymentStatus, IconName>> = {
Current: 'heartbeat',
Ramping: 'trending-up',
Draining: 'trending-down',
Expand All @@ -19,11 +18,12 @@

const deploymentStatus = cva(
[
'flex items-center gap-1 rounded-sm border border-subtle px-1 transition-colors',
'flex items-center gap-1 px-1 transition-colors rounded-sm border border-subtle',
],
{
variants: {
status: {
Latest: 'text-secondary',
Ramping: 'text-cyan-600 dark:text-cyan-400',
Current: 'text-blue-600 dark:text-blue-400',
Draining: 'text-yellow-600 dark:text-yellow-200',
Expand All @@ -35,11 +35,6 @@
);
</script>

<p class="flex items-center gap-2">
<span class="rounded-sm border border-subtle px-1">
{version}
</span>
<span class={deploymentStatus({ status })}>
<Icon name={icon[status]} />{label}</span
>
<p class={deploymentStatus({ status })}>
<Icon name={icon[status]} />{label}
</p>
108 changes: 76 additions & 32 deletions src/lib/components/deployments/deployment-table-row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,80 +7,124 @@
import { relativeTime, timeFormat } from '$lib/stores/time-format';
import type { WorkerDeploymentSummary } from '$lib/types/deployments';
import { formatDate } from '$lib/utilities/format-date';
import { getBuildIdFromVersion } from '$lib/utilities/get-deployment-build-id';
import {
routeForWorkerDeployment,
routeForWorkflowsWithQuery,
} from '$lib/utilities/route-for';

import DeploymentStatus from './deployment-status.svelte';

export let deployment: WorkerDeploymentSummary;
export let columns: ConfigurableTableHeader[];
type Props = {
deployment: WorkerDeploymentSummary;
columns: ConfigurableTableHeader[];
};
let { deployment, columns }: Props = $props();

const latestBuildId = $derived(
deployment?.latestVersionSummary?.deploymentVersion?.buildId,
);
const rampingBuildId = $derived(
deployment?.rampingVersionSummary?.deploymentVersion?.buildId ||
getBuildIdFromVersion(deployment?.routingConfig?.rampingVersion),
);
const rampingVersionDeployedTimestamp = $derived(
deployment?.rampingVersionSummary?.createTime ||
deployment?.routingConfig?.rampingVersionChangedTime,
);
const currentBuildId = $derived(
deployment?.currentVersionSummary?.deploymentVersion?.buildId ||
getBuildIdFromVersion(deployment?.routingConfig?.currentVersion),
);
const latestNotDuplicate = $derived(
latestBuildId !== rampingBuildId && latestBuildId !== currentBuildId,
);
</script>

<tr>
{#each columns as { label } (label)}
{#if label === translate('deployments.name')}
<td class="p-2 text-left"
<td class="py-1 text-left"
><Link
href={routeForWorkerDeployment({
namespace: $page.params.namespace,
deployment: deployment.name,
})}>{deployment.name}</Link
></td
>
{:else if label === translate('deployments.deployment-version')}
<td class="whitespace-pre-line break-words p-2 text-left">
{:else if label === translate('deployments.build-id')}
<td class="whitespace-pre-line break-words py-1 text-left">
<div class="flex flex-col gap-1">
{#if deployment.routingConfig.rampingVersion}
{#if latestBuildId && latestNotDuplicate}
<div class="flex items-center gap-2">
{latestBuildId}
<DeploymentStatus
status="Latest"
label={translate('deployments.latest')}
/>
</div>
{/if}
{#if rampingBuildId}
<div class="flex items-center gap-2">
{rampingBuildId}
{#if deployment?.routingConfig?.rampingVersionPercentage}
<DeploymentStatus
status="Ramping"
label={translate('deployments.ramping-percentage', {
percentage:
deployment.routingConfig.rampingVersionPercentage,
})}
/>
{/if}
</div>
{/if}
<div class="flex items-center gap-2">
{currentBuildId}
<DeploymentStatus
status="Ramping"
version={deployment.routingConfig.rampingVersion}
label={translate('deployments.ramping-percentage', {
percentage: deployment.routingConfig.rampingVersionPercentage,
})}
status="Current"
label={translate('deployments.current')}
/>
{/if}
<DeploymentStatus
status="Current"
version={deployment.routingConfig.currentVersion}
label={translate('deployments.current')}
/>
</div>
</div>
</td>
{:else if label === translate('deployments.deployed')}
<td class="truncate p-2 text-left">
<td class="truncate py-1 text-left">
<div class="flex flex-col gap-1">
{#if deployment.routingConfig.rampingVersionChangedTime}
{#if latestBuildId && latestNotDuplicate && deployment.latestVersionSummary?.createTime}
<p>
{formatDate(
deployment.routingConfig.rampingVersionChangedTime,
deployment.latestVersionSummary.createTime,
$timeFormat,
{
relative: $relativeTime,
},
)}
</p>
{/if}
{#if rampingBuildId && rampingVersionDeployedTimestamp}
<p>
{formatDate(rampingVersionDeployedTimestamp, $timeFormat, {
relative: $relativeTime,
})}
</p>
{/if}
<p>
{formatDate(deployment.createTime, $timeFormat, {
relative: $relativeTime,
})}
</p>
</div>
</td>
{:else if label === translate('deployments.workflows')}
<td class="truncate p-2 text-center"
><p>
<Link
icon="external-link"
href={routeForWorkflowsWithQuery({
namespace: $page.params.namespace,
query: `TemporalWorkerDeployment="${deployment.name}"`,
})}
/>
</p></td
>
{:else if label === translate('deployments.actions')}
<td class="w-24 truncate py-1">
<Link
icon="external-link"
href={routeForWorkflowsWithQuery({
namespace: $page.params.namespace,
query: `TemporalWorkerDeployment="${deployment.name}"`,
})}>{translate('deployments.go-to-workflows')}</Link
>
</td>
{/if}
{/each}
</tr>
109 changes: 70 additions & 39 deletions src/lib/components/deployments/version-table-row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,71 +5,102 @@
import { translate } from '$lib/i18n/translate';
import type { ConfigurableTableHeader } from '$lib/stores/configurable-table-columns';
import { relativeTime, timeFormat } from '$lib/stores/time-format';
import type { RoutingConfig, VersionSummary } from '$lib/types/deployments';
import type { DeploymentStatus as Status } from '$lib/types/deployments';
import {
isVersionSummaryNew,
type RoutingConfig,
type VersionSummary,
} from '$lib/types/deployments';
import { formatDate } from '$lib/utilities/format-date';
import { getBuildIdFromVersion } from '$lib/utilities/get-deployment-build-id';
import { routeForWorkflowsWithQuery } from '$lib/utilities/route-for';
import { fromScreamingEnum } from '$lib/utilities/screaming-enums';

import DeploymentStatus from './deployment-status.svelte';

export let routingConfig: RoutingConfig;
export let version: VersionSummary;
export let columns: ConfigurableTableHeader[];
type Props = {
routingConfig: RoutingConfig;
version: VersionSummary;
columns: ConfigurableTableHeader[];
};
let { routingConfig, version, columns }: Props = $props();

$: isCurrent = version.version === routingConfig.currentVersion;
$: isRamping = version.version === routingConfig.rampingVersion;
$: drainageStatus = version.drainageStatus;
const isCurrent = $derived(version.version === routingConfig.currentVersion);
const isRamping = $derived(version.version === routingConfig.rampingVersion);
const drainageStatus = $derived(
isVersionSummaryNew(version) ? version.status : version.drainageStatus,
);
const buildId = $derived(
isVersionSummaryNew(version)
? version.deploymentVersion.buildId
: getBuildIdFromVersion(version.version),
);
const statusEnum = $derived(
isVersionSummaryNew(version)
? 'WorkerDeploymentVersionStatus'
: 'VersionDrainageStatus',
);

$: status = (
const status = $derived(
isCurrent
? translate('deployments.current')
: isRamping
? translate('deployments.ramping')
: drainageStatus
? fromScreamingEnum(drainageStatus, 'VersionDrainageStatus')
: translate('common.inactive')
? fromScreamingEnum(drainageStatus, statusEnum)
: translate('common.inactive'),
) as Status;

$: statusLabel = isCurrent
? translate('deployments.current')
: isRamping
? translate('deployments.ramping', {
percentage: routingConfig.rampingVersionPercentage,
})
: drainageStatus
? fromScreamingEnum(drainageStatus, 'VersionDrainageStatus')
: translate('common.inactive');
const statusLabel = $derived(
isCurrent
? translate('deployments.current')
: isRamping
? translate('deployments.ramping-percentage', {
percentage: routingConfig.rampingVersionPercentage,
})
: drainageStatus
? fromScreamingEnum(drainageStatus, statusEnum)
: translate('common.inactive'),
);
</script>

<tr>
{#each columns as { label } (label)}
{#if label === translate('deployments.version')}
<td class="p-2 text-left">
<DeploymentStatus
{status}
version={version.version}
label={statusLabel}
/>
{#if label === translate('deployments.build-id')}
<td class="text-left">
{buildId}
</td>
{:else if label === translate('deployments.status')}
<td class="text-left">
<div class="flex items-center gap-2">
<DeploymentStatus {status} label={statusLabel} />
{#if isCurrent && isVersionSummaryNew(version) && version?.currentSinceTime}
Since {formatDate(version?.currentSinceTime, $timeFormat, {
relative: $relativeTime,
})}
{:else if isRamping && isVersionSummaryNew(version) && version?.rampingSinceTime}
Since {formatDate(version?.rampingSinceTime, $timeFormat, {
relative: $relativeTime,
})}
{/if}
</div>
</td>
{:else if label === translate('deployments.deployed')}
<td class="whitespace-pre-line break-words p-2 text-left"
<td class="whitespace-pre-line break-words text-left"
>{formatDate(version?.createTime, $timeFormat, {
relative: $relativeTime,
})}</td
>
{:else if label === translate('deployments.workflows')}
<td class="whitespace-pre-line break-words p-2 text-center"
><p>
<Link
icon="external-link"
href={routeForWorkflowsWithQuery({
namespace: $page.params.namespace,
query: `TemporalWorkerDeploymentVersion="${version.version}"`,
})}
/>
</p></td
>
{:else if label === translate('deployments.actions')}
<td class="w-24 whitespace-pre-line break-words">
<Link
icon="external-link"
href={routeForWorkflowsWithQuery({
namespace: $page.params.namespace,
query: `TemporalWorkerDeploymentVers 5AA0 ion="${version.version}"`,
})}>{translate('deployments.go-to-workflows')}</Link
>
</td>
{/if}
{/each}
</tr>
Loading
Loading
0