- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: show more detailed provisioner version info#14593
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
11 commits Select commitHold shift + click to select a range
665c9b3 work
aslilac4558b44 do the stuff
aslilacfcd8614 🧹
aslilac82c6362 feat: show more detailed provisioner version info
aslilac8bb49a7 🧹
aslilac401eab3 Merge branch 'main' into group-provisioners
aslilac716b257 hook up to api
aslilaca1b7cbd :)
aslilac5d6d312 Merge branch 'group-provisioners' into provisioner-version-popups
aslilac37e3933 v2.99.99
aslilac05cdba4 Merge branch 'main' into provisioner-version-popups
aslilacFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletionsite/src/modules/dashboard/Navbar/UserDropdown/UserDropdown.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -31,7 +31,7 @@ const Example: Story = { | ||
| await step("click to open", async () => { | ||
| await userEvent.click(canvas.getByRole("button")); | ||
| await waitFor(() => | ||
| expect(screen.getByText(/v2\.99\.99/i)).toBeInTheDocument(), | ||
aslilac marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| ); | ||
| }); | ||
| }, | ||
68 changes: 64 additions & 4 deletionssite/src/modules/provisioners/ProvisionerGroup.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,20 @@ | ||
| import {type Interpolation, type Theme,useTheme } from "@emotion/react"; | ||
| import Business from "@mui/icons-material/Business"; | ||
| import Person from "@mui/icons-material/Person"; | ||
| import Button from "@mui/material/Button"; | ||
| import Link from "@mui/material/Link"; | ||
| import Tooltip from "@mui/material/Tooltip"; | ||
| import type { BuildInfoResponse, ProvisionerDaemon } from "api/typesGenerated"; | ||
| import { DropdownArrow } from "components/DropdownArrow/DropdownArrow"; | ||
| import { Pill } from "components/Pill/Pill"; | ||
| import { | ||
| Popover, | ||
| PopoverContent, | ||
| PopoverTrigger, | ||
| } from "components/Popover/Popover"; | ||
| import { type FC, useState } from "react"; | ||
| import { createDayString } from "utils/createDayString"; | ||
| import { docs } from "utils/docs"; | ||
| import { ProvisionerTag } from "./ProvisionerTag"; | ||
| type ProvisionerGroupType = "builtin" | "psk" | "key"; | ||
| @@ -159,14 +166,51 @@ export const ProvisionerGroup: FC<ProvisionerGroupProps> = ({ | ||
| width: 310, | ||
| }} | ||
| > | ||
| <div css={{ lineHeight:1.6 }}> | ||
| <h4 css={{ fontWeight: 500, margin: 0 }}>{provisioner.name}</h4> | ||
| <span | ||
| css={{ color: theme.palette.text.secondary, fontSize: 13 }} | ||
| > | ||
| {type === "builtin" ? ( | ||
| <span>Built-in</span> | ||
| ) : ( | ||
| <> | ||
| <Popover mode="hover"> | ||
| <PopoverTrigger> | ||
| <span> | ||
| {buildInfo | ||
| ? provisioner.version === buildInfo.version | ||
| ? "Up to date" | ||
| : "Out of date" | ||
| : provisioner.version} | ||
| </span> | ||
| </PopoverTrigger> | ||
| <PopoverContent | ||
| transformOrigin={{ vertical: -8, horizontal: 0 }} | ||
| css={{ | ||
| "& .MuiPaper-root": { | ||
| padding: "20px 20px 8px", | ||
| maxWidth: 340, | ||
| }, | ||
| }} | ||
| > | ||
| <h4 css={styles.title}>Release version</h4> | ||
| <p css={styles.text}>{provisioner.version}</p> | ||
| <h4 css={styles.title}>Protocol version</h4> | ||
| <p css={styles.text}>{provisioner.api_version}</p> | ||
| {provisioner.api_version !== | ||
| buildInfo?.provisioner_api_version && ( | ||
| <p css={[styles.text, { fontSize: 13 }]}> | ||
| This provisioner is out of date. You may | ||
| experience issues when using a provisioner version | ||
| that doesn’t match your Coder deployment. Please | ||
| upgrade to a newer version.{" "} | ||
| <Link href={docs("/")}>Learn more…</Link> | ||
| </p> | ||
| )} | ||
| </PopoverContent> | ||
| </Popover>{" "} | ||
| —{" "} | ||
| {provisioner.last_seen_at && ( | ||
| <span data-chromatic="ignore"> | ||
| Last seen {createDayString(provisioner.last_seen_at)} | ||
| @@ -211,3 +255,19 @@ export const ProvisionerGroup: FC<ProvisionerGroupProps> = ({ | ||
| </div> | ||
| ); | ||
| }; | ||
| const styles = { | ||
| title: (theme) => ({ | ||
| marginTop: 0, | ||
| marginBottom: 0, | ||
| color: theme.palette.text.primary, | ||
| fontSize: 14, | ||
| lineHeight: "150%", | ||
aslilac marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| fontWeight: 600, | ||
| }), | ||
| text: (theme) => ({ | ||
| marginTop: 0, | ||
| marginBottom: 12, | ||
| }), | ||
| } satisfies Record<string, Interpolation<Theme>>; | ||
13 changes: 13 additions & 0 deletionssite/src/pages/ManagementSettingsPage/OrganizationProvisionersPageView.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -26,6 +26,19 @@ export const Provisioners: Story = { | ||
| psk: [MockProvisioner, MockUserProvisioner, MockProvisionerWithTags], | ||
| userAuth: [], | ||
| keys: new Map([ | ||
| [ | ||
| "ベン", | ||
| [ | ||
| MockProvisioner, | ||
| { | ||
| ...MockProvisioner2, | ||
| version: "2.0.0", | ||
| api_version: "1.0", | ||
| warnings: [{ code: "EUNKNOWN", message: "私は時代遅れです" }], | ||
aslilac marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| }, | ||
| ], | ||
| ], | ||
| ["ジャイデン", [MockProvisioner, MockProvisioner2]], | ||
| [ | ||
| "ケイラ", | ||
| [ | ||
2 changes: 1 addition & 1 deletionsite/src/testHelpers/entities.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.