f603725393
* remove registry proxy * remove --self-hosted flag * automatically set network build flag * update syncEnvVars debug log * improve switch command * always display deploy errors if they exist * fix stuck deploy command after finalize error * webapp-driven deploys, multi-platform support, lots of fixes * add worker deployment migration * rename image platform env var * only try to sync parent env vars for preview deployments * add KEEP_TMP_DIRS * supervisor: docker api version lock, auth, multi-platform * set image ref on create, validate digest * use metadata for digest, fix local multi-platform builds * print git meta branch before commit * improve push and load flag handling * make runs after local builds compatible with load and push * small improvement for platform overrides * add image platform to dequeued message * remove deprecated init request body fields * fix fail deployment id param * remove build debug logs * pass report merge with no tests * structured run debug logs * add required env var for tests * should not be an error log * add changeset
87 lines
2.2 KiB
TypeScript
87 lines
2.2 KiB
TypeScript
import { GitPullRequestIcon, GitCommitIcon, GitBranchIcon } from "lucide-react";
|
|
import { type GitMetaLinks } from "~/presenters/v3/BranchesPresenter.server";
|
|
import { LinkButton } from "./primitives/Buttons";
|
|
import { SimpleTooltip } from "./primitives/Tooltip";
|
|
|
|
export function GitMetadata({ git }: { git?: GitMetaLinks | null }) {
|
|
if (!git) return null;
|
|
return (
|
|
<>
|
|
{git.pullRequestUrl && git.pullRequestNumber && <GitMetadataPullRequest git={git} />}
|
|
{git.branchUrl && <GitMetadataBranch git={git} />}
|
|
{git.shortSha && <GitMetadataCommit git={git} />}
|
|
</>
|
|
);
|
|
}
|
|
|
|
export function GitMetadataBranch({
|
|
git,
|
|
}: {
|
|
git: Pick<GitMetaLinks, "branchUrl" | "branchName">;
|
|
}) {
|
|
return (
|
|
<SimpleTooltip
|
|
button={
|
|
<LinkButton
|
|
variant="minimal/small"
|
|
LeadingIcon={<GitBranchIcon className="size-4" />}
|
|
iconSpacing="gap-x-1"
|
|
to={git.branchUrl}
|
|
className="pl-1"
|
|
>
|
|
{git.branchName}
|
|
</LinkButton>
|
|
}
|
|
content="Jump to GitHub branch"
|
|
/>
|
|
);
|
|
}
|
|
|
|
export function GitMetadataCommit({
|
|
git,
|
|
}: {
|
|
git: Pick<GitMetaLinks, "commitUrl" | "shortSha" | "commitMessage">;
|
|
}) {
|
|
return (
|
|
<SimpleTooltip
|
|
button={
|
|
<LinkButton
|
|
variant="minimal/small"
|
|
to={git.commitUrl}
|
|
LeadingIcon={<GitCommitIcon className="size-4" />}
|
|
iconSpacing="gap-x-1"
|
|
className="pl-1"
|
|
>
|
|
{`${git.shortSha} / ${git.commitMessage}`}
|
|
</LinkButton>
|
|
}
|
|
content="Jump to GitHub commit"
|
|
/>
|
|
);
|
|
}
|
|
|
|
export function GitMetadataPullRequest({
|
|
git,
|
|
}: {
|
|
git: Pick<GitMetaLinks, "pullRequestUrl" | "pullRequestNumber" | "pullRequestTitle">;
|
|
}) {
|
|
if (!git.pullRequestUrl || !git.pullRequestNumber) return null;
|
|
|
|
return (
|
|
<SimpleTooltip
|
|
button={
|
|
<LinkButton
|
|
variant="minimal/small"
|
|
to={git.pullRequestUrl}
|
|
LeadingIcon={<GitPullRequestIcon className="size-4" />}
|
|
iconSpacing="gap-x-1"
|
|
className="pl-1"
|
|
>
|
|
#{git.pullRequestNumber} {git.pullRequestTitle}
|
|
</LinkButton>
|
|
}
|
|
content="Jump to GitHub pull request"
|
|
/>
|
|
);
|
|
}
|