From 182bb9bdda4335d08b87295d85ceecf4f7dcb0ab Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Wed, 5 Feb 2025 11:25:20 +0100 Subject: [PATCH 001/859] chore: update actions/cache to v4.2.0 (#16441) This updates actions/cache to v4.2.0 and adds missing development dependencies (gawk, gnutar, which, zip, gzip) to the Nix flake. Change-Id: I1156810c9e02f0cef8e1345a1cbf2b6ba484974a Signed-off-by: Thomas Kosiewski --- .github/workflows/ci.yaml | 2 +- flake.nix | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe95b1ede6b17..ea23582c33395 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -178,7 +178,7 @@ jobs: echo "LINT_CACHE_DIR=$dir" >> $GITHUB_ENV - name: golangci-lint cache - uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0 + uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: path: | ${{ env.LINT_CACHE_DIR }} diff --git a/flake.nix b/flake.nix index e9bf93f53c138..62260214f1d73 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,7 @@ drpc.defaultPackage.${system} formatter fzf + gawk gcc13 gdk getopt @@ -114,6 +115,7 @@ gnumake gnused gnugrep + gnutar go_1_22 go-migrate (pinnedPkgs.golangci-lint) @@ -147,6 +149,7 @@ sqlc terraform typos + which # Needed for many LD system libs! (lib.optional stdenv.isLinux util-linux) vim @@ -274,8 +277,10 @@ docker_26 shadow.out su - ncurses # clear + ncurses.out # clear unzip + zip + gzip ]) ++ oldAttrs.buildInputs; }); From c8ef7eb4f2a9643c00b3f7b58db8765a11a313b6 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Wed, 5 Feb 2025 03:22:20 -0800 Subject: [PATCH 002/859] fix: log unsuccessful webhook response body as a string (#16439) --- coderd/notifications/dispatch/webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coderd/notifications/dispatch/webhook.go b/coderd/notifications/dispatch/webhook.go index 1322996db10e1..65d6ed030af98 100644 --- a/coderd/notifications/dispatch/webhook.go +++ b/coderd/notifications/dispatch/webhook.go @@ -106,7 +106,7 @@ func (w *WebhookHandler) dispatch(msgPayload types.MessagePayload, titlePlaintex return true, xerrors.Errorf("non-2xx response (%d), read body: %w", resp.StatusCode, err) } w.log.Warn(ctx, "unsuccessful delivery", slog.F("status_code", resp.StatusCode), - slog.F("response", respBody[:n]), slog.F("msg_id", msgID)) + slog.F("response", string(respBody[:n])), slog.F("msg_id", msgID)) return true, xerrors.Errorf("non-2xx response (%d)", resp.StatusCode) } From 42451aa615a65187000e6f19d8e250e14fef7d06 Mon Sep 17 00:00:00 2001 From: Jaayden Halko Date: Wed, 5 Feb 2025 12:54:59 +0000 Subject: [PATCH 003/859] chore: add overlay color for background behind dialogs (#16442) Create tailwind color for the background overlay for dialogs Screenshot 2025-02-05 at 12 26 16 --- site/src/components/Dialog/Dialog.tsx | 2 +- site/src/index.css | 2 ++ site/tailwind.config.js | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/site/src/components/Dialog/Dialog.tsx b/site/src/components/Dialog/Dialog.tsx index 0770ec62ae735..dde7dcae3b291 100644 --- a/site/src/components/Dialog/Dialog.tsx +++ b/site/src/components/Dialog/Dialog.tsx @@ -27,7 +27,7 @@ export const DialogOverlay = forwardRef< Date: Wed, 5 Feb 2025 13:40:07 +0000 Subject: [PATCH 004/859] feat: orgs IDP sync - add combobox to select claim field value when sync field is set (#16335) contributes to coder/internal#330 For organizations IdP sync: 1. when the sync field is set, call the claim field values API to see if the sync field is a valid claim field and return an array of claim field values 2. If there are 1 or more claim field values, replace the input component for entering the IdP organization name with a combobox populated with the claim field values 3. The user can now select a value from the dropdown or enter a custom value Tests will be added in a separate PR The same functionality for Group and Role sync will be handled in a separate PR. Screenshot 2025-02-04 at 17 45 42 Screenshot 2025-02-04 at 17 45 58 Screenshot 2025-02-04 at 17 46 14 Screenshot 2025-02-04 at 17 52 08 --- site/e2e/tests/deployment/idpOrgSync.spec.ts | 14 +- site/src/api/api.ts | 17 ++ site/src/api/queries/organizations.ts | 32 ++++ site/src/components/Combobox/Combobox.tsx | 93 +++++++++++ site/src/components/Command/Command.tsx | 7 +- .../MultiSelectCombobox.tsx | 2 +- site/src/components/Select/Select.tsx | 13 +- .../management/OrganizationSidebarView.tsx | 9 +- .../IdpOrgSyncPage/IdpOrgSyncPage.tsx | 23 ++- .../IdpOrgSyncPage/IdpOrgSyncPageView.tsx | 146 ++++++++++++------ 10 files changed, 288 insertions(+), 68 deletions(-) create mode 100644 site/src/components/Combobox/Combobox.tsx diff --git a/site/e2e/tests/deployment/idpOrgSync.spec.ts b/site/e2e/tests/deployment/idpOrgSync.spec.ts index a5162d4055658..d77ddb1593fd3 100644 --- a/site/e2e/tests/deployment/idpOrgSync.spec.ts +++ b/site/e2e/tests/deployment/idpOrgSync.spec.ts @@ -150,6 +150,11 @@ test.describe("IdpOrgSyncPage", () => { waitUntil: "domcontentloaded", }); + const syncField = page.getByRole("textbox", { + name: "Organization sync field", + }); + await syncField.fill(""); + const idpOrgInput = page.getByLabel("IdP organization name"); const addButton = page.getByRole("button", { name: /Add IdP organization/i, @@ -157,7 +162,8 @@ test.describe("IdpOrgSyncPage", () => { await expect(addButton).toBeDisabled(); - await idpOrgInput.fill("new-idp-org"); + const idpOrgName = randomName(); + await idpOrgInput.fill(idpOrgName); // Select Coder organization from combobox const orgSelector = page.getByPlaceholder("Select organization"); @@ -177,11 +183,9 @@ test.describe("IdpOrgSyncPage", () => { await addButton.click(); // Verify new mapping appears in table - const newRow = page.getByTestId("idp-org-new-idp-org"); + const newRow = page.getByTestId(`idp-org-${idpOrgName}`); await expect(newRow).toBeVisible(); - await expect( - newRow.getByRole("cell", { name: "new-idp-org" }), - ).toBeVisible(); + await expect(newRow.getByRole("cell", { name: idpOrgName })).toBeVisible(); await expect(newRow.getByRole("cell", { name: orgName })).toBeVisible(); await expect( diff --git a/site/src/api/api.ts b/site/src/api/api.ts index 26491efb10565..cd21b5b063ac6 100644 --- a/site/src/api/api.ts +++ b/site/src/api/api.ts @@ -787,6 +787,23 @@ class ApiMethods { return response.data; }; + getIdpSyncClaimFieldValues = async (claimField: string) => { + const response = await this.axios.get( + `/api/v2/settings/idpsync/field-values?claimField=${claimField}`, + ); + return response.data; + }; + + getIdpSyncClaimFieldValuesByOrganization = async ( + organization: string, + claimField: string, + ) => { + const response = await this.axios.get( + `/api/v2/organizations/${organization}/settings/idpsync/field-values?claimField=${claimField}`, + ); + return response.data; + }; + getTemplate = async (templateId: string): Promise => { const response = await this.axios.get( `/api/v2/templates/${templateId}`, diff --git a/site/src/api/queries/organizations.ts b/site/src/api/queries/organizations.ts index 0cc8168243c16..33ef19f0d2654 100644 --- a/site/src/api/queries/organizations.ts +++ b/site/src/api/queries/organizations.ts @@ -338,3 +338,35 @@ export const organizationsPermissions = ( }, }; }; + +export const getOrganizationIdpSyncClaimFieldValuesKey = ( + organization: string, + claimField: string, +) => [organization, claimField, "organizationIdpSyncClaimFieldValues"]; + +export const organizationIdpSyncClaimFieldValues = ( + organization: string, + claimField: string, +) => { + return { + queryKey: getOrganizationIdpSyncClaimFieldValuesKey( + organization, + claimField, + ), + queryFn: () => + API.getIdpSyncClaimFieldValuesByOrganization(organization, claimField), + }; +}; + +export const getIdpSyncClaimFieldValuesKey = (claimField: string) => [ + claimField, + "idpSyncClaimFieldValues", +]; + +export const idpSyncClaimFieldValues = (claimField: string) => { + return { + queryKey: getIdpSyncClaimFieldValuesKey(claimField), + queryFn: () => API.getIdpSyncClaimFieldValues(claimField), + enabled: !!claimField, + }; +}; diff --git a/site/src/components/Combobox/Combobox.tsx b/site/src/components/Combobox/Combobox.tsx new file mode 100644 index 0000000000000..f5447b3a87062 --- /dev/null +++ b/site/src/components/Combobox/Combobox.tsx @@ -0,0 +1,93 @@ +import { Button } from "components/Button/Button"; +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, + CommandList, +} from "components/Command/Command"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "components/Popover/Popover"; +import { Check, ChevronDown, CornerDownLeft } from "lucide-react"; +import type { FC, KeyboardEventHandler } from "react"; +import { cn } from "utils/cn"; + +interface ComboboxProps { + value: string; + options?: string[]; + placeholder?: string; + open: boolean; + onOpenChange: (open: boolean) => void; + inputValue: string; + onInputChange: (value: string) => void; + onKeyDown?: KeyboardEventHandler; + onSelect: (value: string) => void; +} + +export const Combobox: FC = ({ + value, + options = [], + placeholder = "Select option", + open, + onOpenChange, + inputValue, + onInputChange, + onKeyDown, + onSelect, +}) => { + return ( + + + + + + + + + +

No results found

+ + Enter custom value + + +
+ + {options.map((option) => ( + { + onSelect(currentValue === value ? "" : currentValue); + }} + > + {option} + {value === option && ( + + )} + + ))} + +
+
+
+
+ ); +}; diff --git a/site/src/components/Command/Command.tsx b/site/src/components/Command/Command.tsx index bbdc5684cb19d..018f3da237e48 100644 --- a/site/src/components/Command/Command.tsx +++ b/site/src/components/Command/Command.tsx @@ -53,7 +53,7 @@ export const CommandInput = forwardRef< (({ className, ...props }, ref) => ( )); diff --git a/site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx b/site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx index 702be6a64d582..83f2aeed41cd4 100644 --- a/site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx +++ b/site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx @@ -572,7 +572,7 @@ export const MultiSelectCombobox = forwardRef< > - + diff --git a/site/src/components/Select/Select.tsx b/site/src/components/Select/Select.tsx index a0da638c907a2..ececcc2fc9950 100644 --- a/site/src/components/Select/Select.tsx +++ b/site/src/components/Select/Select.tsx @@ -20,17 +20,18 @@ export const SelectTrigger = React.forwardRef< span]:line-clamp-1", + `flex h-10 w-full font-medium items-center justify-between whitespace-nowrap rounded-md + border border-border border-solid bg-transparent px-3 py-2 text-sm shadow-sm + ring-offset-background text-content-secondary placeholder:text-content-secondary focus:outline-none, + focus:ring-2 focus:ring-content-link disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 + focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-content-link`, className, )} {...props} > {children} - + )); @@ -65,7 +66,7 @@ export const SelectScrollDownButton = React.forwardRef< )} {...props} > - + )); SelectScrollDownButton.displayName = diff --git a/site/src/modules/management/OrganizationSidebarView.tsx b/site/src/modules/management/OrganizationSidebarView.tsx index ef805861d1543..8d913edf87df3 100644 --- a/site/src/modules/management/OrganizationSidebarView.tsx +++ b/site/src/modules/management/OrganizationSidebarView.tsx @@ -18,7 +18,7 @@ import { SettingsSidebarNavItem, } from "components/Sidebar/Sidebar"; import type { Permissions } from "contexts/auth/permissions"; -import { ChevronDown, Plus } from "lucide-react"; +import { Check, ChevronDown, Plus } from "lucide-react"; import { useDashboard } from "modules/dashboard/useDashboard"; import { type FC, useState } from "react"; import { useNavigate } from "react-router-dom"; @@ -147,6 +147,13 @@ const OrganizationsSettingsNavigation: FC< {organization?.display_name || organization?.name} + {activeOrganization.name === organization.name && ( + + )} ))} diff --git a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPage.tsx b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPage.tsx index d08b3aac4ab1a..4d5b53e0f3ea2 100644 --- a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPage.tsx +++ b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPage.tsx @@ -3,6 +3,7 @@ import { organizationIdpSyncSettings, patchOrganizationSyncSettings, } from "api/queries/idpsync"; +import { idpSyncClaimFieldValues } from "api/queries/organizations"; import { ChooseOne, Cond } from "components/Conditionals/ChooseOne"; import { displayError } from "components/GlobalSnackbar/utils"; import { displaySuccess } from "components/GlobalSnackbar/utils"; @@ -11,7 +12,7 @@ import { Loader } from "components/Loader/Loader"; import { Paywall } from "components/Paywall/Paywall"; import { useDashboard } from "modules/dashboard/useDashboard"; import { useFeatureVisibility } from "modules/dashboard/useFeatureVisibility"; -import { type FC, useEffect } from "react"; +import { type FC, useEffect, useState } from "react"; import { Helmet } from "react-helmet-async"; import { useMutation, useQuery, useQueryClient } from "react-query"; import { docs } from "utils/docs"; @@ -20,6 +21,7 @@ import { ExportPolicyButton } from "./ExportPolicyButton"; import IdpOrgSyncPageView from "./IdpOrgSyncPageView"; export const IdpOrgSyncPage: FC = () => { + const [claimField, setClaimField] = useState(""); const queryClient = useQueryClient(); // IdP sync does not have its own entitlement and is based on templace_rbac const { template_rbac: isIdpSyncEnabled } = useFeatureVisibility(); @@ -28,7 +30,18 @@ export const IdpOrgSyncPage: FC = () => { data: orgSyncSettingsData, isLoading, error, - } = useQuery(organizationIdpSyncSettings(isIdpSyncEnabled)); + } = useQuery({ + ...organizationIdpSyncSettings(isIdpSyncEnabled), + onSuccess: (data) => { + if (data?.field) { + setClaimField(data.field); + } + }, + }); + + const { data: claimFieldValues } = useQuery( + idpSyncClaimFieldValues(claimField), + ); const patchOrganizationSyncSettingsMutation = useMutation( patchOrganizationSyncSettings(queryClient), @@ -49,6 +62,10 @@ export const IdpOrgSyncPage: FC = () => { return ; } + const handleSyncFieldChange = (value: string) => { + setClaimField(value); + }; + return ( <> @@ -94,6 +111,8 @@ export const IdpOrgSyncPage: FC = () => { ); } }} + onSyncFieldChange={handleSyncFieldChange} + claimFieldValues={claimFieldValues} error={error || patchOrganizationSyncSettingsMutation.error} /> diff --git a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx index 7ed1b85e8c9dd..031234da0da25 100644 --- a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx +++ b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx @@ -1,15 +1,10 @@ -import Table from "@mui/material/Table"; -import TableBody from "@mui/material/TableBody"; -import TableCell from "@mui/material/TableCell"; -import TableContainer from "@mui/material/TableContainer"; -import TableHead from "@mui/material/TableHead"; -import TableRow from "@mui/material/TableRow"; import type { Organization, OrganizationSyncSettings, } from "api/typesGenerated"; import { ErrorAlert } from "components/Alert/ErrorAlert"; import { Button } from "components/Button/Button"; +import { Combobox } from "components/Combobox/Combobox"; import { ChooseOne, Cond } from "components/Conditionals/ChooseOne"; import { Dialog, @@ -33,11 +28,24 @@ import { MultiSelectCombobox, type Option, } from "components/MultiSelectCombobox/MultiSelectCombobox"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "components/Popover/Popover"; import { Spinner } from "components/Spinner/Spinner"; import { Switch } from "components/Switch/Switch"; +import { + Table, + TableBody, + TableCell, + TableHeader, + TableRow, +} from "components/Table/Table"; import { useFormik } from "formik"; -import { Plus, Trash } from "lucide-react"; -import { type FC, useId, useState } from "react"; +import { Check, ChevronDown, CornerDownLeft, Plus, Trash } from "lucide-react"; +import { type FC, type KeyboardEventHandler, useId, useState } from "react"; +import { cn } from "utils/cn"; import { docs } from "utils/docs"; import { isUUID } from "utils/uuid"; import * as Yup from "yup"; @@ -47,6 +55,8 @@ interface IdpSyncPageViewProps { organizationSyncSettings: OrganizationSyncSettings | undefined; organizations: readonly Organization[]; onSubmit: (data: OrganizationSyncSettings) => void; + onSyncFieldChange: (value: string) => void; + claimFieldValues: string[] | undefined; error?: unknown; } @@ -76,6 +86,8 @@ export const IdpOrgSyncPageView: FC = ({ organizationSyncSettings, organizations, onSubmit, + onSyncFieldChange, + claimFieldValues, error, }) => { const form = useFormik({ @@ -91,11 +103,13 @@ export const IdpOrgSyncPageView: FC = ({ }); const [coderOrgs, setCoderOrgs] = useState([]); const [idpOrgName, setIdpOrgName] = useState(""); + const [inputValue, setInputValue] = useState(""); const organizationMappingCount = form.values.mapping ? Object.entries(form.values.mapping).length : 0; const [isDialogOpen, setIsDialogOpen] = useState(false); const id = useId(); + const [open, setOpen] = useState(false); const getOrgNames = (orgIds: readonly string[]) => { return orgIds.map( @@ -118,6 +132,19 @@ export const IdpOrgSyncPageView: FC = ({ form.handleSubmit(); }; + const handleKeyDown: KeyboardEventHandler = (event) => { + if ( + event.key === "Enter" && + inputValue && + !claimFieldValues?.some((value) => value === inputValue.toLowerCase()) + ) { + event.preventDefault(); + setIdpOrgName(inputValue); + setInputValue(""); + setOpen(false); + } + }; + return (
{Boolean(error) && } @@ -135,6 +162,7 @@ export const IdpOrgSyncPageView: FC = ({ value={form.values.field} onChange={(event) => { void form.setFieldValue("field", event.target.value); + onSyncFieldChange(event.target.value); }} /> + + Add to library + + + + ), + }, +}; + +export default meta; +type Story = StoryObj; + +export const Default: Story = {}; diff --git a/site/src/components/Tooltip/Tooltip.tsx b/site/src/components/Tooltip/Tooltip.tsx new file mode 100644 index 0000000000000..52f31299f1721 --- /dev/null +++ b/site/src/components/Tooltip/Tooltip.tsx @@ -0,0 +1,34 @@ +import * as TooltipPrimitive from "@radix-ui/react-tooltip"; +/** + * Copied from shadc/ui on 02/05/2025 + * @see {@link https://ui.shadcn.com/docs/components/tooltip} + */ +import * as React from "react"; +import { cn } from "utils/cn"; + +export const TooltipProvider = TooltipPrimitive.Provider; + +export const Tooltip = TooltipPrimitive.Root; + +export const TooltipTrigger = TooltipPrimitive.Trigger; + +export const TooltipContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, sideOffset = 4, ...props }, ref) => ( + + + +)); From 3a884df39e9b7984ce432ab3d4a526e3c6658c1c Mon Sep 17 00:00:00 2001 From: Ethan <39577870+ethanndickson@users.noreply.github.com> Date: Thu, 6 Feb 2025 17:05:34 +1100 Subject: [PATCH 015/859] ci: set xcode sdk version when building dylib (#16466) The Coder Desktop app might not be able to load the dylib because the hardened runtime version is different. Right now, without manually selecting an XCode version, the dylib is built with hardened runtime version `14.5`. The macOS app is built with XCode 16 SDK, which uses version `15.0`. Even if this isn't an issue, I think it's preferable to select a specific xcode version here to avoid things breaking from under us. --- .github/workflows/ci.yaml | 11 ++++++----- .github/workflows/release.yaml | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c87ad9855f2e..7e1d811e08185 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -940,11 +940,7 @@ jobs: if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }} steps: - - name: Harden Runner - uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 - with: - egress-policy: audit - + # Harden Runner doesn't work on macOS - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: @@ -957,6 +953,11 @@ jobs: echo "$(brew --prefix gnu-getopt)/bin" >> $GITHUB_PATH echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH + - name: Switch XCode Version + uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 + with: + xcode-version: "16.0.0" + - name: Setup Go uses: ./.github/actions/setup-go diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2a6a14ded522d..3a32b58f62361 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,11 +36,7 @@ jobs: build-dylib: runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }} steps: - - name: Harden Runner - uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 - with: - egress-policy: audit - + # Harden Runner doesn't work on macOS. - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: @@ -61,6 +57,11 @@ jobs: echo "$(brew --prefix gnu-getopt)/bin" >> $GITHUB_PATH echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH + - name: Switch XCode Version + uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 + with: + xcode-version: "16.0.0" + - name: Setup Go uses: ./.github/actions/setup-go From 7868f17fed45512425ece2206a01de25173e9099 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 06:32:28 +0000 Subject: [PATCH 016/859] chore: bump github.com/open-policy-agent/opa from 1.0.0 to 1.1.0 (#16384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 1.0.0 to 1.1.0.
Release notes

Sourced from github.com/open-policy-agent/opa's releases.

v1.1.0

This release contains a mix of features, performance improvements, and bugfixes.

Performance Improvements

Topdown and Rego

  • topdown: Fix out of range error in numbers.range built-in (#7269) authored by @​anderseknert
  • topdown+rego+server: Allow opt-in for evaluating non-det builtins in PE (#6496) authored by @​srenatus

Runtime, Tooling, SDK

Docs, Website, Ecosystem

Miscellaneous

  • ci(nightly): Remove vendor w/o modproxy check (#7292) authored by @​srenatus
  • Dependency updates; notably:
    • build(go): bump to 1.23.5 (7279) authored by @​srenatus
    • build(deps): upgrade github.com/dgraph-io/badger to v4 (4.5.1) (#7239) authored by @​Juneezee
    • build(deps): bump github.com/containerd/containerd from 1.7.24 to 1.7.25
    • build(deps): bump github.com/tchap/go-patricia/v2 from 2.3.1 to 2.3.2

... (truncated)

Changelog

Sourced from github.com/open-policy-agent/opa's changelog.

1.1.0

This release contains a mix of features, performance improvements, and bugfixes.

Performance Improvements

Topdown and Rego

  • topdown: Fix out of range error in numbers.range built-in (#7269) authored by @​anderseknert
  • topdown+rego+server: Allow opt-in for evaluating non-det builtins in PE (#6496) authored by @​srenatus

Runtime, Tooling, SDK

Docs, Website, Ecosystem

Miscellaneous

  • ci(nightly): Remove vendor w/o modproxy check (#7292) authored by @​srenatus
  • Dependency updates; notably:
    • build(go): bump to 1.23.5 (7279) authored by @​srenatus
    • build(deps): upgrade github.com/dgraph-io/badger to v4 (4.5.1) (#7239) authored by @​Juneezee
    • build(deps): bump github.com/containerd/containerd from 1.7.24 to 1.7.25

... (truncated)

Commits
  • de28510 Prepare v1.1.0 release
  • 2d47dd8 docs: Update generated CLI docs
  • 4b8a138 topdown+rego+server: allow opt-in for evaluating non-det builtins in PE (#7313)
  • 50a8c96 rego: Fixing broken BenchmarkCustomFunctionInHotPath (#7312)
  • 6e83f2a topdown: jwt cache (#7274)
  • 211e95d build(deps): bump github/codeql-action from 3.28.3 to 3.28.4
  • e682a67 Don't use reflect.DeepEqual for errors (#7311)
  • d20dd18 build(deps): bump google.golang.org/grpc from 1.69.4 to 1.70.0 (#7309)
  • b032e3b Fixing issue where bundle plugin could panic on reconfiguration (SDK use) (#...
  • e47bd4f bundle: Optimizing rego-version management in bundle activation (#7296)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/open-policy-agent/opa&package-manager=go_modules&previous-version=1.0.0&new-version=1.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 27 +++++++++++----------- go.sum | 70 +++++++++++++++++++++++++++------------------------------- 2 files changed, 45 insertions(+), 52 deletions(-) diff --git a/go.mod b/go.mod index 95f3bb44c25a1..0a59453c82b63 100644 --- a/go.mod +++ b/go.mod @@ -150,7 +150,7 @@ require ( github.com/mocktools/go-smtp-mock/v2 v2.4.0 github.com/muesli/termenv v0.15.3-0.20240618155329-98d742f6907a github.com/natefinch/atomic v1.0.1 - github.com/open-policy-agent/opa v1.0.0 + github.com/open-policy-agent/opa v1.1.0 github.com/ory/dockertest/v3 v3.11.0 github.com/pion/udp v0.1.4 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c @@ -176,11 +176,11 @@ require ( github.com/wagslane/go-password-validator v0.3.0 go.mozilla.org/pkcs7 v0.9.0 go.nhat.io/otelsql v0.15.0 - go.opentelemetry.io/otel v1.33.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 - go.opentelemetry.io/otel/sdk v1.33.0 - go.opentelemetry.io/otel/trace v1.33.0 + go.opentelemetry.io/otel v1.34.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 + go.opentelemetry.io/otel/sdk v1.34.0 + go.opentelemetry.io/otel/trace v1.34.0 go.uber.org/atomic v1.11.0 go.uber.org/goleak v1.3.1-0.20240429205332-517bace7cc29 go.uber.org/mock v0.5.0 @@ -262,7 +262,7 @@ require ( github.com/chromedp/sysutil v1.0.0 // indirect github.com/clbanning/mxj/v2 v2.7.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect - github.com/containerd/continuity v0.4.3 // indirect + github.com/containerd/continuity v0.4.4 // indirect github.com/coreos/go-iptables v0.6.0 // indirect github.com/dlclark/regexp2 v1.11.4 // indirect github.com/docker/cli v27.1.1+incompatible // indirect @@ -301,7 +301,6 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/flatbuffers v23.1.21+incompatible // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/nftables v0.2.0 // indirect github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect @@ -311,7 +310,7 @@ require ( github.com/googleapis/gax-go/v2 v2.14.1 // indirect github.com/gorilla/css v1.0.1 // indirect github.com/gorilla/mux v1.8.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect @@ -393,7 +392,7 @@ require ( github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect github.com/tailscale/netlink v1.1.1-0.20211101221916-cabfb018fe85 github.com/tailscale/wireguard-go v0.0.0-20231121184858-cc193a0b3272 - github.com/tchap/go-patricia/v2 v2.3.1 // indirect + github.com/tchap/go-patricia/v2 v2.3.2 // indirect github.com/tcnksm/go-httpstat v0.2.0 // indirect github.com/tdewolff/parse/v2 v2.7.15 // indirect github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 // indirect @@ -418,9 +417,9 @@ require ( github.com/zeebo/errs v1.3.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib v1.19.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect - go.opentelemetry.io/otel/metric v1.33.0 // indirect - go.opentelemetry.io/proto/otlp v1.4.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect + go.opentelemetry.io/proto/otlp v1.5.0 // indirect go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect golang.org/x/time v0.9.0 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 @@ -428,7 +427,7 @@ require ( golang.zx2c4.com/wireguard/windows v0.5.3 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect howett.net/plist v1.0.0 // indirect diff --git a/go.sum b/go.sum index afb90aa07fd81..87c96ecdc71c6 100644 --- a/go.sum +++ b/go.sum @@ -183,8 +183,6 @@ github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5 h1:BjkPE3785EwP github.com/cakturk/go-netstat v0.0.0-20200220111822-e5b49efee7a5/go.mod h1:jtAfVaU/2cu1+wdSRPWE2c1N2qeAA3K4RH9pYgqwets= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -220,8 +218,6 @@ github.com/coder/bubbletea v1.2.2-0.20241212190825-007a1cdb2c41 h1:SBN/DA63+ZHwu github.com/coder/bubbletea v1.2.2-0.20241212190825-007a1cdb2c41/go.mod h1:I9ULxr64UaOSUv7hcb3nX4kowodJCVS7vt7VVJk/kW4= github.com/coder/flog v1.1.0 h1:kbAes1ai8fIS5OeV+QAnKBQE22ty1jRF/mcAwHpLBa4= github.com/coder/flog v1.1.0/go.mod h1:UQlQvrkJBvnRGo69Le8E24Tcl5SJleAAR7gYEHzAmdQ= -github.com/coder/glog v1.0.1-0.20220322161911-7365fe7f2cd1 h1:UqBrPWSYvRI2s5RtOul20JukUEpu4ip9u7biBL+ntgk= -github.com/coder/glog v1.0.1-0.20220322161911-7365fe7f2cd1/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/coder/go-httpstat v0.0.0-20230801153223-321c88088322 h1:m0lPZjlQ7vdVpRBPKfYIFlmgevoTkBxB10wv6l2gOaU= github.com/coder/go-httpstat v0.0.0-20230801153223-321c88088322/go.mod h1:rOLFDDVKVFiDqZFXoteXc97YXx7kFi9kYqR+2ETPkLQ= github.com/coder/go-scim/pkg/v2 v2.0.0-20230221055123-1d63c1222136 h1:0RgB61LcNs24WOxc3PBvygSNTQurm0PYPujJjLLOzs0= @@ -252,8 +248,8 @@ github.com/coder/wgtunnel v0.1.13-0.20240522110300-ade90dfb2da0 h1:C2/eCr+r0a5Au github.com/coder/wgtunnel v0.1.13-0.20240522110300-ade90dfb2da0/go.mod h1:qANbdpqyAGlo2bg+4gQKPj24H1ZWa3bQU2Q5/bV5B3Y= github.com/coder/wireguard-go v0.0.0-20240522052547-769cdd7f7818 h1:bNhUTaKl3q0bFn78bBRq7iIwo72kNTvUD9Ll5TTzDDk= github.com/coder/wireguard-go v0.0.0-20240522052547-769cdd7f7818/go.mod h1:fAlLM6hUgnf4Sagxn2Uy5Us0PBgOYWz+63HwHUVGEbw= -github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= -github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/continuity v0.4.4 h1:/fNVfTJ7wIl/YPMHjf+5H32uFhl63JucB34PlCpMKII= +github.com/containerd/continuity v0.4.4/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= github.com/coreos/go-iptables v0.6.0 h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk= github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= github.com/coreos/go-oidc/v3 v3.12.0 h1:sJk+8G2qq94rDI6ehZ71Bol3oUHy63qNYmkiSjrc/Jo= @@ -271,10 +267,10 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgraph-io/badger/v3 v3.2103.5 h1:ylPa6qzbjYRQMU6jokoj4wzcaweHylt//CH0AKt0akg= -github.com/dgraph-io/badger/v3 v3.2103.5/go.mod h1:4MPiseMeDQ3FNCYwRbbcBOGJLf5jsE0PPFzRiKjtcdw= -github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= -github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +github.com/dgraph-io/badger/v4 v4.5.1 h1:7DCIXrQjo1LKmM96YD+hLVJ2EEsyyoWxJfpdd56HLps= +github.com/dgraph-io/badger/v4 v4.5.1/go.mod h1:qn3Be0j3TfV4kPbVoK0arXCD1/nr1ftth6sbL5jxdoA= +github.com/dgraph-io/ristretto/v2 v2.1.0 h1:59LjpOJLNDULHh8MC4UaegN52lC4JnO2dITsie/Pa8I= +github.com/dgraph-io/ristretto/v2 v2.1.0/go.mod h1:uejeqfYXpUomfse0+lO+13ATz4TypQYLJZzBSAemuB4= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= @@ -456,14 +452,12 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomarkdown/markdown v0.0.0-20240930133441-72d49d9543d8 h1:4txT5G2kqVAKMjzidIabL/8KqjIK71yj30YOeuxLn10= github.com/gomarkdown/markdown v0.0.0-20240930133441-72d49d9543d8/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/flatbuffers v23.1.21+incompatible h1:bUqzx/MXCDxuS0hRJL2EfjyZL3uQrPbMocUa8zGqsTA= -github.com/google/flatbuffers v23.1.21+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v24.12.23+incompatible h1:ubBKR94NR4pXUCY/MUsRVzd9umNW7ht7EG9hHfS9FX8= +github.com/google/flatbuffers v24.12.23+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -499,8 +493,8 @@ github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 h1:TmHmbvxPmaegwhDubVz0lICL0J5Ka2vwTzhoePEXsGE= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0/go.mod h1:qztMSjm835F2bXf+5HKAPIS5qsmQDqZna/PgVt4rWtI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 h1:VNqngBF40hVlDloBruUehVYC3ArSgIyScOAyMRqBxRg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1/go.mod h1:RBRO7fro65R6tjKzYgLAFo0t1QEXY1Dp+i/bvpRiqiQ= github.com/hairyhenderson/go-codeowners v0.7.0 h1:s0W4wF8bdsBEjTWzwzSlsatSthWtTAF2xLgo4a4RwAo= github.com/hairyhenderson/go-codeowners v0.7.0/go.mod h1:wUlNgQ3QjqC4z8DnM5nnCYVq/icpqXJyJOukKx5U8/Q= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -737,8 +731,8 @@ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/open-policy-agent/opa v1.0.0 h1:fZsEwxg1knpPvUn0YDJuJZBcbVg4G3zKpWa3+CnYK+I= -github.com/open-policy-agent/opa v1.0.0/go.mod h1:+JyoH12I0+zqyC1iX7a2tmoQlipwAEGvOhVJMhmy+rM= +github.com/open-policy-agent/opa v1.1.0 h1:HMz2evdEMTyNqtdLjmu3Vyx06BmhNYAx67Yz3Ll9q2s= +github.com/open-policy-agent/opa v1.1.0/go.mod h1:T1pASQ1/vwfTa+e2fYcfpLCvWgYtqtiUv+IuA/dLPQs= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -884,8 +878,8 @@ github.com/tailscale/netlink v1.1.1-0.20211101221916-cabfb018fe85 h1:zrsUcqrG2uQ github.com/tailscale/netlink v1.1.1-0.20211101221916-cabfb018fe85/go.mod h1:NzVQi3Mleb+qzq8VmcWpSkcSYxXIg0DkI6XDzpVkhJ0= github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc h1:24heQPtnFR+yfntqhI3oAu9i27nEojcQ4NuBQOo5ZFA= github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc/go.mod h1:f93CXfllFsO9ZQVq+Zocb1Gp4G5Fz0b0rXHLOzt/Djc= -github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= -github.com/tchap/go-patricia/v2 v2.3.1/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= +github.com/tchap/go-patricia/v2 v2.3.2 h1:xTHFutuitO2zqKAQ5rCROYgUb7Or/+IC3fts9/Yc7nM= +github.com/tchap/go-patricia/v2 v2.3.2/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/tdewolff/minify/v2 v2.20.37 h1:Q97cx4STXCh1dlWDlNHZniE8BJ2EBL0+2b0n92BJQhw= github.com/tdewolff/minify/v2 v2.20.37/go.mod h1:L1VYef/jwKw6Wwyk5A+T0mBjjn3mMPgmjjA688RNsxU= github.com/tdewolff/parse/v2 v2.7.15 h1:hysDXtdGZIRF5UZXwpfn3ZWRbm+ru4l53/ajBRGpCTw= @@ -1000,33 +994,33 @@ go.opentelemetry.io/contrib v1.19.0 h1:rnYI7OEPMWFeM4QCqWQ3InMJ0arWMR1i0Cx9A5hcj go.opentelemetry.io/contrib v1.19.0/go.mod h1:gIzjwWFoGazJmtCaDgViqOSJPde2mCWzv60o0bWPcZs= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 h1:yd02MEjBdJkG3uabWP9apV+OuWRIXGDuJEUJbOHmCFU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0/go.mod h1:umTcuxiv1n/s/S6/c2AT/g2CQ7u5C59sHDNmfSwgz7Q= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 h1:CV7UdSGJt/Ao6Gp4CXckLxVRRsRgDHoI8XjbL3PDl8s= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0/go.mod h1:FRmFuRJfag1IZ2dPkHnEoSFVgTVPUd2qf5Vi69hLb8I= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= -go.opentelemetry.io/otel v1.33.0 h1:/FerN9bax5LoK51X/sI0SVYrjSE0/yUL7DpxW4K3FWw= -go.opentelemetry.io/otel v1.33.0/go.mod h1:SUUkR6csvUQl+yjReHu5uM3EtVV7MBm5FHKRlNx4I8I= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 h1:Vh5HayB/0HHfOQA7Ctx69E/Y/DcQSMPpKANYVMQ7fBA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0/go.mod h1:cpgtDBaqD/6ok/UG0jT15/uKjAY8mRA53diogHBg3UI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 h1:5pojmb1U1AogINhN3SurB+zm/nIcusopeBNp42f45QM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0/go.mod h1:57gTHJSE5S1tqg+EKsLPlTWhpHMsWlVmer+LA926XiA= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 h1:OeNbIYk/2C15ckl7glBlOBp5+WlYsOElzTNmiPW/x60= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0/go.mod h1:7Bept48yIeqxP2OZ9/AqIpYS94h2or0aB4FypJTc8ZM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 h1:tgJ0uaNS4c98WRNUEx5U3aDlrDOI5Rs+1Vifcw4DJ8U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0/go.mod h1:U7HYyW0zt/a9x5J1Kjs+r1f/d4ZHnYFclhYY2+YbeoE= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0/go.mod h1:KfQ1wpjf3zsHjzP149P4LyAwWRupc6c7t1ZJ9eXpKQM= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.33.0 h1:FiOTYABOX4tdzi8A0+mtzcsTmi6WBOxk66u0f1Mj9Gs= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.33.0/go.mod h1:xyo5rS8DgzV0Jtsht+LCEMwyiDbjpsxBpWETwFRF0/4= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.33.0 h1:W5AWUn/IVe8RFb5pZx1Uh9Laf/4+Qmm4kJL5zPuvR+0= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.33.0/go.mod h1:mzKxJywMNBdEX8TSJais3NnsVZUaJ+bAy6UxPTng2vk= -go.opentelemetry.io/otel/metric v1.33.0 h1:r+JOocAyeRVXD8lZpjdQjzMadVZp2M4WmQ+5WtEnklQ= -go.opentelemetry.io/otel/metric v1.33.0/go.mod h1:L9+Fyctbp6HFTddIxClbQkjtubW6O9QS3Ann/M82u6M= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= -go.opentelemetry.io/otel/sdk v1.33.0 h1:iax7M131HuAm9QkZotNHEfstof92xM+N8sr3uHXc2IM= -go.opentelemetry.io/otel/sdk v1.33.0/go.mod h1:A1Q5oi7/9XaMlIWzPSxLRWOI8nG3FnzHJNbiENQuihM= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= go.opentelemetry.io/otel/sdk/metric v1.33.0 h1:Gs5VK9/WUJhNXZgn8MR6ITatvAmKeIuCtNbsP3JkNqU= go.opentelemetry.io/otel/sdk/metric v1.33.0/go.mod h1:dL5ykHZmm1B1nVRk9dDjChwDmt81MjVp3gLkQRwKf/Q= go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= -go.opentelemetry.io/otel/trace v1.33.0 h1:cCJuF7LRjUFso9LPnEAHJDB2pqzp+hbO8eu1qqW2d/s= -go.opentelemetry.io/otel/trace v1.33.0/go.mod h1:uIcdVUZMpTAmz0tI1z04GoVSezK37CbGV4fr1f2nBck= -go.opentelemetry.io/proto/otlp v1.4.0 h1:TA9WRvW6zMwP+Ssb6fLoUIuirti1gGbP28GcKG1jgeg= -go.opentelemetry.io/proto/otlp v1.4.0/go.mod h1:PPBWZIP98o2ElSqI35IHfu7hIhSwvc5N38Jw8pXuGFY= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= +go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -1179,8 +1173,8 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= -google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 h1:CkkIfIt50+lT6NHAVoRYEyAvQGFM7xEwXUUywFvEb3Q= -google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576/go.mod h1:1R3kvZ1dtP3+4p4d3G8uJ8rFk/fWlScl38vanWACI08= +google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA= +google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o= google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47 h1:91mG8dNTpkC0uChJUQ9zCiRqx3GEEFOWaRZ0mI6Oj2I= google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= From fce23252410981f16cc4f1e781084c5fcba82967 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 06:33:21 +0000 Subject: [PATCH 017/859] chore: bump the x group with 5 updates (#16445) Bumps the x group with 5 updates: | Package | From | To | | --- | --- | --- | | [golang.org/x/mod](https://github.com/golang/mod) | `0.22.0` | `0.23.0` | | [golang.org/x/oauth2](https://github.com/golang/oauth2) | `0.25.0` | `0.26.0` | | [golang.org/x/sync](https://github.com/golang/sync) | `0.10.0` | `0.11.0` | | [golang.org/x/sys](https://github.com/golang/sys) | `0.29.1-0.20250107080300-1c14dcadc3ab` | `0.30.0` | | [golang.org/x/term](https://github.com/golang/term) | `0.28.0` | `0.29.0` | Updates `golang.org/x/mod` from 0.22.0 to 0.23.0
Commits

Updates `golang.org/x/oauth2` from 0.25.0 to 0.26.0
Commits
  • b9c813b google: add warning about externally-provided credentials
  • See full diff in compare view

Updates `golang.org/x/sync` from 0.10.0 to 0.11.0
Commits
  • fe3591b sync/errgroup: improve documentation for semaphore limit behavior
  • See full diff in compare view

Updates `golang.org/x/sys` from 0.29.1-0.20250107080300-1c14dcadc3ab to 0.30.0
Commits

Updates `golang.org/x/term` from 0.28.0 to 0.29.0
Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 0a59453c82b63..ebbd507766fc5 100644 --- a/go.mod +++ b/go.mod @@ -187,12 +187,12 @@ require ( go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516 golang.org/x/crypto v0.32.0 golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa - golang.org/x/mod v0.22.0 + golang.org/x/mod v0.23.0 golang.org/x/net v0.34.0 - golang.org/x/oauth2 v0.25.0 - golang.org/x/sync v0.10.0 - golang.org/x/sys v0.29.1-0.20250107080300-1c14dcadc3ab - golang.org/x/term v0.28.0 + golang.org/x/oauth2 v0.26.0 + golang.org/x/sync v0.11.0 + golang.org/x/sys v0.30.0 + golang.org/x/term v0.29.0 golang.org/x/text v0.21.0 // indirect golang.org/x/tools v0.29.0 golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da diff --git a/go.sum b/go.sum index 87c96ecdc71c6..79216adb83217 100644 --- a/go.sum +++ b/go.sum @@ -1055,8 +1055,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= +golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1070,8 +1070,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= -golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE= +golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1079,8 +1079,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1120,8 +1120,8 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.29.1-0.20250107080300-1c14dcadc3ab h1:BMkEEWYOjkvOX7+YKOGbp6jCyQ5pR2j0Ah47p1Vdsx4= -golang.org/x/sys v0.29.1-0.20250107080300-1c14dcadc3ab/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1129,8 +1129,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From cff89fbf238e1ebc895b383c2a506f29412f14f5 Mon Sep 17 00:00:00 2001 From: M Atif Ali Date: Thu, 6 Feb 2025 11:38:50 +0500 Subject: [PATCH 018/859] docs: cleanup Zed editor connection docs (#16467) --- docs/user-guides/workspace-access/zed.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/user-guides/workspace-access/zed.md b/docs/user-guides/workspace-access/zed.md index 14a02e08a611f..2bcb4f12a2209 100644 --- a/docs/user-guides/workspace-access/zed.md +++ b/docs/user-guides/workspace-access/zed.md @@ -27,11 +27,6 @@ Use the Coder CLI to log in and configure SSH, then connect to your workspace wi ### Windows - > **Important:** If you plan to use the built-in PostgreSQL database, you will - > need to ensure that the - > [Visual C++ Runtime](https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist#latest-microsoft-visual-c-redistributable-version) - > is installed. - Use [GitHub releases](https://github.com/coder/coder/releases) to download the Windows installer (`.msi`) or standalone binary (`.exe`). From 5fbedc74f3c6696d7e8351e6fb808ae95bc770be Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 6 Feb 2025 09:11:30 +0100 Subject: [PATCH 019/859] fix: fix broken troubleshooting link (#16469) Fixes: https://github.com/coder/coder/issues/16468 The troubleshooting link was not updated after moving around docs. --- cli/ping.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/ping.go b/cli/ping.go index 0e219d5762f86..19191b92916bb 100644 --- a/cli/ping.go +++ b/cli/ping.go @@ -159,7 +159,7 @@ func (r *RootCmd) ping() *serpent.Command { LocalNetInfo: ni, Verbose: r.verbose, PingP2P: didP2p, - TroubleshootingURL: appearanceConfig.DocsURL + "/networking/troubleshooting", + TroubleshootingURL: appearanceConfig.DocsURL + "/admin/networking/troubleshooting", } awsRanges, err := cliutil.FetchAWSIPRanges(diagCtx, cliutil.AWSIPRangesURL) From 9da9c2fc9274b2cdb423d8a7d6870e49e2d7dac3 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 6 Feb 2025 13:40:47 +0100 Subject: [PATCH 020/859] fix: truncate template files while pulling (#16474) Fixes: https://github.com/coder/coder/issues/16414 --- provisionersdk/archive.go | 2 +- provisionersdk/archive_test.go | 78 ++++++++++++++++++++++++++++------ 2 files changed, 66 insertions(+), 14 deletions(-) diff --git a/provisionersdk/archive.go b/provisionersdk/archive.go index 410315c18a238..a069639a1eba6 100644 --- a/provisionersdk/archive.go +++ b/provisionersdk/archive.go @@ -175,7 +175,7 @@ func Untar(directory string, r io.Reader) error { if err != nil { return err } - file, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode)) + file, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.FileMode(header.Mode)) if err != nil { return err } diff --git a/provisionersdk/archive_test.go b/provisionersdk/archive_test.go index 7f31fb7730485..12362275a72b9 100644 --- a/provisionersdk/archive_test.go +++ b/provisionersdk/archive_test.go @@ -184,18 +184,70 @@ func TestTar(t *testing.T) { func TestUntar(t *testing.T) { t.Parallel() - log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}) - dir := t.TempDir() - file, err := os.CreateTemp(dir, "*.tf") - require.NoError(t, err) - _ = file.Close() - archive := new(bytes.Buffer) - err = provisionersdk.Tar(archive, log, dir, 1024) - require.NoError(t, err) - dir = t.TempDir() - err = provisionersdk.Untar(dir, archive) - require.NoError(t, err) - _, err = os.Stat(filepath.Join(dir, filepath.Base(file.Name()))) - require.NoError(t, err) + t.Run("Basic", func(t *testing.T) { + t.Parallel() + + log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}) + + dir := t.TempDir() + file, err := os.CreateTemp(dir, "*.tf") + require.NoError(t, err) + _ = file.Close() + + archive := new(bytes.Buffer) + err = provisionersdk.Tar(archive, log, dir, 1024) + require.NoError(t, err) + + dir = t.TempDir() + err = provisionersdk.Untar(dir, archive) + require.NoError(t, err) + + _, err = os.Stat(filepath.Join(dir, filepath.Base(file.Name()))) + require.NoError(t, err) + }) + + t.Run("Overwrite", func(t *testing.T) { + t.Parallel() + + log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}) + + dir1 := t.TempDir() + dir2 := t.TempDir() + + // 1. Create directory with .tf file. + file, err := os.CreateTemp(dir1, "*.tf") + require.NoError(t, err) + _ = file.Close() + + err = os.WriteFile(file.Name(), []byte("# ab"), 0o600) + require.NoError(t, err) + + archive := new(bytes.Buffer) + + // 2. Build tar archive. + err = provisionersdk.Tar(archive, log, dir1, 4096) + require.NoError(t, err) + + // 3. Untar to the second location. + err = provisionersdk.Untar(dir2, archive) + require.NoError(t, err) + + // 4. Modify the .tf file + err = os.WriteFile(file.Name(), []byte("# c"), 0o600) + require.NoError(t, err) + + // 5. Build tar archive with modified .tf file + err = provisionersdk.Tar(archive, log, dir1, 4096) + require.NoError(t, err) + + // 6. Untar to a second location. + err = provisionersdk.Untar(dir2, archive) + require.NoError(t, err) + + // Verify if the file has been fully overwritten + content, err := os.ReadFile(filepath.Join(dir2, filepath.Base(file.Name()))) + require.NoError(t, err) + require.Equal(t, "# c", string(content)) + }) } From 44d9f5ff4ed60e0c04f10870713d7dc81807523c Mon Sep 17 00:00:00 2001 From: Edward Angert Date: Thu, 6 Feb 2025 08:56:08 -0500 Subject: [PATCH 021/859] docs: comment out optional lines in `values.yaml` (#16457) @michaelvp411 pointed out that some optional lines in `values.yaml` could lead to errors if the user doesn't opt to use them. This PR comments out those lines so that they're opt-in [preview](https://coder.com/docs/@k8s-values-comment-opt/install/kubernetes) (once cache catches up) Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> --- docs/install/kubernetes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/install/kubernetes.md b/docs/install/kubernetes.md index 7ca8670767b35..04e136f16b720 100644 --- a/docs/install/kubernetes.md +++ b/docs/install/kubernetes.md @@ -104,8 +104,8 @@ coder: # (Optional) For production deployments the access URL should be set. # If you're just trying Coder, access the dashboard via the service IP. - - name: CODER_ACCESS_URL - value: "https://coder.example.com" + # - name: CODER_ACCESS_URL + # value: "https://coder.example.com" #tls: # secretNames: From b04d8833487b2a2105ab3e07ab2edbf48d4cde14 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 6 Feb 2025 16:19:20 +0200 Subject: [PATCH 022/859] feat: add provisioner job metadata (#16454) This change adds metadata to provisioner jobs to help with rendering related tempaltes and workspaces in the UI. Updates #15084 --- .../coder_provisioner_jobs_list_--help.golden | 2 +- ...provisioner_jobs_list_--output_json.golden | 14 + coderd/apidoc/docs.go | 28 ++ coderd/apidoc/swagger.json | 28 ++ coderd/database/dbmem/dbmem.go | 39 +++ coderd/database/queries.sql.go | 46 +++- coderd/database/queries/provisionerjobs.sql | 26 +- coderd/provisionerjobs.go | 10 + coderd/provisionerjobs_test.go | 45 ++- codersdk/provisionerdaemons.go | 45 +-- docs/reference/api/builds.md | 47 ++++ docs/reference/api/organizations.md | 71 +++-- docs/reference/api/schemas.md | 105 +++++-- docs/reference/api/templates.md | 258 ++++++++++++------ docs/reference/api/workspaces.md | 48 ++++ docs/reference/cli/provisioner_jobs_list.md | 8 +- .../coder_provisioner_jobs_list_--help.golden | 2 +- site/src/api/typesGenerated.ts | 11 + 18 files changed, 666 insertions(+), 167 deletions(-) diff --git a/cli/testdata/coder_provisioner_jobs_list_--help.golden b/cli/testdata/coder_provisioner_jobs_list_--help.golden index 585e918c23e7b..bd29b7560ea6a 100644 --- a/cli/testdata/coder_provisioner_jobs_list_--help.golden +++ b/cli/testdata/coder_provisioner_jobs_list_--help.golden @@ -11,7 +11,7 @@ OPTIONS: -O, --org string, $CODER_ORGANIZATION Select which organization (uuid or name) to use. - -c, --column [id|created at|started at|completed at|canceled at|error|error code|status|worker id|file id|tags|queue position|queue size|organization id|template version id|workspace build id|type|available workers|organization|queue] (default: created at,id,organization,status,type,queue,tags) + -c, --column [id|created at|started at|completed at|canceled at|error|error code|status|worker id|file id|tags|queue position|queue size|organization id|template version id|workspace build id|type|available workers|template version name|template id|template name|template display name|workspace id|workspace name|organization|queue] (default: created at,id,organization,status,type,queue,tags) Columns to display in table output. -l, --limit int, $CODER_PROVISIONER_JOB_LIST_LIMIT (default: 50) diff --git a/cli/testdata/coder_provisioner_jobs_list_--output_json.golden b/cli/testdata/coder_provisioner_jobs_list_--output_json.golden index a19683573bba2..9e1f56ba7bf17 100644 --- a/cli/testdata/coder_provisioner_jobs_list_--output_json.golden +++ b/cli/testdata/coder_provisioner_jobs_list_--output_json.golden @@ -18,6 +18,12 @@ "template_version_id": "============[version ID]============" }, "type": "template_version_import", + "metadata": { + "template_version_name": "===========[version name]===========", + "template_id": "===========[template ID]============", + "template_name": "test-template", + "template_display_name": "" + }, "organization_name": "Coder" }, { @@ -39,6 +45,14 @@ "workspace_build_id": "========[workspace build ID]========" }, "type": "workspace_build", + "metadata": { + "template_version_name": "===========[version name]===========", + "template_id": "===========[template ID]============", + "template_name": "test-template", + "template_display_name": "", + "workspace_id": "===========[workspace ID]===========", + "workspace_name": "test-workspace" + }, "organization_name": "Coder" } ] diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 3d4ae52e993db..98c694ab4175d 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -13125,6 +13125,9 @@ const docTemplate = `{ "input": { "$ref": "#/definitions/codersdk.ProvisionerJobInput" }, + "metadata": { + "$ref": "#/definitions/codersdk.ProvisionerJobMetadata" + }, "organization_id": { "type": "string", "format": "uuid" @@ -13220,6 +13223,31 @@ const docTemplate = `{ } } }, + "codersdk.ProvisionerJobMetadata": { + "type": "object", + "properties": { + "template_display_name": { + "type": "string" + }, + "template_id": { + "type": "string", + "format": "uuid" + }, + "template_name": { + "type": "string" + }, + "template_version_name": { + "type": "string" + }, + "workspace_id": { + "type": "string", + "format": "uuid" + }, + "workspace_name": { + "type": "string" + } + } + }, "codersdk.ProvisionerJobStatus": { "type": "string", "enum": [ diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index c431f8eca5a50..afe36a8389899 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -11852,6 +11852,9 @@ "input": { "$ref": "#/definitions/codersdk.ProvisionerJobInput" }, + "metadata": { + "$ref": "#/definitions/codersdk.ProvisionerJobMetadata" + }, "organization_id": { "type": "string", "format": "uuid" @@ -11941,6 +11944,31 @@ } } }, + "codersdk.ProvisionerJobMetadata": { + "type": "object", + "properties": { + "template_display_name": { + "type": "string" + }, + "template_id": { + "type": "string", + "format": "uuid" + }, + "template_name": { + "type": "string" + }, + "template_version_name": { + "type": "string" + }, + "workspace_id": { + "type": "string", + "format": "uuid" + }, + "workspace_name": { + "type": "string" + } + } + }, "codersdk.ProvisionerJobStatus": { "type": "string", "enum": [ diff --git a/coderd/database/dbmem/dbmem.go b/coderd/database/dbmem/dbmem.go index 6df49904d5cff..007362eab6196 100644 --- a/coderd/database/dbmem/dbmem.go +++ b/coderd/database/dbmem/dbmem.go @@ -4117,6 +4117,45 @@ func (q *FakeQuerier) GetProvisionerJobsByOrganizationAndStatusWithQueuePosition QueuePosition: rowQP.QueuePosition, QueueSize: rowQP.QueueSize, } + + // Start add metadata. + var input codersdk.ProvisionerJobInput + err := json.Unmarshal([]byte(job.Input), &input) + if err != nil { + return nil, err + } + templateVersionID := input.TemplateVersionID + if input.WorkspaceBuildID != nil { + workspaceBuild, err := q.getWorkspaceBuildByIDNoLock(ctx, *input.WorkspaceBuildID) + if err != nil { + return nil, err + } + workspace, err := q.getWorkspaceByIDNoLock(ctx, workspaceBuild.WorkspaceID) + if err != nil { + return nil, err + } + row.WorkspaceID = uuid.NullUUID{UUID: workspace.ID, Valid: true} + row.WorkspaceName = workspace.Name + if templateVersionID == nil { + templateVersionID = &workspaceBuild.TemplateVersionID + } + } + if templateVersionID != nil { + templateVersion, err := q.getTemplateVersionByIDNoLock(ctx, *templateVersionID) + if err != nil { + return nil, err + } + row.TemplateVersionName = templateVersion.Name + template, err := q.getTemplateByIDNoLock(ctx, templateVersion.TemplateID.UUID) + if err != nil { + return nil, err + } + row.TemplateID = uuid.NullUUID{UUID: template.ID, Valid: true} + row.TemplateName = template.Name + row.TemplateDisplayName = template.DisplayName + } + // End add metadata. + if row.QueuePosition > 0 { var availableWorkers []database.ProvisionerDaemon for _, daemon := range q.provisionerDaemons { diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 68e73a594e6fd..7778be9d777aa 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -6265,13 +6265,29 @@ SELECT AND pj.organization_id = pd.organization_id AND pj.provisioner = ANY(pd.provisioners) AND provisioner_tagset_contains(pd.tags, pj.tags) - ) AS available_workers + ) AS available_workers, + -- Include template and workspace information. + COALESCE(tv.name, '') AS template_version_name, + t.id AS template_id, + COALESCE(t.name, '') AS template_name, + COALESCE(t.display_name, '') AS template_display_name, + w.id AS workspace_id, + COALESCE(w.name, '') AS workspace_name FROM provisioner_jobs pj LEFT JOIN queue_position qp ON qp.id = pj.id LEFT JOIN queue_size qs ON TRUE +LEFT JOIN + workspace_builds wb ON wb.id = CASE WHEN pj.input ? 'workspace_build_id' THEN (pj.input->>'workspace_build_id')::uuid END +LEFT JOIN + workspaces w ON wb.workspace_id = w.id +LEFT JOIN + -- We should always have a template version, either explicitly or implicitly via workspace build. + template_versions tv ON tv.id = CASE WHEN pj.input ? 'template_version_id' THEN (pj.input->>'template_version_id')::uuid ELSE wb.template_version_id END +LEFT JOIN + templates t ON tv.template_id = t.id WHERE ($1::uuid IS NULL OR pj.organization_id = $1) AND (COALESCE(array_length($2::uuid[], 1), 0) = 0 OR pj.id = ANY($2::uuid[])) @@ -6279,7 +6295,13 @@ WHERE GROUP BY pj.id, qp.queue_position, - qs.count + qs.count, + tv.name, + t.id, + t.name, + t.display_name, + w.id, + w.name ORDER BY pj.created_at DESC LIMIT @@ -6294,10 +6316,16 @@ type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerPar } type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow struct { - ProvisionerJob ProvisionerJob `db:"provisioner_job" json:"provisioner_job"` - QueuePosition int64 `db:"queue_position" json:"queue_position"` - QueueSize int64 `db:"queue_size" json:"queue_size"` - AvailableWorkers []uuid.UUID `db:"available_workers" json:"available_workers"` + ProvisionerJob ProvisionerJob `db:"provisioner_job" json:"provisioner_job"` + QueuePosition int64 `db:"queue_position" json:"queue_position"` + QueueSize int64 `db:"queue_size" json:"queue_size"` + AvailableWorkers []uuid.UUID `db:"available_workers" json:"available_workers"` + TemplateVersionName string `db:"template_version_name" json:"template_version_name"` + TemplateID uuid.NullUUID `db:"template_id" json:"template_id"` + TemplateName string `db:"template_name" json:"template_name"` + TemplateDisplayName string `db:"template_display_name" json:"template_display_name"` + WorkspaceID uuid.NullUUID `db:"workspace_id" json:"workspace_id"` + WorkspaceName string `db:"workspace_name" json:"workspace_name"` } func (q *sqlQuerier) GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisioner(ctx context.Context, arg GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams) ([]GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow, error) { @@ -6337,6 +6365,12 @@ func (q *sqlQuerier) GetProvisionerJobsByOrganizationAndStatusWithQueuePositionA &i.QueuePosition, &i.QueueSize, pq.Array(&i.AvailableWorkers), + &i.TemplateVersionName, + &i.TemplateID, + &i.TemplateName, + &i.TemplateDisplayName, + &i.WorkspaceID, + &i.WorkspaceName, ); err != nil { return nil, err } diff --git a/coderd/database/queries/provisionerjobs.sql b/coderd/database/queries/provisionerjobs.sql index e7078dcfbff15..bac03f1b4253e 100644 --- a/coderd/database/queries/provisionerjobs.sql +++ b/coderd/database/queries/provisionerjobs.sql @@ -130,13 +130,29 @@ SELECT AND pj.organization_id = pd.organization_id AND pj.provisioner = ANY(pd.provisioners) AND provisioner_tagset_contains(pd.tags, pj.tags) - ) AS available_workers + ) AS available_workers, + -- Include template and workspace information. + COALESCE(tv.name, '') AS template_version_name, + t.id AS template_id, + COALESCE(t.name, '') AS template_name, + COALESCE(t.display_name, '') AS template_display_name, + w.id AS workspace_id, + COALESCE(w.name, '') AS workspace_name FROM provisioner_jobs pj LEFT JOIN queue_position qp ON qp.id = pj.id LEFT JOIN queue_size qs ON TRUE +LEFT JOIN + workspace_builds wb ON wb.id = CASE WHEN pj.input ? 'workspace_build_id' THEN (pj.input->>'workspace_build_id')::uuid END +LEFT JOIN + workspaces w ON wb.workspace_id = w.id +LEFT JOIN + -- We should always have a template version, either explicitly or implicitly via workspace build. + template_versions tv ON tv.id = CASE WHEN pj.input ? 'template_version_id' THEN (pj.input->>'template_version_id')::uuid ELSE wb.template_version_id END +LEFT JOIN + templates t ON tv.template_id = t.id WHERE (sqlc.narg('organization_id')::uuid IS NULL OR pj.organization_id = @organization_id) AND (COALESCE(array_length(@ids::uuid[], 1), 0) = 0 OR pj.id = ANY(@ids::uuid[])) @@ -144,7 +160,13 @@ WHERE GROUP BY pj.id, qp.queue_position, - qs.count + qs.count, + tv.name, + t.id, + t.name, + t.display_name, + w.id, + w.name ORDER BY pj.created_at DESC LIMIT diff --git a/coderd/provisionerjobs.go b/coderd/provisionerjobs.go index 647274d9c29f7..b8eccdb9c4d3c 100644 --- a/coderd/provisionerjobs.go +++ b/coderd/provisionerjobs.go @@ -388,6 +388,16 @@ func convertProvisionerJobWithQueuePosition(pj database.GetProvisionerJobsByOrga QueueSize: pj.QueueSize, }) job.AvailableWorkers = pj.AvailableWorkers + job.Metadata = &codersdk.ProvisionerJobMetadata{ + TemplateVersionName: pj.TemplateVersionName, + TemplateID: pj.TemplateID.UUID, + TemplateName: pj.TemplateName, + TemplateDisplayName: pj.TemplateDisplayName, + WorkspaceName: pj.WorkspaceName, + } + if pj.WorkspaceID.Valid { + job.Metadata.WorkspaceID = &pj.WorkspaceID.UUID + } return job } diff --git a/coderd/provisionerjobs_test.go b/coderd/provisionerjobs_test.go index 098e118327c40..ba5f31e6894a3 100644 --- a/coderd/provisionerjobs_test.go +++ b/coderd/provisionerjobs_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/google/uuid" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/coder/coder/v2/coderd/coderdtest" @@ -72,13 +73,45 @@ func TestProvisionerJobs(t *testing.T) { t.Run("Single", func(t *testing.T) { t.Parallel() - t.Run("OK", func(t *testing.T) { + t.Run("Workspace", func(t *testing.T) { t.Parallel() - ctx := testutil.Context(t, testutil.WaitMedium) - // Note this calls the single job endpoint. - job2, err := templateAdminClient.OrganizationProvisionerJob(ctx, owner.OrganizationID, job.ID) - require.NoError(t, err) - require.Equal(t, job.ID, job2.ID) + t.Run("OK", func(t *testing.T) { + t.Parallel() + ctx := testutil.Context(t, testutil.WaitMedium) + // Note this calls the single job endpoint. + job2, err := templateAdminClient.OrganizationProvisionerJob(ctx, owner.OrganizationID, job.ID) + require.NoError(t, err) + require.Equal(t, job.ID, job2.ID) + + // Verify that job metadata is correct. + assert.Equal(t, job2.Metadata, &codersdk.ProvisionerJobMetadata{ + TemplateVersionName: version.Name, + TemplateID: template.ID, + TemplateName: template.Name, + TemplateDisplayName: template.DisplayName, + WorkspaceID: &w.ID, + WorkspaceName: w.Name, + }) + }) + }) + t.Run("Template Import", func(t *testing.T) { + t.Parallel() + t.Run("OK", func(t *testing.T) { + t.Parallel() + ctx := testutil.Context(t, testutil.WaitMedium) + // Note this calls the single job endpoint. + job2, err := templateAdminClient.OrganizationProvisionerJob(ctx, owner.OrganizationID, version.Job.ID) + require.NoError(t, err) + require.Equal(t, version.Job.ID, job2.ID) + + // Verify that job metadata is correct. + assert.Equal(t, job2.Metadata, &codersdk.ProvisionerJobMetadata{ + TemplateVersionName: version.Name, + TemplateID: template.ID, + TemplateName: template.Name, + TemplateDisplayName: template.DisplayName, + }) + }) }) t.Run("Missing", func(t *testing.T) { t.Parallel() diff --git a/codersdk/provisionerdaemons.go b/codersdk/provisionerdaemons.go index 98c3252dc859a..5a93ba9fcaae4 100644 --- a/codersdk/provisionerdaemons.go +++ b/codersdk/provisionerdaemons.go @@ -131,6 +131,16 @@ type ProvisionerJobInput struct { Error string `json:"error,omitempty" table:"-"` } +// ProvisionerJobMetadata contains metadata for the job. +type ProvisionerJobMetadata struct { + TemplateVersionName string `json:"template_version_name" table:"template version name"` + TemplateID uuid.UUID `json:"template_id" format:"uuid" table:"template id"` + TemplateName string `json:"template_name" table:"template name"` + TemplateDisplayName string `json:"template_display_name" table:"template display name"` + WorkspaceID *uuid.UUID `json:"workspace_id,omitempty" format:"uuid" table:"workspace id"` + WorkspaceName string `json:"workspace_name,omitempty" table:"workspace name"` +} + // ProvisionerJobType represents the type of job. type ProvisionerJobType string @@ -155,23 +165,24 @@ func JobIsMissingParameterErrorCode(code JobErrorCode) bool { // ProvisionerJob describes the job executed by the provisioning daemon. type ProvisionerJob struct { - ID uuid.UUID `json:"id" format:"uuid" table:"id"` - CreatedAt time.Time `json:"created_at" format:"date-time" table:"created at"` - StartedAt *time.Time `json:"started_at,omitempty" format:"date-time" table:"started at"` - CompletedAt *time.Time `json:"completed_at,omitempty" format:"date-time" table:"completed at"` - CanceledAt *time.Time `json:"canceled_at,omitempty" format:"date-time" table:"canceled at"` - Error string `json:"error,omitempty" table:"error"` - ErrorCode JobErrorCode `json:"error_code,omitempty" enums:"REQUIRED_TEMPLATE_VARIABLES" table:"error code"` - Status ProvisionerJobStatus `json:"status" enums:"pending,running,succeeded,canceling,canceled,failed" table:"status"` - WorkerID *uuid.UUID `json:"worker_id,omitempty" format:"uuid" table:"worker id"` - FileID uuid.UUID `json:"file_id" format:"uuid" table:"file id"` - Tags map[string]string `json:"tags" table:"tags"` - QueuePosition int `json:"queue_position" table:"queue position"` - QueueSize int `json:"queue_size" table:"queue size"` - OrganizationID uuid.UUID `json:"organization_id" format:"uuid" table:"organization id"` - Input ProvisionerJobInput `json:"input" table:"input,recursive_inline"` - Type ProvisionerJobType `json:"type" table:"type"` - AvailableWorkers []uuid.UUID `json:"available_workers,omitempty" format:"uuid" table:"available workers"` + ID uuid.UUID `json:"id" format:"uuid" table:"id"` + CreatedAt time.Time `json:"created_at" format:"date-time" table:"created at"` + StartedAt *time.Time `json:"started_at,omitempty" format:"date-time" table:"started at"` + CompletedAt *time.Time `json:"completed_at,omitempty" format:"date-time" table:"completed at"` + CanceledAt *time.Time `json:"canceled_at,omitempty" format:"date-time" table:"canceled at"` + Error string `json:"error,omitempty" table:"error"` + ErrorCode JobErrorCode `json:"error_code,omitempty" enums:"REQUIRED_TEMPLATE_VARIABLES" table:"error code"` + Status ProvisionerJobStatus `json:"status" enums:"pending,running,succeeded,canceling,canceled,failed" table:"status"` + WorkerID *uuid.UUID `json:"worker_id,omitempty" format:"uuid" table:"worker id"` + FileID uuid.UUID `json:"file_id" format:"uuid" table:"file id"` + Tags map[string]string `json:"tags" table:"tags"` + QueuePosition int `json:"queue_position" table:"queue position"` + QueueSize int `json:"queue_size" table:"queue size"` + OrganizationID uuid.UUID `json:"organization_id" format:"uuid" table:"organization id"` + Input ProvisionerJobInput `json:"input" table:"input,recursive_inline"` + Type ProvisionerJobType `json:"type" table:"type"` + AvailableWorkers []uuid.UUID `json:"available_workers,omitempty" format:"uuid" table:"available workers"` + Metadata *ProvisionerJobMetadata `json:"metadata,omitempty" table:"metadata,recursive_inline"` } // ProvisionerJobLog represents the provisioner log entry annotated with source and level. diff --git a/docs/reference/api/builds.md b/docs/reference/api/builds.md index 8c17b95a4b7a4..73fd35bb4f270 100644 --- a/docs/reference/api/builds.md +++ b/docs/reference/api/builds.md @@ -50,6 +50,14 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -255,6 +263,14 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -902,6 +918,14 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1180,6 +1204,14 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1363,6 +1395,13 @@ Status Code **200** | `»»» error` | string | false | | | | `»»» template_version_id` | string(uuid) | false | | | | `»»» workspace_build_id` | string(uuid) | false | | | +| `»» metadata` | [codersdk.ProvisionerJobMetadata](schemas.md#codersdkprovisionerjobmetadata) | false | | | +| `»»» template_display_name` | string | false | | | +| `»»» template_id` | string(uuid) | false | | | +| `»»» template_name` | string | false | | | +| `»»» template_version_name` | string | false | | | +| `»»» workspace_id` | string(uuid) | false | | | +| `»»» workspace_name` | string | false | | | | `»» organization_id` | string(uuid) | false | | | | `»» queue_position` | integer | false | | | | `»» queue_size` | integer | false | | | @@ -1605,6 +1644,14 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, diff --git a/docs/reference/api/organizations.md b/docs/reference/api/organizations.md index 32789743afc38..52442b6258559 100644 --- a/docs/reference/api/organizations.md +++ b/docs/reference/api/organizations.md @@ -405,6 +405,14 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -430,30 +438,37 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi Status Code **200** -| Name | Type | Required | Restrictions | Description | -|--------------------------|--------------------------------------------------------------------------|----------|--------------|-------------| -| `[array item]` | array | false | | | -| `» available_workers` | array | false | | | -| `» canceled_at` | string(date-time) | false | | | -| `» completed_at` | string(date-time) | false | | | -| `» created_at` | string(date-time) | false | | | -| `» error` | string | false | | | -| `» error_code` | [codersdk.JobErrorCode](schemas.md#codersdkjoberrorcode) | false | | | -| `» file_id` | string(uuid) | false | | | -| `» id` | string(uuid) | false | | | -| `» input` | [codersdk.ProvisionerJobInput](schemas.md#codersdkprovisionerjobinput) | false | | | -| `»» error` | string | false | | | -| `»» template_version_id` | string(uuid) | false | | | -| `»» workspace_build_id` | string(uuid) | false | | | -| `» organization_id` | string(uuid) | false | | | -| `» queue_position` | integer | false | | | -| `» queue_size` | integer | false | | | -| `» started_at` | string(date-time) | false | | | -| `» status` | [codersdk.ProvisionerJobStatus](schemas.md#codersdkprovisionerjobstatus) | false | | | -| `» tags` | object | false | | | -| `»» [any property]` | string | false | | | -| `» type` | [codersdk.ProvisionerJobType](schemas.md#codersdkprovisionerjobtype) | false | | | -| `» worker_id` | string(uuid) | false | | | +| Name | Type | Required | Restrictions | Description | +|----------------------------|------------------------------------------------------------------------------|----------|--------------|-------------| +| `[array item]` | array | false | | | +| `» available_workers` | array | false | | | +| `» canceled_at` | string(date-time) | false | | | +| `» completed_at` | string(date-time) | false | | | +| `» created_at` | string(date-time) | false | | | +| `» error` | string | false | | | +| `» error_code` | [codersdk.JobErrorCode](schemas.md#codersdkjoberrorcode) | false | | | +| `» file_id` | string(uuid) | false | | | +| `» id` | string(uuid) | false | | | +| `» input` | [codersdk.ProvisionerJobInput](schemas.md#codersdkprovisionerjobinput) | false | | | +| `»» error` | string | false | | | +| `»» template_version_id` | string(uuid) | false | | | +| `»» workspace_build_id` | string(uuid) | false | | | +| `» metadata` | [codersdk.ProvisionerJobMetadata](schemas.md#codersdkprovisionerjobmetadata) | false | | | +| `»» template_display_name` | string | false | | | +| `»» template_id` | string(uuid) | false | | | +| `»» template_name` | string | false | | | +| `»» template_version_name` | string | false | | | +| `»» workspace_id` | string(uuid) | false | | | +| `»» workspace_name` | string | false | | | +| `» organization_id` | string(uuid) | false | | | +| `» queue_position` | integer | false | | | +| `» queue_size` | integer | false | | | +| `» started_at` | string(date-time) | false | | | +| `» status` | [codersdk.ProvisionerJobStatus](schemas.md#codersdkprovisionerjobstatus) | false | | | +| `» tags` | object | false | | | +| `»» [any property]` | string | false | | | +| `» type` | [codersdk.ProvisionerJobType](schemas.md#codersdkprovisionerjobtype) | false | | | +| `» worker_id` | string(uuid) | false | | | #### Enumerated Values @@ -513,6 +528,14 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, diff --git a/docs/reference/api/schemas.md b/docs/reference/api/schemas.md index 1af6ac7285d04..082b3f3a1f19f 100644 --- a/docs/reference/api/schemas.md +++ b/docs/reference/api/schemas.md @@ -4602,6 +4602,14 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -4618,26 +4626,27 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith ### Properties -| Name | Type | Required | Restrictions | Description | -|---------------------|----------------------------------------------------------------|----------|--------------|-------------| -| `available_workers` | array of string | false | | | -| `canceled_at` | string | false | | | -| `completed_at` | string | false | | | -| `created_at` | string | false | | | -| `error` | string | false | | | -| `error_code` | [codersdk.JobErrorCode](#codersdkjoberrorcode) | false | | | -| `file_id` | string | false | | | -| `id` | string | false | | | -| `input` | [codersdk.ProvisionerJobInput](#codersdkprovisionerjobinput) | false | | | -| `organization_id` | string | false | | | -| `queue_position` | integer | false | | | -| `queue_size` | integer | false | | | -| `started_at` | string | false | | | -| `status` | [codersdk.ProvisionerJobStatus](#codersdkprovisionerjobstatus) | false | | | -| `tags` | object | false | | | -| » `[any property]` | string | false | | | -| `type` | [codersdk.ProvisionerJobType](#codersdkprovisionerjobtype) | false | | | -| `worker_id` | string | false | | | +| Name | Type | Required | Restrictions | Description | +|---------------------|--------------------------------------------------------------------|----------|--------------|-------------| +| `available_workers` | array of string | false | | | +| `canceled_at` | string | false | | | +| `completed_at` | string | false | | | +| `created_at` | string | false | | | +| `error` | string | false | | | +| `error_code` | [codersdk.JobErrorCode](#codersdkjoberrorcode) | false | | | +| `file_id` | string | false | | | +| `id` | string | false | | | +| `input` | [codersdk.ProvisionerJobInput](#codersdkprovisionerjobinput) | false | | | +| `metadata` | [codersdk.ProvisionerJobMetadata](#codersdkprovisionerjobmetadata) | false | | | +| `organization_id` | string | false | | | +| `queue_position` | integer | false | | | +| `queue_size` | integer | false | | | +| `started_at` | string | false | | | +| `status` | [codersdk.ProvisionerJobStatus](#codersdkprovisionerjobstatus) | false | | | +| `tags` | object | false | | | +| » `[any property]` | string | false | | | +| `type` | [codersdk.ProvisionerJobType](#codersdkprovisionerjobtype) | false | | | +| `worker_id` | string | false | | | #### Enumerated Values @@ -4703,6 +4712,30 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith | `log_level` | `warn` | | `log_level` | `error` | +## codersdk.ProvisionerJobMetadata + +```json +{ + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" +} +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +|-------------------------|--------|----------|--------------|-------------| +| `template_display_name` | string | false | | | +| `template_id` | string | false | | | +| `template_name` | string | false | | | +| `template_version_name` | string | false | | | +| `workspace_id` | string | false | | | +| `workspace_name` | string | false | | | + ## codersdk.ProvisionerJobStatus ```json @@ -6101,6 +6134,14 @@ Restarts will only happen on weekdays in this list on weeks which line up with W "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -7166,6 +7207,14 @@ If the schedule is empty, the user will be updated to use the default schedule.| "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -7908,6 +7957,14 @@ If the schedule is empty, the user will be updated to use the default schedule.| "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -8572,6 +8629,14 @@ If the schedule is empty, the user will be updated to use the default schedule.| "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, diff --git a/docs/reference/api/templates.md b/docs/reference/api/templates.md index 6378c5f233fb8..49a4b3b45c196 100644 --- a/docs/reference/api/templates.md +++ b/docs/reference/api/templates.md @@ -462,6 +462,14 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -550,6 +558,14 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -662,6 +678,14 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1202,6 +1226,14 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions \ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1242,49 +1274,56 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions \ Status Code **200** -| Name | Type | Required | Restrictions | Description | -|---------------------------|--------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `[array item]` | array | false | | | -| `» archived` | boolean | false | | | -| `» created_at` | string(date-time) | false | | | -| `» created_by` | [codersdk.MinimalUser](schemas.md#codersdkminimaluser) | false | | | -| `»» avatar_url` | string(uri) | false | | | -| `»» id` | string(uuid) | true | | | -| `»» username` | string | true | | | -| `» id` | string(uuid) | false | | | -| `» job` | [codersdk.ProvisionerJob](schemas.md#codersdkprovisionerjob) | false | | | -| `»» available_workers` | array | false | | | -| `»» canceled_at` | string(date-time) | false | | | -| `»» completed_at` | string(date-time) | false | | | -| `»» created_at` | string(date-time) | false | | | -| `»» error` | string | false | | | -| `»» error_code` | [codersdk.JobErrorCode](schemas.md#codersdkjoberrorcode) | false | | | -| `»» file_id` | string(uuid) | false | | | -| `»» id` | string(uuid) | false | | | -| `»» input` | [codersdk.ProvisionerJobInput](schemas.md#codersdkprovisionerjobinput) | false | | | -| `»»» error` | string | false | | | -| `»»» template_version_id` | string(uuid) | false | | | -| `»»» workspace_build_id` | string(uuid) | false | | | -| `»» organization_id` | string(uuid) | false | | | -| `»» queue_position` | integer | false | | | -| `»» queue_size` | integer | false | | | -| `»» started_at` | string(date-time) | false | | | -| `»» status` | [codersdk.ProvisionerJobStatus](schemas.md#codersdkprovisionerjobstatus) | false | | | -| `»» tags` | object | false | | | -| `»»» [any property]` | string | false | | | -| `»» type` | [codersdk.ProvisionerJobType](schemas.md#codersdkprovisionerjobtype) | false | | | -| `»» worker_id` | string(uuid) | false | | | -| `» matched_provisioners` | [codersdk.MatchedProvisioners](schemas.md#codersdkmatchedprovisioners) | false | | | -| `»» available` | integer | false | | Available is the number of provisioner daemons that are available to take jobs. This may be less than the count if some provisioners are busy or have been stopped. | -| `»» count` | integer | false | | Count is the number of provisioner daemons that matched the given tags. If the count is 0, it means no provisioner daemons matched the requested tags. | -| `»» most_recently_seen` | string(date-time) | false | | Most recently seen is the most recently seen time of the set of matched provisioners. If no provisioners matched, this field will be null. | -| `» message` | string | false | | | -| `» name` | string | false | | | -| `» organization_id` | string(uuid) | false | | | -| `» readme` | string | false | | | -| `» template_id` | string(uuid) | false | | | -| `» updated_at` | string(date-time) | false | | | -| `» warnings` | array | false | | | +| Name | Type | Required | Restrictions | Description | +|-----------------------------|------------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `[array item]` | array | false | | | +| `» archived` | boolean | false | | | +| `» created_at` | string(date-time) | false | | | +| `» created_by` | [codersdk.MinimalUser](schemas.md#codersdkminimaluser) | false | | | +| `»» avatar_url` | string(uri) | false | | | +| `»» id` | string(uuid) | true | | | +| `»» username` | string | true | | | +| `» id` | string(uuid) | false | | | +| `» job` | [codersdk.ProvisionerJob](schemas.md#codersdkprovisionerjob) | false | | | +| `»» available_workers` | array | false | | | +| `»» canceled_at` | string(date-time) | false | | | +| `»» completed_at` | string(date-time) | false | | | +| `»» created_at` | string(date-time) | false | | | +| `»» error` | string | false | | | +| `»» error_code` | [codersdk.JobErrorCode](schemas.md#codersdkjoberrorcode) | false | | | +| `»» file_id` | string(uuid) | false | | | +| `»» id` | string(uuid) | false | | | +| `»» input` | [codersdk.ProvisionerJobInput](schemas.md#codersdkprovisionerjobinput) | false | | | +| `»»» error` | string | false | | | +| `»»» template_version_id` | string(uuid) | false | | | +| `»»» workspace_build_id` | string(uuid) | false | | | +| `»» metadata` | [codersdk.ProvisionerJobMetadata](schemas.md#codersdkprovisionerjobmetadata) | false | | | +| `»»» template_display_name` | string | false | | | +| `»»» template_id` | string(uuid) | false | | | +| `»»» template_name` | string | false | | | +| `»»» template_version_name` | string | false | | | +| `»»» workspace_id` | string(uuid) | false | | | +| `»»» workspace_name` | string | false | | | +| `»» organization_id` | string(uuid) | false | | | +| `»» queue_position` | integer | false | | | +| `»» queue_size` | integer | false | | | +| `»» started_at` | string(date-time) | false | | | +| `»» status` | [codersdk.ProvisionerJobStatus](schemas.md#codersdkprovisionerjobstatus) | false | | | +| `»» tags` | object | false | | | +| `»»» [any property]` | string | false | | | +| `»» type` | [codersdk.ProvisionerJobType](schemas.md#codersdkprovisionerjobtype) | false | | | +| `»» worker_id` | string(uuid) | false | | | +| `» matched_provisioners` | [codersdk.MatchedProvisioners](schemas.md#codersdkmatchedprovisioners) | false | | | +| `»» available` | integer | false | | Available is the number of provisioner daemons that are available to take jobs. This may be less than the count if some provisioners are busy or have been stopped. | +| `»» count` | integer | false | | Count is the number of provisioner daemons that matched the given tags. If the count is 0, it means no provisioner daemons matched the requested tags. | +| `»» most_recently_seen` | string(date-time) | false | | Most recently seen is the most recently seen time of the set of matched provisioners. If no provisioners matched, this field will be null. | +| `» message` | string | false | | | +| `» name` | string | false | | | +| `» organization_id` | string(uuid) | false | | | +| `» readme` | string | false | | | +| `» template_id` | string(uuid) | false | | | +| `» updated_at` | string(date-time) | false | | | +| `» warnings` | array | false | | | #### Enumerated Values @@ -1462,6 +1501,14 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions/{templ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1502,49 +1549,56 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions/{templ Status Code **200** -| Name | Type | Required | Restrictions | Description | -|---------------------------|--------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `[array item]` | array | false | | | -| `» archived` | boolean | false | | | -| `» created_at` | string(date-time) | false | | | -| `» created_by` | [codersdk.MinimalUser](schemas.md#codersdkminimaluser) | false | | | -| `»» avatar_url` | string(uri) | false | | | -| `»» id` | string(uuid) | true | | | -| `»» username` | string | true | | | -| `» id` | string(uuid) | false | | | -| `» job` | [codersdk.ProvisionerJob](schemas.md#codersdkprovisionerjob) | false | | | -| `»» available_workers` | array | false | | | -| `»» canceled_at` | string(date-time) | false | | | -| `»» completed_at` | string(date-time) | false | | | -| `»» created_at` | string(date-time) | false | | | -| `»» error` | string | false | | | -| `»» error_code` | [codersdk.JobErrorCode](schemas.md#codersdkjoberrorcode) | false | | | -| `»» file_id` | string(uuid) | false | | | -| `»» id` | string(uuid) | false | | | -| `»» input` | [codersdk.ProvisionerJobInput](schemas.md#codersdkprovisionerjobinput) | false | | | -| `»»» error` | string | false | | | -| `»»» template_version_id` | string(uuid) | false | | | -| `»»» workspace_build_id` | string(uuid) | false | | | -| `»» organization_id` | string(uuid) | false | | | -| `»» queue_position` | integer | false | | | -| `»» queue_size` | integer | false | | | -| `»» started_at` | string(date-time) | false | | | -| `»» status` | [codersdk.ProvisionerJobStatus](schemas.md#codersdkprovisionerjobstatus) | false | | | -| `»» tags` | object | false | | | -| `»»» [any property]` | string | false | | | -| `»» type` | [codersdk.ProvisionerJobType](schemas.md#codersdkprovisionerjobtype) | false | | | -| `»» worker_id` | string(uuid) | false | | | -| `» matched_provisioners` | [codersdk.MatchedProvisioners](schemas.md#codersdkmatchedprovisioners) | false | | | -| `»» available` | integer | false | | Available is the number of provisioner daemons that are available to take jobs. This may be less than the count if some provisioners are busy or have been stopped. | -| `»» count` | integer | false | | Count is the number of provisioner daemons that matched the given tags. If the count is 0, it means no provisioner daemons matched the requested tags. | -| `»» most_recently_seen` | string(date-time) | false | | Most recently seen is the most recently seen time of the set of matched provisioners. If no provisioners matched, this field will be null. | -| `» message` | string | false | | | -| `» name` | string | false | | | -| `» organization_id` | string(uuid) | false | | | -| `» readme` | string | false | | | -| `» template_id` | string(uuid) | false | | | -| `» updated_at` | string(date-time) | false | | | -| `» warnings` | array | false | | | +| Name | Type | Required | Restrictions | Description | +|-----------------------------|------------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `[array item]` | array | false | | | +| `» archived` | boolean | false | | | +| `» created_at` | string(date-time) | false | | | +| `» created_by` | [codersdk.MinimalUser](schemas.md#codersdkminimaluser) | false | | | +| `»» avatar_url` | string(uri) | false | | | +| `»» id` | string(uuid) | true | | | +| `»» username` | string | true | | | +| `» id` | string(uuid) | false | | | +| `» job` | [codersdk.ProvisionerJob](schemas.md#codersdkprovisionerjob) | false | | | +| `»» available_workers` | array | false | | | +| `»» canceled_at` | string(date-time) | false | | | +| `»» completed_at` | string(date-time) | false | | | +| `»» created_at` | string(date-time) | false | | | +| `»» error` | string | false | | | +| `»» error_code` | [codersdk.JobErrorCode](schemas.md#codersdkjoberrorcode) | false | | | +| `»» file_id` | string(uuid) | false | | | +| `»» id` | string(uuid) | false | | | +| `»» input` | [codersdk.ProvisionerJobInput](schemas.md#codersdkprovisionerjobinput) | false | | | +| `»»» error` | string | false | | | +| `»»» template_version_id` | string(uuid) | false | | | +| `»»» workspace_build_id` | string(uuid) | false | | | +| `»» metadata` | [codersdk.ProvisionerJobMetadata](schemas.md#codersdkprovisionerjobmetadata) | false | | | +| `»»» template_display_name` | string | false | | | +| `»»» template_id` | string(uuid) | false | | | +| `»»» template_name` | string | false | | | +| `»»» template_version_name` | string | false | | | +| `»»» workspace_id` | string(uuid) | false | | | +| `»»» workspace_name` | string | false | | | +| `»» organization_id` | string(uuid) | false | | | +| `»» queue_position` | integer | false | | | +| `»» queue_size` | integer | false | | | +| `»» started_at` | string(date-time) | false | | | +| `»» status` | [codersdk.ProvisionerJobStatus](schemas.md#codersdkprovisionerjobstatus) | false | | | +| `»» tags` | object | false | | | +| `»»» [any property]` | string | false | | | +| `»» type` | [codersdk.ProvisionerJobType](schemas.md#codersdkprovisionerjobtype) | false | | | +| `»» worker_id` | string(uuid) | false | | | +| `» matched_provisioners` | [codersdk.MatchedProvisioners](schemas.md#codersdkmatchedprovisioners) | false | | | +| `»» available` | integer | false | | Available is the number of provisioner daemons that are available to take jobs. This may be less than the count if some provisioners are busy or have been stopped. | +| `»» count` | integer | false | | Count is the number of provisioner daemons that matched the given tags. If the count is 0, it means no provisioner daemons matched the requested tags. | +| `»» most_recently_seen` | string(date-time) | false | | Most recently seen is the most recently seen time of the set of matched provisioners. If no provisioners matched, this field will be null. | +| `» message` | string | false | | | +| `» name` | string | false | | | +| `» organization_id` | string(uuid) | false | | | +| `» readme` | string | false | | | +| `» template_id` | string(uuid) | false | | | +| `» updated_at` | string(date-time) | false | | | +| `» warnings` | array | false | | | #### Enumerated Values @@ -1612,6 +1666,14 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion} \ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1709,6 +1771,14 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1896,6 +1966,14 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1959,6 +2037,14 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, diff --git a/docs/reference/api/workspaces.md b/docs/reference/api/workspaces.md index e39e553927bf0..680dec178bf4e 100644 --- a/docs/reference/api/workspaces.md +++ b/docs/reference/api/workspaces.md @@ -91,6 +91,14 @@ of the template will be used. "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -332,6 +340,14 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -597,6 +613,14 @@ of the template will be used. "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -841,6 +865,14 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1079,6 +1111,14 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace} \ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, @@ -1436,6 +1476,14 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/dormant \ "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", "workspace_build_id": "badaf2eb-96c5-4050-9f1d-db2d39ca5478" }, + "metadata": { + "template_display_name": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_version_name": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string" + }, "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", "queue_position": 0, "queue_size": 0, diff --git a/docs/reference/cli/provisioner_jobs_list.md b/docs/reference/cli/provisioner_jobs_list.md index 03e187b1c6720..ed16448459d7b 100644 --- a/docs/reference/cli/provisioner_jobs_list.md +++ b/docs/reference/cli/provisioner_jobs_list.md @@ -45,10 +45,10 @@ Select which organization (uuid or name) to use. ### -c, --column -| | | -|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Type | [id\|created at\|started at\|completed at\|canceled at\|error\|error code\|status\|worker id\|file id\|tags\|queue position\|queue size\|organization id\|template version id\|workspace build id\|type\|available workers\|organization\|queue] | -| Default | created at,id,organization,status,type,queue,tags | +| | | +|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Type | [id\|created at\|started at\|completed at\|canceled at\|error\|error code\|status\|worker id\|file id\|tags\|queue position\|queue size\|organization id\|template version id\|workspace build id\|type\|available workers\|template version name\|template id\|template name\|template display name\|workspace id\|workspace name\|organization\|queue] | +| Default | created at,id,organization,status,type,queue,tags | Columns to display in table output. diff --git a/enterprise/cli/testdata/coder_provisioner_jobs_list_--help.golden b/enterprise/cli/testdata/coder_provisioner_jobs_list_--help.golden index 585e918c23e7b..bd29b7560ea6a 100644 --- a/enterprise/cli/testdata/coder_provisioner_jobs_list_--help.golden +++ b/enterprise/cli/testdata/coder_provisioner_jobs_list_--help.golden @@ -11,7 +11,7 @@ OPTIONS: -O, --org string, $CODER_ORGANIZATION Select which organization (uuid or name) to use. - -c, --column [id|created at|started at|completed at|canceled at|error|error code|status|worker id|file id|tags|queue position|queue size|organization id|template version id|workspace build id|type|available workers|organization|queue] (default: created at,id,organization,status,type,queue,tags) + -c, --column [id|created at|started at|completed at|canceled at|error|error code|status|worker id|file id|tags|queue position|queue size|organization id|template version id|workspace build id|type|available workers|template version name|template id|template name|template display name|workspace id|workspace name|organization|queue] (default: created at,id,organization,status,type,queue,tags) Columns to display in table output. -l, --limit int, $CODER_PROVISIONER_JOB_LIST_LIMIT (default: 50) diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 58375a98370a0..2e7732c525c42 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -1638,6 +1638,7 @@ export interface ProvisionerJob { readonly input: ProvisionerJobInput; readonly type: ProvisionerJobType; readonly available_workers?: readonly string[]; + readonly metadata?: ProvisionerJobMetadata; } // From codersdk/provisionerdaemons.go @@ -1657,6 +1658,16 @@ export interface ProvisionerJobLog { readonly output: string; } +// From codersdk/provisionerdaemons.go +export interface ProvisionerJobMetadata { + readonly template_version_name: string; + readonly template_id: string; + readonly template_name: string; + readonly template_display_name: string; + readonly workspace_id?: string; + readonly workspace_name?: string; +} + // From codersdk/provisionerdaemons.go export type ProvisionerJobStatus = | "canceled" From 33a89abf7a4e2f71520f8ad12cb0192361c56c55 Mon Sep 17 00:00:00 2001 From: M Atif Ali Date: Thu, 6 Feb 2025 20:05:18 +0500 Subject: [PATCH 023/859] docs: remove official cloud installation methods from the unofficial page (#16452) --- docs/install/other/index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/install/other/index.md b/docs/install/other/index.md index 3809d86812526..f727e5c34bf55 100644 --- a/docs/install/other/index.md +++ b/docs/install/other/index.md @@ -5,8 +5,6 @@ welcome! | Platform Name | Status | Documentation | |-----------------------------------------------------------------------------------|------------|----------------------------------------------------------------------------------------------| -| AWS EC2 | Official | [Guide: AWS](../cloud/ec2.md) | -| Google Compute Engine | Official | [Guide: Google Compute Engine](../cloud/compute-engine.md) | | Azure AKS | Unofficial | [GitHub: coder-aks](https://github.com/ericpaulsen/coder-aks) | | Terraform (GKE, AKS, LKE, DOKS, IBMCloud K8s, OVHCloud K8s, Scaleway K8s Kapsule) | Unofficial | [GitHub: coder-oss-terraform](https://github.com/ElliotG/coder-oss-tf) | | Fly.io | Unofficial | [Blog: Run Coder on Fly.io](https://coder.com/blog/remote-developer-environments-on-fly-io) | From bcfeb726d6770910eb163c87af00af341a7d5d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B1=E3=82=A4=E3=83=A9?= Date: Thu, 6 Feb 2025 16:45:03 -0700 Subject: [PATCH 024/859] feat: show warning on unrecognized idp org mapping claims (#16478) --- site/src/api/api.ts | 20 +++++--- site/src/api/queries/deployment.ts | 7 +++ site/src/api/queries/organizations.ts | 26 ++-------- site/src/components/Combobox/Combobox.tsx | 2 +- .../components/Tooltip/Tooltip.stories.tsx | 16 +++---- .../IdpOrgSyncPage/IdpOrgSyncPage.tsx | 45 ++++++++---------- .../IdpOrgSyncPageView.stories.tsx | 33 ++++++------- .../IdpOrgSyncPage/IdpOrgSyncPageView.tsx | 47 +++++++++++++++---- site/src/testHelpers/entities.ts | 7 +++ site/tailwind.config.js | 1 + 10 files changed, 113 insertions(+), 91 deletions(-) diff --git a/site/src/api/api.ts b/site/src/api/api.ts index cd21b5b063ac6..5a314ddde151a 100644 --- a/site/src/api/api.ts +++ b/site/src/api/api.ts @@ -698,7 +698,7 @@ class ApiMethods { } const response = await this.axios.get( - `/api/v2/organizations/${organization}/provisionerdaemons?${params.toString()}`, + `/api/v2/organizations/${organization}/provisionerdaemons?${params}`, ); return response.data; }; @@ -787,19 +787,25 @@ class ApiMethods { return response.data; }; - getIdpSyncClaimFieldValues = async (claimField: string) => { - const response = await this.axios.get( - `/api/v2/settings/idpsync/field-values?claimField=${claimField}`, + getDeploymentIdpSyncFieldValues = async ( + field: string, + ): Promise => { + const params = new URLSearchParams(); + params.set("claimField", field); + const response = await this.axios.get( + `/api/v2/settings/idpsync/field-values?${params}`, ); return response.data; }; - getIdpSyncClaimFieldValuesByOrganization = async ( + getOrganizationIdpSyncClaimFieldValues = async ( organization: string, - claimField: string, + field: string, ) => { + const params = new URLSearchParams(); + params.set("claimField", field); const response = await this.axios.get( - `/api/v2/organizations/${organization}/settings/idpsync/field-values?claimField=${claimField}`, + `/api/v2/organizations/${organization}/settings/idpsync/field-values?${params}`, ); return response.data; }; diff --git a/site/src/api/queries/deployment.ts b/site/src/api/queries/deployment.ts index 62449af12fccf..999dd2ee4cbd5 100644 --- a/site/src/api/queries/deployment.ts +++ b/site/src/api/queries/deployment.ts @@ -29,3 +29,10 @@ export const deploymentSSHConfig = () => { queryFn: API.getDeploymentSSHConfig, }; }; + +export const deploymentIdpSyncFieldValues = (field: string) => { + return { + queryKey: ["deployment", "idpSync", "fieldValues", field], + queryFn: () => API.getDeploymentIdpSyncFieldValues(field), + }; +}; diff --git a/site/src/api/queries/organizations.ts b/site/src/api/queries/organizations.ts index 33ef19f0d2654..6246664e6ecf0 100644 --- a/site/src/api/queries/organizations.ts +++ b/site/src/api/queries/organizations.ts @@ -341,32 +341,16 @@ export const organizationsPermissions = ( export const getOrganizationIdpSyncClaimFieldValuesKey = ( organization: string, - claimField: string, -) => [organization, claimField, "organizationIdpSyncClaimFieldValues"]; + field: string, +) => [organization, "idpSync", "fieldValues", field]; export const organizationIdpSyncClaimFieldValues = ( organization: string, - claimField: string, + field: string, ) => { return { - queryKey: getOrganizationIdpSyncClaimFieldValuesKey( - organization, - claimField, - ), + queryKey: getOrganizationIdpSyncClaimFieldValuesKey(organization, field), queryFn: () => - API.getIdpSyncClaimFieldValuesByOrganization(organization, claimField), - }; -}; - -export const getIdpSyncClaimFieldValuesKey = (claimField: string) => [ - claimField, - "idpSyncClaimFieldValues", -]; - -export const idpSyncClaimFieldValues = (claimField: string) => { - return { - queryKey: getIdpSyncClaimFieldValuesKey(claimField), - queryFn: () => API.getIdpSyncClaimFieldValues(claimField), - enabled: !!claimField, + API.getOrganizationIdpSyncClaimFieldValues(organization, field), }; }; diff --git a/site/src/components/Combobox/Combobox.tsx b/site/src/components/Combobox/Combobox.tsx index f5447b3a87062..fa15b6808a05e 100644 --- a/site/src/components/Combobox/Combobox.tsx +++ b/site/src/components/Combobox/Combobox.tsx @@ -18,7 +18,7 @@ import { cn } from "utils/cn"; interface ComboboxProps { value: string; - options?: string[]; + options?: readonly string[]; placeholder?: string; open: boolean; onOpenChange: (open: boolean) => void; diff --git a/site/src/components/Tooltip/Tooltip.stories.tsx b/site/src/components/Tooltip/Tooltip.stories.tsx index 68561b6a189e3..9af79ca76c099 100644 --- a/site/src/components/Tooltip/Tooltip.stories.tsx +++ b/site/src/components/Tooltip/Tooltip.stories.tsx @@ -12,16 +12,12 @@ const meta: Meta = { component: TooltipProvider, args: { children: ( - <> - - - - - - Add to library - - - + + + + + Add to library + ), }, }; diff --git a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPage.tsx b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPage.tsx index 4d5b53e0f3ea2..295b482f94286 100644 --- a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPage.tsx +++ b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPage.tsx @@ -1,9 +1,9 @@ import { getErrorMessage } from "api/errors"; +import { deploymentIdpSyncFieldValues } from "api/queries/deployment"; import { organizationIdpSyncSettings, patchOrganizationSyncSettings, } from "api/queries/idpsync"; -import { idpSyncClaimFieldValues } from "api/queries/organizations"; import { ChooseOne, Cond } from "components/Conditionals/ChooseOne"; import { displayError } from "components/GlobalSnackbar/utils"; import { displaySuccess } from "components/GlobalSnackbar/utils"; @@ -21,26 +21,23 @@ import { ExportPolicyButton } from "./ExportPolicyButton"; import IdpOrgSyncPageView from "./IdpOrgSyncPageView"; export const IdpOrgSyncPage: FC = () => { - const [claimField, setClaimField] = useState(""); const queryClient = useQueryClient(); // IdP sync does not have its own entitlement and is based on templace_rbac const { template_rbac: isIdpSyncEnabled } = useFeatureVisibility(); const { organizations } = useDashboard(); - const { - data: orgSyncSettingsData, - isLoading, - error, - } = useQuery({ - ...organizationIdpSyncSettings(isIdpSyncEnabled), - onSuccess: (data) => { - if (data?.field) { - setClaimField(data.field); - } - }, - }); + const settingsQuery = useQuery(organizationIdpSyncSettings(isIdpSyncEnabled)); - const { data: claimFieldValues } = useQuery( - idpSyncClaimFieldValues(claimField), + const [field, setField] = useState(""); + useEffect(() => { + if (!settingsQuery.data) { + return; + } + + setField(settingsQuery.data.field); + }, [settingsQuery.data]); + + const fieldValuesQuery = useQuery( + field ? deploymentIdpSyncFieldValues(field) : { enabled: false }, ); const patchOrganizationSyncSettingsMutation = useMutation( @@ -58,14 +55,10 @@ export const IdpOrgSyncPage: FC = () => { } }, [patchOrganizationSyncSettingsMutation.error]); - if (isLoading) { + if (settingsQuery.isLoading) { return ; } - const handleSyncFieldChange = (value: string) => { - setClaimField(value); - }; - return ( <> @@ -84,7 +77,7 @@ export const IdpOrgSyncPage: FC = () => {

- + @@ -96,8 +89,10 @@ export const IdpOrgSyncPage: FC = () => { { try { await patchOrganizationSyncSettingsMutation.mutateAsync(data); @@ -111,9 +106,7 @@ export const IdpOrgSyncPage: FC = () => { ); } }} - onSyncFieldChange={handleSyncFieldChange} - claimFieldValues={claimFieldValues} - error={error || patchOrganizationSyncSettingsMutation.error} + error={settingsQuery.error || fieldValuesQuery.error} /> diff --git a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx index 8d02e1f248833..78842737e5baf 100644 --- a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx +++ b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx @@ -5,12 +5,19 @@ import { MockOrganization2, MockOrganizationSyncSettings, MockOrganizationSyncSettings2, + MockOrganizationSyncSettingsEmpty, } from "testHelpers/entities"; import { IdpOrgSyncPageView } from "./IdpOrgSyncPageView"; const meta: Meta = { title: "pages/IdpOrgSyncPageView", component: IdpOrgSyncPageView, + args: { + organizationSyncSettings: MockOrganizationSyncSettings2, + claimFieldValues: Object.keys(MockOrganizationSyncSettings2.mapping), + organizations: [MockOrganization, MockOrganization2], + error: undefined, + }, }; export default meta; @@ -18,35 +25,29 @@ type Story = StoryObj; export const Empty: Story = { args: { - organizationSyncSettings: { - field: "", - mapping: {}, - organization_assign_default: true, - }, - organizations: [MockOrganization, MockOrganization2], - error: undefined, + organizationSyncSettings: MockOrganizationSyncSettingsEmpty, }, }; -export const Default: Story = { - args: { - organizationSyncSettings: MockOrganizationSyncSettings2, - organizations: [MockOrganization, MockOrganization2], - error: undefined, - }, -}; +export const Default: Story = {}; export const HasError: Story = { args: { - ...Default.args, error: "This is a test error", }, }; export const MissingGroups: Story = { args: { - ...Default.args, organizationSyncSettings: MockOrganizationSyncSettings, + claimFieldValues: Object.keys(MockOrganizationSyncSettings.mapping), + organizations: [], + }, +}; + +export const MissingClaim: Story = { + args: { + claimFieldValues: [], }, }; diff --git a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx index 031234da0da25..f6822ba0a60ef 100644 --- a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx +++ b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx @@ -1,3 +1,4 @@ +import { TooltipProvider } from "@radix-ui/react-tooltip"; import type { Organization, OrganizationSyncSettings, @@ -28,12 +29,8 @@ import { MultiSelectCombobox, type Option, } from "components/MultiSelectCombobox/MultiSelectCombobox"; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "components/Popover/Popover"; import { Spinner } from "components/Spinner/Spinner"; +import { Stack } from "components/Stack/Stack"; import { Switch } from "components/Switch/Switch"; import { Table, @@ -42,10 +39,14 @@ import { TableHeader, TableRow, } from "components/Table/Table"; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "components/Tooltip/Tooltip"; import { useFormik } from "formik"; -import { Check, ChevronDown, CornerDownLeft, Plus, Trash } from "lucide-react"; +import { Plus, Trash, TriangleAlert } from "lucide-react"; import { type FC, type KeyboardEventHandler, useId, useState } from "react"; -import { cn } from "utils/cn"; import { docs } from "utils/docs"; import { isUUID } from "utils/uuid"; import * as Yup from "yup"; @@ -53,10 +54,10 @@ import { OrganizationPills } from "./OrganizationPills"; interface IdpSyncPageViewProps { organizationSyncSettings: OrganizationSyncSettings | undefined; + claimFieldValues: readonly string[] | undefined; organizations: readonly Organization[]; onSubmit: (data: OrganizationSyncSettings) => void; onSyncFieldChange: (value: string) => void; - claimFieldValues: string[] | undefined; error?: unknown; } @@ -84,10 +85,10 @@ const validationSchema = Yup.object({ export const IdpOrgSyncPageView: FC = ({ organizationSyncSettings, + claimFieldValues, organizations, onSubmit, onSyncFieldChange, - claimFieldValues, error, }) => { const form = useFormik({ @@ -313,6 +314,7 @@ export const IdpOrgSyncPageView: FC = ({ idpOrg={idpOrg} coderOrgs={getOrgNames(organizations)} onDelete={handleDelete} + exists={claimFieldValues?.includes(idpOrg)} /> ))} @@ -398,18 +400,43 @@ const IdpMappingTable: FC = ({ isEmpty, children }) => { interface OrganizationRowProps { idpOrg: string; + exists: boolean | undefined; coderOrgs: readonly string[]; onDelete: (idpOrg: string) => void; } const OrganizationRow: FC = ({ idpOrg, + exists = true, coderOrgs, onDelete, }) => { return ( - {idpOrg} + +
+ {idpOrg} + {!exists && ( + + + + + + + This value has not be seen in the specified claim field + before. You might want to check your IdP configuration and + ensure that this value is not misspelled. + + + + )} +
+
diff --git a/site/src/testHelpers/entities.ts b/site/src/testHelpers/entities.ts index c522457a63c1d..d8ce878bdef6e 100644 --- a/site/src/testHelpers/entities.ts +++ b/site/src/testHelpers/entities.ts @@ -2720,6 +2720,13 @@ export const MockOrganizationSyncSettings2: TypesGen.OrganizationSyncSettings = organization_assign_default: true, }; +export const MockOrganizationSyncSettingsEmpty: TypesGen.OrganizationSyncSettings = + { + field: "", + mapping: {}, + organization_assign_default: true, + }; + export const MockGroup: TypesGen.Group = { id: "fbd2116a-8961-4954-87ae-e4575bd29ce0", name: "Front-End", diff --git a/site/tailwind.config.js b/site/tailwind.config.js index b9964e053fda3..e47048a8b2512 100644 --- a/site/tailwind.config.js +++ b/site/tailwind.config.js @@ -33,6 +33,7 @@ module.exports = { success: "hsl(var(--content-success))", danger: "hsl(var(--content-danger))", link: "hsl(var(--content-link))", + warning: "hsl(var(--content-warning))", }, surface: { primary: "hsl(var(--surface-primary))", From 584503180b95a916c6be461c8b2b89589dd68463 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Fri, 7 Feb 2025 14:01:56 +1100 Subject: [PATCH 025/859] chore: initialize COM in vpn-daemon on Windows (#16476) --- go.mod | 71 +++++++++++++++++++++------------------------- go.sum | 6 ++++ vpn/tun_windows.go | 19 ++++++++++++- 3 files changed, 57 insertions(+), 39 deletions(-) diff --git a/go.mod b/go.mod index ebbd507766fc5..7aae95f26ef28 100644 --- a/go.mod +++ b/go.mod @@ -71,6 +71,7 @@ require ( github.com/adrg/xdg v0.5.0 github.com/ammario/tlru v0.4.0 github.com/andybalholm/brotli v1.1.1 + github.com/aquasecurity/trivy-iac v0.8.0 github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 github.com/awalterschulze/gographviz v2.0.3+incompatible github.com/aws/smithy-go v1.22.2 @@ -101,6 +102,7 @@ require ( github.com/creack/pty v1.1.21 github.com/dave/dst v0.27.2 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc + github.com/dblohm7/wingoes v0.0.0-20240820181039-f2b84150679e github.com/elastic/go-sysinfo v1.15.0 github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 github.com/emersion/go-smtp v0.21.2 @@ -174,6 +176,7 @@ require ( github.com/unrolled/secure v1.17.0 github.com/valyala/fasthttp v1.58.0 github.com/wagslane/go-password-validator v0.3.0 + github.com/zclconf/go-cty-yaml v1.1.0 go.mozilla.org/pkcs7 v0.9.0 go.nhat.io/otelsql v0.15.0 go.opentelemetry.io/otel v1.34.0 @@ -218,11 +221,18 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/DataDog/appsec-internal-go v1.9.0 // indirect github.com/DataDog/datadog-agent/pkg/obfuscate v0.58.0 // indirect + github.com/DataDog/datadog-agent/pkg/proto v0.58.0 // indirect github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.58.0 // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.58.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.58.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.58.0 // indirect github.com/DataDog/datadog-go/v5 v5.5.0 // indirect github.com/DataDog/go-libddwaf/v3 v3.5.1 // indirect + github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 // indirect + github.com/DataDog/go-sqllexer v0.0.14 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/gostackparse v0.7.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0 // indirect github.com/DataDog/sketches-go v1.4.5 // indirect github.com/KyleBanks/depth v1.2.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -235,6 +245,7 @@ require ( github.com/alecthomas/chroma/v2 v2.15.0 // indirect github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 // indirect github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect + github.com/apparentlymart/go-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-radix v1.0.1-0.20221118154546-54df44f2176c // indirect github.com/atotto/clipboard v0.1.4 // indirect @@ -257,9 +268,11 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bep/godartsass/v2 v2.3.2 // indirect github.com/bep/golibsass v1.2.0 // indirect + github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect github.com/charmbracelet/x/ansi v0.4.5 // indirect github.com/charmbracelet/x/term v0.2.0 // indirect github.com/chromedp/sysutil v1.0.0 // indirect + github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/clbanning/mxj/v2 v2.7.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/containerd/continuity v0.4.4 // indirect @@ -298,6 +311,7 @@ require ( github.com/gobwas/ws v1.4.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/gohugoio/hashstructure v0.3.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.2 // indirect @@ -334,11 +348,13 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect github.com/jsimonetti/rtnetlink v1.3.5 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect github.com/kr/fs v0.1.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-localereader v0.0.1 // indirect @@ -356,6 +372,8 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/reflow v0.3.0 // indirect @@ -374,6 +392,7 @@ require ( github.com/pion/transport/v3 v3.0.7 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/riandyrn/otelchi v0.5.1 // indirect @@ -382,6 +401,8 @@ require ( github.com/ryanuber/go-glob v1.0.0 // indirect github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect github.com/secure-systems-lab/go-securesystemslib v0.7.0 // indirect + github.com/shirou/gopsutil/v3 v3.24.4 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/cast v1.7.1 // indirect @@ -391,6 +412,7 @@ require ( github.com/tailscale/golang-x-crypto v0.0.0-20230713185742-f0b76a10a08e // indirect github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect github.com/tailscale/netlink v1.1.1-0.20211101221916-cabfb018fe85 + github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc // indirect github.com/tailscale/wireguard-go v0.0.0-20231121184858-cc193a0b3272 github.com/tchap/go-patricia/v2 v2.3.2 // indirect github.com/tcnksm/go-httpstat v0.2.0 // indirect @@ -399,6 +421,8 @@ require ( github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/tinylib/msgp v1.2.1 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/u-root/uio v0.0.0-20240209044354-b3d14b93376a // indirect github.com/vishvananda/netlink v1.2.1-beta.2 // indirect github.com/vishvananda/netns v0.0.4 // indirect @@ -413,13 +437,21 @@ require ( github.com/yashtewari/glob-intersection v0.2.0 // indirect github.com/yuin/goldmark v1.7.8 // indirect github.com/yuin/goldmark-emoji v1.0.4 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zclconf/go-cty v1.16.0 github.com/zeebo/errs v1.3.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect + go.opentelemetry.io/collector/component v0.104.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.104.0 // indirect + go.opentelemetry.io/collector/pdata v1.11.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.104.0 // indirect + go.opentelemetry.io/collector/semconv v0.104.0 // indirect go.opentelemetry.io/contrib v1.19.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect go.opentelemetry.io/otel/metric v1.34.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect golang.org/x/time v0.9.0 // indirect golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 @@ -429,46 +461,9 @@ require ( google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect howett.net/plist v1.0.0 // indirect kernel.org/pub/linux/libs/security/libcap/psx v1.2.73 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) - -require ( - github.com/aquasecurity/trivy-iac v0.8.0 - github.com/zclconf/go-cty-yaml v1.1.0 -) - -require ( - github.com/DataDog/datadog-agent/pkg/proto v0.58.0 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.58.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.58.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.58.0 // indirect - github.com/DataDog/go-runtime-metrics-internal v0.0.4-0.20241206090539-a14610dc22b6 // indirect - github.com/DataDog/go-sqllexer v0.0.14 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.20.0 // indirect - github.com/apparentlymart/go-cidr v1.1.0 // indirect - github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect - github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect - github.com/gohugoio/hashstructure v0.3.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect - github.com/shirou/gopsutil/v3 v3.24.4 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect - github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/component v0.104.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.104.0 // indirect - go.opentelemetry.io/collector/pdata v1.11.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.104.0 // indirect - go.opentelemetry.io/collector/semconv v0.104.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect -) diff --git a/go.sum b/go.sum index 79216adb83217..960117e12ef6b 100644 --- a/go.sum +++ b/go.sum @@ -267,6 +267,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dblohm7/wingoes v0.0.0-20240820181039-f2b84150679e h1:L+XrFvD0vBIBm+Wf9sFN6aU395t7JROoai0qXZraA4U= +github.com/dblohm7/wingoes v0.0.0-20240820181039-f2b84150679e/go.mod h1:SUxUaAK/0UG5lYyZR1L1nC4AaYYvSSYTWQSH3FPcxKU= github.com/dgraph-io/badger/v4 v4.5.1 h1:7DCIXrQjo1LKmM96YD+hLVJ2EEsyyoWxJfpdd56HLps= github.com/dgraph-io/badger/v4 v4.5.1/go.mod h1:qn3Be0j3TfV4kPbVoK0arXCD1/nr1ftth6sbL5jxdoA= github.com/dgraph-io/ristretto/v2 v2.1.0 h1:59LjpOJLNDULHh8MC4UaegN52lC4JnO2dITsie/Pa8I= @@ -722,6 +724,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/natefinch/atomic v1.0.1 h1:ZPYKxkqQOx3KZ+RsbnP/YsgvxWQPGxjC0oBt2AhwV0A= github.com/natefinch/atomic v1.0.1/go.mod h1:N/D/ELrljoqDyT3rZrsUmtsuzvHkeB/wWjHV22AZRbM= +github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= +github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/niklasfasching/go-org v1.7.0 h1:vyMdcMWWTe/XmANk19F4k8XGBYg0GQ/gJGMimOjGMek= github.com/niklasfasching/go-org v1.7.0/go.mod h1:WuVm4d45oePiE0eX25GqTDQIt/qPW1T9DGkRscqLW5o= @@ -878,6 +882,8 @@ github.com/tailscale/netlink v1.1.1-0.20211101221916-cabfb018fe85 h1:zrsUcqrG2uQ github.com/tailscale/netlink v1.1.1-0.20211101221916-cabfb018fe85/go.mod h1:NzVQi3Mleb+qzq8VmcWpSkcSYxXIg0DkI6XDzpVkhJ0= github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc h1:24heQPtnFR+yfntqhI3oAu9i27nEojcQ4NuBQOo5ZFA= github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc/go.mod h1:f93CXfllFsO9ZQVq+Zocb1Gp4G5Fz0b0rXHLOzt/Djc= +github.com/tc-hib/winres v0.2.1 h1:YDE0FiP0VmtRaDn7+aaChp1KiF4owBiJa5l964l5ujA= +github.com/tc-hib/winres v0.2.1/go.mod h1:C/JaNhH3KBvhNKVbvdlDWkbMDO9H4fKKDaN7/07SSuk= github.com/tchap/go-patricia/v2 v2.3.2 h1:xTHFutuitO2zqKAQ5rCROYgUb7Or/+IC3fts9/Yc7nM= github.com/tchap/go-patricia/v2 v2.3.2/go.mod h1:VZRHKAb53DLaG+nA9EaYYiaEx6YztwDlLElMsnSHD4k= github.com/tdewolff/minify/v2 v2.20.37 h1:Q97cx4STXCh1dlWDlNHZniE8BJ2EBL0+2b0n92BJQhw= diff --git a/vpn/tun_windows.go b/vpn/tun_windows.go index 45897934ccc8f..a70cb8f28d60d 100644 --- a/vpn/tun_windows.go +++ b/vpn/tun_windows.go @@ -7,9 +7,10 @@ import ( "errors" "time" - "github.com/coder/retry" + "github.com/dblohm7/wingoes/com" "github.com/tailscale/wireguard-go/tun" "golang.org/x/sys/windows" + "golang.org/x/sys/windows/svc" "golang.org/x/xerrors" "golang.zx2c4.com/wintun" "tailscale.com/net/dns" @@ -21,11 +22,27 @@ import ( "cdr.dev/slog" "github.com/coder/coder/v2/tailnet" + "github.com/coder/retry" ) const tunName = "Coder" func GetNetworkingStack(t *Tunnel, _ *StartRequest, logger slog.Logger) (NetworkStack, error) { + // Initialize COM process-wide so Tailscale can make calls to the windows + // network APIs to read/write adapter state. + comProcessType := com.ConsoleApp + isSvc, err := svc.IsWindowsService() + if err != nil { + return NetworkStack{}, xerrors.Errorf("svc.IsWindowsService failed: %w", err) + } + if isSvc { + comProcessType = com.Service + } + if err := com.StartRuntime(comProcessType); err != nil { + return NetworkStack{}, xerrors.Errorf("could not initialize COM: com.StartRuntime(%d): %w", comProcessType, err) + } + + // Set the name and GUID for the TUN interface. tun.WintunTunnelType = tunName guid, err := windows.GUIDFromString("{0ed1515d-04a4-4c46-abae-11ad07cf0e6d}") if err != nil { From 6a67e2ede63c9b2a428c53ed724b58874524d8db Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Fri, 7 Feb 2025 14:06:38 +0100 Subject: [PATCH 026/859] feat(cli/server.go): allow the use of public OIDC clients (#16489) Support public OIDC clients - Enables support for public OIDC clients by only checking for a client ID being set. This allows for confidential and public clients to be used with Coder's OIDC authentication. - Also adds a public client configuration to the development OIDC setup script. Fixes #16135 Change-Id: Iadd85d40c2faa595a0498e25d3407a1f94b5c8a8 Signed-off-by: Thomas Kosiewski Signed-off-by: Thomas Kosiewski --- cli/server.go | 7 ++++++- scripts/dev-oidc.sh | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/cli/server.go b/cli/server.go index 41a957815fcd7..548f350bae9bc 100644 --- a/cli/server.go +++ b/cli/server.go @@ -694,7 +694,12 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd. } } - if vals.OIDC.ClientKeyFile != "" || vals.OIDC.ClientSecret != "" { + // As OIDC clients can be confidential or public, + // we should only check for a client id being set. + // The underlying library handles the case of no + // client secrets correctly. For more details on + // client types: https://oauth.net/2/client-types/ + if vals.OIDC.ClientID != "" { if vals.OIDC.IgnoreEmailVerified { logger.Warn(ctx, "coder will not check email_verified for OIDC logins") } diff --git a/scripts/dev-oidc.sh b/scripts/dev-oidc.sh index 6a6d6e08ac705..cf5a7e3c6964c 100755 --- a/scripts/dev-oidc.sh +++ b/scripts/dev-oidc.sh @@ -49,6 +49,17 @@ cat </tmp/example-realm.json "baseUrl": "/coder", "redirectUris": ["*"], "secret": "coder" + }, + { + "clientId": "coder-public", + "publicClient": true, + "directAccessGrantsEnabled": true, + "enabled": true, + "fullScopeAllowed": true, + "baseUrl": "/coder", + "redirectUris": [ + "*" + ] } ] } @@ -79,6 +90,9 @@ hostname=$(hostname -f) export CODER_OIDC_ISSUER_URL="http://${hostname}:9080/realms/coder" export CODER_OIDC_CLIENT_ID=coder export CODER_OIDC_CLIENT_SECRET=coder +# Comment out the two lines above, and comment in the line below, +# to configure OIDC auth using a public client. +# export CODER_OIDC_CLIENT_ID=coder-public export CODER_DEV_ACCESS_URL="http://${hostname}:8080" exec "${SCRIPT_DIR}/develop.sh" "$@" From de70ff3206c0a6bb45e3d3eaea0c13534303d161 Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Fri, 7 Feb 2025 11:48:01 -0300 Subject: [PATCH 027/859] fix: display SVG emojis in the picker (#16492) Fix https://github.com/coder/coder/issues/16263 --- site/src/components/IconField/EmojiPicker.tsx | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/site/src/components/IconField/EmojiPicker.tsx b/site/src/components/IconField/EmojiPicker.tsx index 291a2dc357723..476e24f293756 100644 --- a/site/src/components/IconField/EmojiPicker.tsx +++ b/site/src/components/IconField/EmojiPicker.tsx @@ -1,6 +1,11 @@ import data from "@emoji-mart/data/sets/15/apple.json"; import EmojiMart from "@emoji-mart/react"; -import type { ComponentProps, FC } from "react"; +import { + type ComponentProps, + type FC, + useEffect, + useLayoutEffect, +} from "react"; import icons from "theme/icons.json"; const custom = [ @@ -26,6 +31,23 @@ type EmojiPickerProps = Omit< >; const EmojiPicker: FC = (props) => { + /** + * Workaround for a bug in the emoji-mart library where custom emoji images render improperly. + * Setting the image width to 100% ensures they display correctly. + * + * Issue: https://github.com/missive/emoji-mart/issues/805 + * Open PR: https://github.com/missive/emoji-mart/pull/806 + */ + useEffect(() => { + const picker = document.querySelector("em-emoji-picker")?.shadowRoot; + if (!picker) { + return; + } + const css = document.createElement("style"); + css.textContent = ".emoji-mart-emoji img { width: 100% }"; + picker.appendChild(css); + }, []); + return ( Date: Fri, 7 Feb 2025 10:49:49 -0500 Subject: [PATCH 028/859] docs: update licensing steps in faq (#16484)
this would be a good candidate for an expand component but I don't think they work in our docs yet
[preview](https://coder.com/docs/@licensing-faq/tutorials/faqs#how-do-i-add-a-premium-trial-license) --------- Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> --- docs/admin/licensing/index.md | 14 ++++++-- docs/tutorials/faqs.md | 61 +++++++++++++++++++++++++++-------- 2 files changed, 58 insertions(+), 17 deletions(-) diff --git a/docs/admin/licensing/index.md b/docs/admin/licensing/index.md index 94dd15f1dbda0..6d2abda948125 100644 --- a/docs/admin/licensing/index.md +++ b/docs/admin/licensing/index.md @@ -47,9 +47,17 @@ There are two ways to add a license to a Coder deployment: 1. Run `coder licenses add`: - ```shell - coder licenses add -f - ``` + - For a `.jwt` license file: + + ```shell + coder licenses add -f + ``` + + - For a text string: + + ```sh + coder licenses add -l 1f5...765 + ``` diff --git a/docs/tutorials/faqs.md b/docs/tutorials/faqs.md index 06cc76adbe9b1..184e6dedb2ee1 100644 --- a/docs/tutorials/faqs.md +++ b/docs/tutorials/faqs.md @@ -11,28 +11,61 @@ For other community resources, see our ## How do I add a Premium trial license? Visit or contact - [sales@coder.com](mailto:sales@coder.com?subject=License) to get a trial key. -You can add a license through the UI or CLI. +
-In the UI, click the Deployment tab -> Licenses and upload the `jwt` license -file. +You can add a license through the UI or CLI -> To add the license with the CLI, first -> [install the Coder CLI](../install/cli.md) and server to the latest release. + -If the license is a text string: +
-```sh -coder licenses add -l 1f5...765 -``` +### Coder UI -If the license is in a file: +1. With an `Owner` account, go to **Admin settings** > **Deployment**. -```sh -coder licenses add -f -``` +1. Select **Licenses** from the sidebar, then **Add a license**: + + ![Add a license from the licenses screen](../images/admin/licenses/licenses-nolicense.png) + +1. On the **Add a license** screen, drag your `.jwt` license file into the + **Upload Your License** section, or paste your license in the + **Paste Your License** text box, then select **Upload License**: + + ![Add a license screen](../images/admin/licenses/add-license-ui.png) + +### Coder CLI + +1. Ensure you have the [Coder CLI](../install/cli.md) installed. +1. Save your license key to disk and make note of the path. +1. Open a terminal. +1. Log in to your Coder deployment: + + ```shell + coder login + ``` + +1. Run `coder licenses add`: + + - For a `.jwt` license file: + + ```shell + coder licenses add -f + ``` + + - For a text string: + + ```sh + coder licenses add -l 1f5...765 + ``` + +
+ +
+ +Visit the [licensing documentation](../admin/licensing/index.md) for more +information about licenses. ## I'm experiencing networking issues, so want to disable Tailscale, STUN, Direct connections and force use of websocket From 8a3a79f527169a18dda945f467ea2fb379ae1e46 Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Fri, 7 Feb 2025 15:11:56 -0300 Subject: [PATCH 029/859] refactor: match StatusIndicator component with the new designs (#16458) Reference: https://www.figma.com/design/WfqIgsTFXN2BscBSSyXWF8/Coder-kit?node-id=489-4278&m=dev --- .../StatusIndicator.stories.tsx | 50 ++++---- .../StatusIndicator/StatusIndicator.tsx | 110 ++++++++++++++---- site/src/index.css | 18 ++- .../modules/provisioners/ProvisionerGroup.tsx | 4 +- .../pages/CreateTokenPage/CreateTokenForm.tsx | 1 + .../CreateTokenPage.stories.tsx | 6 - site/src/pages/UsersPage/UsersFilter.tsx | 11 +- site/src/pages/WorkspacesPage/LastUsed.tsx | 12 +- .../src/pages/WorkspacesPage/filter/menus.tsx | 33 +++++- site/tailwind.config.js | 8 +- 10 files changed, 177 insertions(+), 76 deletions(-) diff --git a/site/src/components/StatusIndicator/StatusIndicator.stories.tsx b/site/src/components/StatusIndicator/StatusIndicator.stories.tsx index f3da964dbd00f..f291089916060 100644 --- a/site/src/components/StatusIndicator/StatusIndicator.stories.tsx +++ b/site/src/components/StatusIndicator/StatusIndicator.stories.tsx @@ -1,10 +1,17 @@ import type { Meta, StoryObj } from "@storybook/react"; -import { StatusIndicator } from "./StatusIndicator"; +import { StatusIndicator, StatusIndicatorDot } from "./StatusIndicator"; const meta: Meta = { title: "components/StatusIndicator", component: StatusIndicator, - args: {}, + args: { + children: ( + <> + + Status + + ), + }, }; export default meta; @@ -12,52 +19,37 @@ type Story = StoryObj; export const Success: Story = { args: { - color: "success", - }, -}; - -export const SuccessOutline: Story = { - args: { - color: "success", - variant: "outlined", - }, -}; - -export const Warning: Story = { - args: { - color: "warning", + variant: "success", }, }; -export const WarningOutline: Story = { +export const Failed: Story = { args: { - color: "warning", - variant: "outlined", + variant: "failed", }, }; -export const Danger: Story = { +export const Inactive: Story = { args: { - color: "danger", + variant: "inactive", }, }; -export const DangerOutline: Story = { +export const Warning: Story = { args: { - color: "danger", - variant: "outlined", + variant: "warning", }, }; -export const Inactive: Story = { +export const Pending: Story = { args: { - color: "inactive", + variant: "pending", }, }; -export const InactiveOutline: Story = { +export const Small: Story = { args: { - color: "inactive", - variant: "outlined", + variant: "success", + size: "sm", }, }; diff --git a/site/src/components/StatusIndicator/StatusIndicator.tsx b/site/src/components/StatusIndicator/StatusIndicator.tsx index f69efe0d2d719..3ea9ca0dba7ac 100644 --- a/site/src/components/StatusIndicator/StatusIndicator.tsx +++ b/site/src/components/StatusIndicator/StatusIndicator.tsx @@ -1,33 +1,97 @@ -import { useTheme } from "@emotion/react"; -import type { FC } from "react"; -import type { ThemeRole } from "theme/roles"; +import { type VariantProps, cva } from "class-variance-authority"; +import { type FC, createContext, useContext } from "react"; +import { cn } from "utils/cn"; -interface StatusIndicatorProps { - color: ThemeRole; - variant?: "solid" | "outlined"; -} +const statusIndicatorVariants = cva( + "font-medium inline-flex items-center gap-2", + { + variants: { + variant: { + success: "text-content-success", + failed: "text-content-destructive", + inactive: "text-highlight-grey", + warning: "text-content-warning", + pending: "text-highlight-sky", + }, + size: { + sm: "text-xs", + md: "text-sm", + }, + }, + defaultVariants: { + variant: "success", + size: "md", + }, + }, +); + +type StatusIndicatorContextValue = VariantProps; + +const StatusIndicatorContext = createContext({}); + +export interface StatusIndicatorProps + extends React.HTMLAttributes, + StatusIndicatorContextValue {} export const StatusIndicator: FC = ({ - color, - variant = "solid", + size, + variant, + className, + ...props }) => { - const theme = useTheme(); + return ( + +
+ + ); +}; + +const dotVariants = cva("rounded-full inline-block border-4 border-solid", { + variants: { + variant: { + success: "bg-content-success border-surface-green", + failed: "bg-content-destructive border-surface-destructive", + inactive: "bg-highlight-grey border-surface-grey", + warning: "bg-content-warning border-surface-orange", + pending: "bg-highlight-sky border-surface-sky", + }, + size: { + sm: "size-3 border-4", + md: "size-4 border-4", + }, + }, + defaultVariants: { + variant: "success", + size: "md", + }, +}); + +export interface StatusIndicatorDotProps + extends React.HTMLAttributes, + VariantProps {} + +export const StatusIndicatorDot: FC = ({ + className, + // We allow the size and variant to be overridden directly by the component. + // This allows StatusIndicatorDot to be used alone. + size, + variant, + ...props +}) => { + const { size: ctxSize, variant: ctxVariant } = useContext( + StatusIndicatorContext, + ); return (
); }; diff --git a/site/src/index.css b/site/src/index.css index 29b424093963b..a5806bdc98a14 100644 --- a/site/src/index.css +++ b/site/src/index.css @@ -15,8 +15,8 @@ --content-invert: 0 0% 98%; --content-disabled: 240 5% 65%; --content-success: 142 72% 29%; - --content-danger: 0 84% 60%; --content-warning: 27 96% 61%; + --content-destructive: 0 84% 60%; --surface-primary: 0 0% 98%; --surface-secondary: 240 5% 96%; --surface-tertiary: 240 6% 90%; @@ -24,6 +24,10 @@ --surface-invert-primary: 240 4% 16%; --surface-invert-secondary: 240 5% 26%; --surface-destructive: 0 93% 94%; + --surface-green: 141 79% 85%; + --surface-grey: 240 5% 96%; + --surface-orange: 34 100% 92%; + --surface-sky: 201 94% 86%; --border-default: 240 6% 90%; --border-success: 142 76% 36%; --border-destructive: 0 84% 60%; @@ -31,6 +35,8 @@ --radius: 0.5rem; --highlight-purple: 262 83% 58%; --highlight-green: 143 64% 24%; + --highlight-grey: 240 5% 65%; + --highlight-sky: 201 90% 27%; --border: 240 5.9% 90%; --input: 240 5.9% 90%; --ring: 240 10% 3.9%; @@ -45,8 +51,8 @@ --content-invert: 240 10% 4%; --content-disabled: 240 5% 26%; --content-success: 142 76% 36%; - --content-danger: 0 91% 71%; - --content-warning: 27 96% 61%; + --content-warning: 31 97% 72%; + --content-destructive: 0 91% 71%; --surface-primary: 240 10% 4%; --surface-secondary: 240 6% 10%; --surface-tertiary: 240 4% 16%; @@ -54,12 +60,18 @@ --surface-invert-primary: 240 6% 90%; --surface-invert-secondary: 240 5% 65%; --surface-destructive: 0 75% 15%; + --surface-green: 145 80% 10%; + --surface-grey: 240 6% 10%; + --surface-orange: 13 81% 15%; + --surface-sky: 204 80% 16%; --border-default: 240 4% 16%; --border-success: 142 76% 36%; --border-destructive: 0 91% 71%; --overlay-default: 240 10% 4% / 80%; --highlight-purple: 252 95% 85%; --highlight-green: 141 79% 85%; + --highlight-grey: 240 4% 46%; + --highlight-sky: 198 93% 60%; --border: 240 3.7% 15.9%; --input: 240 3.7% 15.9%; --ring: 240 4.9% 83.9%; diff --git a/site/src/modules/provisioners/ProvisionerGroup.tsx b/site/src/modules/provisioners/ProvisionerGroup.tsx index 7bc652a5316f7..017c8f9a2b22c 100644 --- a/site/src/modules/provisioners/ProvisionerGroup.tsx +++ b/site/src/modules/provisioners/ProvisionerGroup.tsx @@ -16,7 +16,7 @@ import { } from "components/HelpTooltip/HelpTooltip"; import { Pill } from "components/Pill/Pill"; import { Stack } from "components/Stack/Stack"; -import { StatusIndicator } from "components/StatusIndicator/StatusIndicator"; +import { StatusIndicatorDot } from "components/StatusIndicator/StatusIndicator"; import { Popover, PopoverContent, @@ -127,7 +127,7 @@ export const ProvisionerGroup: FC = ({ }} >
- +
= ({ = { }, ], }, - decorators: [ - (Story) => { - Date.now = () => new Date("01/01/2014").getTime(); - return ; - }, - ], }; export default meta; diff --git a/site/src/pages/UsersPage/UsersFilter.tsx b/site/src/pages/UsersPage/UsersFilter.tsx index 5f600670dc044..2cf91023a04bc 100644 --- a/site/src/pages/UsersPage/UsersFilter.tsx +++ b/site/src/pages/UsersPage/UsersFilter.tsx @@ -7,7 +7,10 @@ import { type UseFilterMenuOptions, useFilterMenu, } from "components/Filter/menu"; -import { StatusIndicator } from "components/StatusIndicator/StatusIndicator"; +import { + StatusIndicator, + StatusIndicatorDot, +} from "components/StatusIndicator/StatusIndicator"; import type { FC } from "react"; import { docs } from "utils/docs"; @@ -24,17 +27,17 @@ export const useStatusFilterMenu = ({ { value: "active", label: "Active", - startIcon: , + startIcon: , }, { value: "dormant", label: "Dormant", - startIcon: , + startIcon: , }, { value: "suspended", label: "Suspended", - startIcon: , + startIcon: , }, ]; return useFilterMenu({ diff --git a/site/src/pages/WorkspacesPage/LastUsed.tsx b/site/src/pages/WorkspacesPage/LastUsed.tsx index 7de93efb005a6..a53ea5ed5ba01 100644 --- a/site/src/pages/WorkspacesPage/LastUsed.tsx +++ b/site/src/pages/WorkspacesPage/LastUsed.tsx @@ -1,6 +1,6 @@ import { useTheme } from "@emotion/react"; import { Stack } from "components/Stack/Stack"; -import { StatusIndicator } from "components/StatusIndicator/StatusIndicator"; +import { StatusIndicatorDot } from "components/StatusIndicator/StatusIndicator"; import dayjs from "dayjs"; import relativeTime from "dayjs/plugin/relativeTime"; import { useTime } from "hooks/useTime"; @@ -18,19 +18,19 @@ export const LastUsed: FC = ({ lastUsedAt }) => { const t = dayjs(lastUsedAt); const now = dayjs(); let message = t.fromNow(); - let circle = ; + let circle = ; if (t.isAfter(now.subtract(1, "hour"))) { - circle = ; + circle = ; // Since the agent reports on a 10m interval, // the last_used_at can be inaccurate when recent. message = "Now"; } else if (t.isAfter(now.subtract(3, "day"))) { - circle = ; + circle = ; } else if (t.isAfter(now.subtract(1, "month"))) { - circle = ; + circle = ; } else if (t.isAfter(now.subtract(100, "year"))) { - circle = ; + circle = ; } else { message = "Never"; } diff --git a/site/src/pages/WorkspacesPage/filter/menus.tsx b/site/src/pages/WorkspacesPage/filter/menus.tsx index 52e655914cec5..67892e44946c4 100644 --- a/site/src/pages/WorkspacesPage/filter/menus.tsx +++ b/site/src/pages/WorkspacesPage/filter/menus.tsx @@ -10,7 +10,11 @@ import { type UseFilterMenuOptions, useFilterMenu, } from "components/Filter/menu"; -import { StatusIndicator } from "components/StatusIndicator/StatusIndicator"; +import { + StatusIndicator, + StatusIndicatorDot, + type StatusIndicatorDotProps, +} from "components/StatusIndicator/StatusIndicator"; import type { FC } from "react"; import { getDisplayWorkspaceStatus } from "utils/workspace"; @@ -109,7 +113,9 @@ export const useStatusFilterMenu = ({ return { label: display.text, value: status, - startIcon: , + startIcon: ( + + ), }; }); return useFilterMenu({ @@ -141,3 +147,26 @@ export const StatusMenu: FC = ({ width, menu }) => { /> ); }; + +export const getStatusIndicatorVariant = ( + status: WorkspaceStatus, +): StatusIndicatorDotProps["variant"] => { + switch (status) { + case "running": + return "success"; + case "starting": + case "pending": + return "pending"; + case undefined: + case "canceling": + case "canceled": + case "stopping": + case "stopped": + return "inactive"; + case "deleting": + case "deleted": + return "warning"; + case "failed": + return "failed"; + } +}; diff --git a/site/tailwind.config.js b/site/tailwind.config.js index e47048a8b2512..2ce63449437d6 100644 --- a/site/tailwind.config.js +++ b/site/tailwind.config.js @@ -31,8 +31,8 @@ module.exports = { disabled: "hsl(var(--content-disabled))", invert: "hsl(var(--content-invert))", success: "hsl(var(--content-success))", - danger: "hsl(var(--content-danger))", link: "hsl(var(--content-link))", + destructive: "hsl(var(--content-destructive))", warning: "hsl(var(--content-warning))", }, surface: { @@ -45,6 +45,10 @@ module.exports = { secondary: "hsl(var(--surface-invert-secondary))", }, destructive: "hsl(var(--surface-destructive))", + green: "hsl(var(--surface-green))", + grey: "hsl(var(--surface-grey))", + orange: "hsl(var(--surface-orange))", + sky: "hsl(var(--surface-sky))", }, border: { DEFAULT: "hsl(var(--border-default))", @@ -56,6 +60,8 @@ module.exports = { highlight: { purple: "hsl(var(--highlight-purple))", green: "hsl(var(--highlight-green))", + grey: "hsl(var(--highlight-grey))", + sky: "hsl(var(--highlight-sky))", }, }, keyframes: { From 323559ba82c6057c0b78ac2d058ff035707e5e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B1=E3=82=A4=E3=83=A9?= Date: Fri, 7 Feb 2025 11:41:22 -0700 Subject: [PATCH 030/859] feat: show warning on unrecognized idp group and role mapping claims (#16485) --- site/src/api/api.ts | 2 +- .../IdpOrgSyncPageView.stories.tsx | 10 ++- .../IdpOrgSyncPage/IdpOrgSyncPageView.tsx | 3 +- .../IdpSyncPage/IdpGroupSyncForm.tsx | 71 +++++++++++++++---- .../IdpSyncPage/IdpRoleSyncForm.tsx | 66 +++++++++++++---- .../IdpSyncPage/IdpSyncPage.tsx | 20 +++++- .../IdpSyncPage/IdpSyncPageView.stories.tsx | 71 ++++++++++++------- .../IdpSyncPage/IdpSyncPageView.tsx | 9 ++- site/src/testHelpers/entities.ts | 4 +- 9 files changed, 191 insertions(+), 65 deletions(-) diff --git a/site/src/api/api.ts b/site/src/api/api.ts index 5a314ddde151a..43051961fa7e7 100644 --- a/site/src/api/api.ts +++ b/site/src/api/api.ts @@ -804,7 +804,7 @@ class ApiMethods { ) => { const params = new URLSearchParams(); params.set("claimField", field); - const response = await this.axios.get( + const response = await this.axios.get( `/api/v2/organizations/${organization}/settings/idpsync/field-values?${params}`, ); return response.data; diff --git a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx index 78842737e5baf..430fce3a2ee05 100644 --- a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx +++ b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.stories.tsx @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from "@storybook/react"; -import { userEvent, within } from "@storybook/test"; +import { expect, userEvent, within } from "@storybook/test"; import { MockOrganization, MockOrganization2, @@ -45,10 +45,16 @@ export const MissingGroups: Story = { }, }; -export const MissingClaim: Story = { +export const MissingClaims: Story = { args: { claimFieldValues: [], }, + play: async ({ canvasElement }) => { + const user = userEvent.setup(); + const warning = canvasElement.querySelector(".lucide-triangle-alert")!; + expect(warning).not.toBe(null); + await user.hover(warning); + }, }; export const AssignDefaultOrgWarningDialog: Story = { diff --git a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx index f6822ba0a60ef..bdcc65b89aaba 100644 --- a/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx +++ b/site/src/pages/DeploymentSettingsPage/IdpOrgSyncPage/IdpOrgSyncPageView.tsx @@ -1,4 +1,3 @@ -import { TooltipProvider } from "@radix-ui/react-tooltip"; import type { Organization, OrganizationSyncSettings, @@ -30,7 +29,6 @@ import { type Option, } from "components/MultiSelectCombobox/MultiSelectCombobox"; import { Spinner } from "components/Spinner/Spinner"; -import { Stack } from "components/Stack/Stack"; import { Switch } from "components/Switch/Switch"; import { Table, @@ -42,6 +40,7 @@ import { import { Tooltip, TooltipContent, + TooltipProvider, TooltipTrigger, } from "components/Tooltip/Tooltip"; import { useFormik } from "formik"; diff --git a/site/src/pages/OrganizationSettingsPage/IdpSyncPage/IdpGroupSyncForm.tsx b/site/src/pages/OrganizationSettingsPage/IdpSyncPage/IdpGroupSyncForm.tsx index 2f1c0be7fa602..9d63baf180fbc 100644 --- a/site/src/pages/OrganizationSettingsPage/IdpSyncPage/IdpGroupSyncForm.tsx +++ b/site/src/pages/OrganizationSettingsPage/IdpSyncPage/IdpGroupSyncForm.tsx @@ -22,8 +22,14 @@ import { } from "components/MultiSelectCombobox/MultiSelectCombobox"; import { Spinner } from "components/Spinner/Spinner"; import { Switch } from "components/Switch/Switch"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "components/Tooltip/Tooltip"; import { useFormik } from "formik"; -import { Plus, Trash } from "lucide-react"; +import { Plus, Trash, TriangleAlert } from "lucide-react"; import { type FC, useId, useState } from "react"; import { docs } from "utils/docs"; import { isUUID } from "utils/uuid"; @@ -32,16 +38,6 @@ import { ExportPolicyButton } from "./ExportPolicyButton"; import { IdpMappingTable } from "./IdpMappingTable"; import { IdpPillList } from "./IdpPillList"; -interface IdpGroupSyncFormProps { - groupSyncSettings: GroupSyncSettings; - groupsMap: Map; - groups: Group[]; - groupMappingCount: number; - legacyGroupMappingCount: number; - organization: Organization; - onSubmit: (data: GroupSyncSettings) => void; -} - const groupSyncValidationSchema = Yup.object({ field: Yup.string().trim(), regex_filter: Yup.string().trim(), @@ -65,15 +61,27 @@ const groupSyncValidationSchema = Yup.object({ .default({}), }); -export const IdpGroupSyncForm = ({ +interface IdpGroupSyncFormProps { + groupSyncSettings: GroupSyncSettings; + claimFieldValues: readonly string[] | undefined; + groupsMap: Map; + groups: Group[]; + groupMappingCount: number; + legacyGroupMappingCount: number; + organization: Organization; + onSubmit: (data: GroupSyncSettings) => void; +} + +export const IdpGroupSyncForm: FC = ({ groupSyncSettings, + claimFieldValues, groupMappingCount, legacyGroupMappingCount, groups, groupsMap, organization, onSubmit, -}: IdpGroupSyncFormProps) => { +}) => { const form = useFormik({ initialValues: { field: groupSyncSettings?.field ?? "", @@ -270,6 +278,7 @@ export const IdpGroupSyncForm = ({ @@ -288,6 +297,7 @@ export const IdpGroupSyncForm = ({ @@ -303,17 +313,48 @@ export const IdpGroupSyncForm = ({ interface GroupRowProps { idpGroup: string; + exists: boolean | undefined; coderGroup: readonly string[]; onDelete: (idpOrg: string) => void; } -const GroupRow: FC = ({ idpGroup, coderGroup, onDelete }) => { +const GroupRow: FC = ({ + idpGroup, + exists = true, + coderGroup, + onDelete, +}) => { return ( - {idpGroup} + +
+ {idpGroup} + {!exists && ( + + + + + + + This value has not be seen in the specified claim field + before. You might want to check your IdP configuration and + ensure that this value is not misspelled. + + + + )} +
+
+ +
); @@ -190,7 +186,7 @@ const AddOrganizationMember: FC = ({ > { setSelectedUser(newValue); @@ -210,17 +206,3 @@ const AddOrganizationMember: FC = ({ ); }; - -const styles = { - role: (theme) => ({ - backgroundColor: theme.roles.notice.background, - borderColor: theme.roles.notice.outline, - }), - globalRole: (theme) => ({ - backgroundColor: theme.roles.inactive.background, - borderColor: theme.roles.inactive.outline, - }), - autoComplete: { - width: 300, - }, -} satisfies Record>; diff --git a/site/src/pages/OrganizationSettingsPage/UserTable/UserRoleCell.tsx b/site/src/pages/OrganizationSettingsPage/UserTable/UserRoleCell.tsx index 88f66af485960..4c350f6ffb5be 100644 --- a/site/src/pages/OrganizationSettingsPage/UserTable/UserRoleCell.tsx +++ b/site/src/pages/OrganizationSettingsPage/UserTable/UserRoleCell.tsx @@ -14,11 +14,10 @@ * users like that, though, know that it will be painful */ import { type Interpolation, type Theme, useTheme } from "@emotion/react"; -import Stack from "@mui/material/Stack"; -import TableCell from "@mui/material/TableCell"; import Tooltip from "@mui/material/Tooltip"; import type { LoginType, SlimRole } from "api/typesGenerated"; import { Pill } from "components/Pill/Pill"; +import { TableCell } from "components/Table/Table"; import { Popover, PopoverContent, @@ -59,7 +58,7 @@ export const UserRoleCell: FC = ({ return ( - +
{canEditUsers && ( = ({ {extraRoles.length > 0 && } - +
); }; diff --git a/site/src/pages/UsersPage/UsersTable/UserGroupsCell.tsx b/site/src/pages/UsersPage/UsersTable/UserGroupsCell.tsx index 00f135abb2bdc..c7c4586c0ec51 100644 --- a/site/src/pages/UsersPage/UsersTable/UserGroupsCell.tsx +++ b/site/src/pages/UsersPage/UsersTable/UserGroupsCell.tsx @@ -2,11 +2,10 @@ import { useTheme } from "@emotion/react"; import GroupIcon from "@mui/icons-material/Group"; import List from "@mui/material/List"; import ListItem from "@mui/material/ListItem"; -import TableCell from "@mui/material/TableCell"; import type { Group } from "api/typesGenerated"; import { Avatar } from "components/Avatar/Avatar"; import { OverflowY } from "components/OverflowY/OverflowY"; -import { Stack } from "components/Stack/Stack"; +import { TableCell } from "components/Table/Table"; import { Popover, PopoverContent, @@ -40,12 +39,9 @@ export const UserGroupsCell: FC = ({ userGroups }) => { color: "inherit", lineHeight: "1", }} + type="button" > - +
= ({ userGroups }) => { {userGroups.length} Group{userGroups.length !== 1 && "s"} - +
From d52d2397ea2c2fdb8636b966e3f45a0e26b7529d Mon Sep 17 00:00:00 2001 From: Jullian Pepito Date: Wed, 12 Feb 2025 13:16:42 -0800 Subject: [PATCH 058/859] docs: fix link to CODER_QUIET_HOURS_DEFAULT_SCHEDULE in schedule doc (#16545) Corrects incorrect reference to env variable `CODER_DEFAULT_QUIET_HOURS_SCHEDULE`. Changes to `CODER_QUIET_HOURS_DEFAULT_SCHEDULE`. Also hyperlinks to the server flag (similar to `CODER_ALLOW_CUSTOM_QUIET_HOURS`) --- docs/admin/templates/managing-templates/schedule.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/templates/managing-templates/schedule.md b/docs/admin/templates/managing-templates/schedule.md index 89185f7fa7df7..584bd025d5aa2 100644 --- a/docs/admin/templates/managing-templates/schedule.md +++ b/docs/admin/templates/managing-templates/schedule.md @@ -122,7 +122,7 @@ stopped due to the policy at the start of the user's quiet hours. ![User schedule settings](../../../images/admin/templates/schedule/user-quiet-hours.png) Admins can define the default quiet hours for all users with the -`--default-quiet-hours-schedule` flag or `CODER_DEFAULT_QUIET_HOURS_SCHEDULE` +[CODER_QUIET_HOURS_DEFAULT_SCHEDULE](../../../reference/cli/server.md#--default-quiet-hours-schedule) environment variable. The value should be a cron expression such as `CRON_TZ=America/Chicago 30 2 * * *` which would set the default quiet hours to 2:30 AM in the America/Chicago timezone. The cron schedule can only have a From 981cf8c33354372dc369cac0f2cd8b2b7beefe38 Mon Sep 17 00:00:00 2001 From: Yevhenii Shcherbina Date: Thu, 13 Feb 2025 10:13:20 -0500 Subject: [PATCH 059/859] fix: display the correct response for coder list (#16547) Closes https://github.com/coder/coder/issues/16312 We intend to modify the behavior of the CLI handler based on the specified output format. However, the output format is currently only accessible within the `OutputFormatter` structure. Therefore, I propose extending `OutputFormatter` by introducing a public `FormatID` method, which will allow us to retrieve the format identifier and use it to customize the behavior of the CLI handler accordingly. --- cli/cliui/output.go | 6 ++++++ cli/list.go | 2 +- cli/list_test.go | 26 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/cli/cliui/output.go b/cli/cliui/output.go index b875e19d154c3..65f6171c2c962 100644 --- a/cli/cliui/output.go +++ b/cli/cliui/output.go @@ -83,6 +83,12 @@ func (f *OutputFormatter) Format(ctx context.Context, data any) (string, error) return "", xerrors.Errorf("unknown output format %q", f.formatID) } +// FormatID will return the ID of the format selected by `--output`. +// If no flag is present, it returns the 'default' formatter. +func (f *OutputFormatter) FormatID() string { + return f.formatID +} + type tableFormat struct { defaultColumns []string allColumns []string diff --git a/cli/list.go b/cli/list.go index 1a578c887371b..083d32c6e8fa1 100644 --- a/cli/list.go +++ b/cli/list.go @@ -112,7 +112,7 @@ func (r *RootCmd) list() *serpent.Command { return err } - if len(res) == 0 { + if len(res) == 0 && formatter.FormatID() != cliui.JSONFormat().ID() { pretty.Fprintf(inv.Stderr, cliui.DefaultStyles.Prompt, "No workspaces found! Create one:\n") _, _ = fmt.Fprintln(inv.Stderr) _, _ = fmt.Fprintln(inv.Stderr, " "+pretty.Sprint(cliui.DefaultStyles.Code, "coder create ")) diff --git a/cli/list_test.go b/cli/list_test.go index 37f2f36f79278..a70c70babf437 100644 --- a/cli/list_test.go +++ b/cli/list_test.go @@ -74,4 +74,30 @@ func TestList(t *testing.T) { require.NoError(t, json.Unmarshal(out.Bytes(), &workspaces)) require.Len(t, workspaces, 1) }) + + t.Run("NoWorkspacesJSON", func(t *testing.T) { + t.Parallel() + client := coderdtest.New(t, nil) + owner := coderdtest.CreateFirstUser(t, client) + member, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID) + + inv, root := clitest.New(t, "list", "--output=json") + clitest.SetupConfig(t, member, root) + + ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitLong) + defer cancelFunc() + + stdout := bytes.NewBuffer(nil) + stderr := bytes.NewBuffer(nil) + inv.Stdout = stdout + inv.Stderr = stderr + err := inv.WithContext(ctx).Run() + require.NoError(t, err) + + var workspaces []codersdk.Workspace + require.NoError(t, json.Unmarshal(stdout.Bytes(), &workspaces)) + require.Len(t, workspaces, 0) + + require.Len(t, stderr.Bytes(), 0) + }) } From ade0a53ddbc7144390fdd505653789bff2b0e9c1 Mon Sep 17 00:00:00 2001 From: Edward Angert Date: Thu, 13 Feb 2025 10:35:05 -0500 Subject: [PATCH 060/859] docs: add markdown fields in webhook payloads (#16542) These changes were made in #14931 but didn't make it into the restructured docs Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> --- docs/admin/monitoring/notifications/slack.md | 14 +++++++------- docs/admin/monitoring/notifications/teams.md | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/admin/monitoring/notifications/slack.md b/docs/admin/monitoring/notifications/slack.md index e7cad847faad4..4b9810d9fbe86 100644 --- a/docs/admin/monitoring/notifications/slack.md +++ b/docs/admin/monitoring/notifications/slack.md @@ -89,11 +89,11 @@ To build the server to receive webhooks and interact with Slack: return res.status(400).send("Error: request body is missing"); } - const { title, body } = req.body; - if (!title || !body) { - return res - .status(400) - .send('Error: missing fields: "title", or "body"'); + const { title_markdown, body_markdown } = req.body; + if (!title_markdown || !body_markdown) { + return res + .status(400) + .send('Error: missing fields: "title_markdown", or "body_markdown"'); } const payload = req.body.payload; @@ -119,11 +119,11 @@ To build the server to receive webhooks and interact with Slack: blocks: [ { type: "header", - text: { type: "plain_text", text: title }, + text: { type: "mrkdwn", text: title_markdown }, }, { type: "section", - text: { type: "mrkdwn", text: body }, + text: { type: "mrkdwn", text: body_markdown }, }, ], }; diff --git a/docs/admin/monitoring/notifications/teams.md b/docs/admin/monitoring/notifications/teams.md index 0b874a997c54a..477ebcb714603 100644 --- a/docs/admin/monitoring/notifications/teams.md +++ b/docs/admin/monitoring/notifications/teams.md @@ -67,10 +67,10 @@ The process of setting up a Teams workflow consists of three key steps: } } }, - "title": { + "title_markdown": { "type": "string" }, - "body": { + "body_markdown": { "type": "string" } } @@ -108,11 +108,11 @@ The process of setting up a Teams workflow consists of three key steps: }, { "type": "TextBlock", - "text": "**@{replace(body('Parse_JSON')?['title'], '"', '\"')}**" + "text": "**@{replace(body('Parse_JSON')?['title_markdown'], '"', '\"')}**" }, { "type": "TextBlock", - "text": "@{replace(body('Parse_JSON')?['body'], '"', '\"')}", + "text": "@{replace(body('Parse_JSON')?['body_markdown'], '"', '\"')}", "wrap": true }, { From e38bd27183c300e65634d1c5ae915050ea10c057 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 13 Feb 2025 18:24:27 +0200 Subject: [PATCH 061/859] feat(coderd): add support for provisioner job id and tag filter (#16556) This change adds to new filters to the provisionerjobs endpoint, id (array) and tags (map). Updates #15084 Updates #15192 Related #16532 --- coderd/apidoc/docs.go | 16 ++++++++++++++ coderd/apidoc/swagger.json | 16 ++++++++++++++ coderd/database/dbmem/dbmem.go | 3 +++ coderd/database/queries.sql.go | 5 ++++- coderd/database/queries/provisionerjobs.sql | 1 + coderd/provisionerjobs.go | 18 ++++++++++++++++ coderd/provisionerjobs_test.go | 24 ++++++++++++++++++++- codersdk/organizations.go | 20 +++++++++++++++++ docs/reference/api/organizations.md | 12 ++++++----- site/src/api/typesGenerated.ts | 2 ++ 10 files changed, 110 insertions(+), 7 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 2e48634c7de13..6f09a0482dbd1 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -3055,6 +3055,16 @@ const docTemplate = `{ "name": "limit", "in": "query" }, + { + "type": "array", + "format": "uuid", + "items": { + "type": "string" + }, + "description": "Filter results by job IDs", + "name": "ids", + "in": "query" + }, { "enum": [ "pending", @@ -3075,6 +3085,12 @@ const docTemplate = `{ "description": "Filter results by status", "name": "status", "in": "query" + }, + { + "type": "object", + "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", + "name": "tags", + "in": "query" } ], "responses": { diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 0e03555da4720..db682394ca04a 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -2683,6 +2683,16 @@ "name": "limit", "in": "query" }, + { + "type": "array", + "format": "uuid", + "items": { + "type": "string" + }, + "description": "Filter results by job IDs", + "name": "ids", + "in": "query" + }, { "enum": [ "pending", @@ -2703,6 +2713,12 @@ "description": "Filter results by status", "name": "status", "in": "query" + }, + { + "type": "object", + "description": "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})", + "name": "tags", + "in": "query" } ], "responses": { diff --git a/coderd/database/dbmem/dbmem.go b/coderd/database/dbmem/dbmem.go index 21c40233718ef..780a180f1ff35 100644 --- a/coderd/database/dbmem/dbmem.go +++ b/coderd/database/dbmem/dbmem.go @@ -4170,6 +4170,9 @@ func (q *FakeQuerier) GetProvisionerJobsByOrganizationAndStatusWithQueuePosition if len(arg.IDs) > 0 && !slices.Contains(arg.IDs, job.ID) { continue } + if len(arg.Tags) > 0 && !tagsSubset(job.Tags, arg.Tags) { + continue + } row := database.GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow{ ProvisionerJob: rowQP.ProvisionerJob, diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 2d7fe83296deb..d8c2b3a77dacf 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -6472,6 +6472,7 @@ WHERE ($1::uuid IS NULL OR pj.organization_id = $1) AND (COALESCE(array_length($2::uuid[], 1), 0) = 0 OR pj.id = ANY($2::uuid[])) AND (COALESCE(array_length($3::provisioner_job_status[], 1), 0) = 0 OR pj.job_status = ANY($3::provisioner_job_status[])) + AND ($4::tagset = 'null'::tagset OR provisioner_tagset_contains(pj.tags::tagset, $4::tagset)) GROUP BY pj.id, qp.queue_position, @@ -6486,13 +6487,14 @@ GROUP BY ORDER BY pj.created_at DESC LIMIT - $4::int + $5::int ` type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams struct { OrganizationID uuid.NullUUID `db:"organization_id" json:"organization_id"` IDs []uuid.UUID `db:"ids" json:"ids"` Status []ProvisionerJobStatus `db:"status" json:"status"` + Tags StringMap `db:"tags" json:"tags"` Limit sql.NullInt32 `db:"limit" json:"limit"` } @@ -6515,6 +6517,7 @@ func (q *sqlQuerier) GetProvisionerJobsByOrganizationAndStatusWithQueuePositionA arg.OrganizationID, pq.Array(arg.IDs), pq.Array(arg.Status), + arg.Tags, arg.Limit, ) if err != nil { diff --git a/coderd/database/queries/provisionerjobs.sql b/coderd/database/queries/provisionerjobs.sql index fedcc630a1687..9888fb11dfc3b 100644 --- a/coderd/database/queries/provisionerjobs.sql +++ b/coderd/database/queries/provisionerjobs.sql @@ -158,6 +158,7 @@ WHERE (sqlc.narg('organization_id')::uuid IS NULL OR pj.organization_id = @organization_id) AND (COALESCE(array_length(@ids::uuid[], 1), 0) = 0 OR pj.id = ANY(@ids::uuid[])) AND (COALESCE(array_length(@status::provisioner_job_status[], 1), 0) = 0 OR pj.job_status = ANY(@status::provisioner_job_status[])) + AND (@tags::tagset = 'null'::tagset OR provisioner_tagset_contains(pj.tags::tagset, @tags::tagset)) GROUP BY pj.id, qp.queue_position, diff --git a/coderd/provisionerjobs.go b/coderd/provisionerjobs.go index 492aa50eeb7f9..b12187e682efa 100644 --- a/coderd/provisionerjobs.go +++ b/coderd/provisionerjobs.go @@ -72,7 +72,9 @@ func (api *API) provisionerJob(rw http.ResponseWriter, r *http.Request) { // @Tags Organizations // @Param organization path string true "Organization ID" format(uuid) // @Param limit query int false "Page limit" +// @Param ids query []string false "Filter results by job IDs" format(uuid) // @Param status query codersdk.ProvisionerJobStatus false "Filter results by status" enums(pending,running,succeeded,canceling,canceled,failed) +// @Param tags query object false "Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'})" // @Success 200 {array} codersdk.ProvisionerJob // @Router /organizations/{organization}/provisionerjobs [get] func (api *API) provisionerJobs(rw http.ResponseWriter, r *http.Request) { @@ -103,6 +105,10 @@ func (api *API) handleAuthAndFetchProvisionerJobs(rw http.ResponseWriter, r *htt p := httpapi.NewQueryParamParser() limit := p.PositiveInt32(qp, 50, "limit") status := p.Strings(qp, nil, "status") + if ids == nil { + ids = p.UUIDs(qp, nil, "ids") + } + tagsRaw := p.String(qp, "", "tags") p.ErrorExcessParams(qp) if len(p.Errors) > 0 { httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{ @@ -112,11 +118,23 @@ func (api *API) handleAuthAndFetchProvisionerJobs(rw http.ResponseWriter, r *htt return nil, false } + tags := database.StringMap{} + if tagsRaw != "" { + if err := tags.Scan([]byte(tagsRaw)); err != nil { + httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{ + Message: "Invalid tags query parameter", + Detail: err.Error(), + }) + return nil, false + } + } + jobs, err := api.Database.GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisioner(ctx, database.GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams{ OrganizationID: uuid.NullUUID{UUID: org.ID, Valid: true}, Status: slice.StringEnums[database.ProvisionerJobStatus](status), Limit: sql.NullInt32{Int32: limit, Valid: limit > 0}, IDs: ids, + Tags: tags, }) if err != nil { if httpapi.Is404Error(err) { diff --git a/coderd/provisionerjobs_test.go b/coderd/provisionerjobs_test.go index 1c832d6825c6f..6ec8959102fa5 100644 --- a/coderd/provisionerjobs_test.go +++ b/coderd/provisionerjobs_test.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "encoding/json" + "strconv" "testing" "time" @@ -65,9 +66,10 @@ func TestProvisionerJobs(t *testing.T) { }) // Add more jobs than the default limit. - for range 60 { + for i := range 60 { dbgen.ProvisionerJob(t, db, nil, database.ProvisionerJob{ OrganizationID: owner.OrganizationID, + Tags: database.StringMap{"count": strconv.Itoa(i)}, }) } @@ -132,6 +134,16 @@ func TestProvisionerJobs(t *testing.T) { require.Len(t, jobs, 50) }) + t.Run("IDs", func(t *testing.T) { + t.Parallel() + ctx := testutil.Context(t, testutil.WaitMedium) + jobs, err := templateAdminClient.OrganizationProvisionerJobs(ctx, owner.OrganizationID, &codersdk.OrganizationProvisionerJobsOptions{ + IDs: []uuid.UUID{workspace.LatestBuild.Job.ID, version.Job.ID}, + }) + require.NoError(t, err) + require.Len(t, jobs, 2) + }) + t.Run("Status", func(t *testing.T) { t.Parallel() ctx := testutil.Context(t, testutil.WaitMedium) @@ -142,6 +154,16 @@ func TestProvisionerJobs(t *testing.T) { require.Len(t, jobs, 1) }) + t.Run("Tags", func(t *testing.T) { + t.Parallel() + ctx := testutil.Context(t, testutil.WaitMedium) + jobs, err := templateAdminClient.OrganizationProvisionerJobs(ctx, owner.OrganizationID, &codersdk.OrganizationProvisionerJobsOptions{ + Tags: map[string]string{"count": "1"}, + }) + require.NoError(t, err) + require.Len(t, jobs, 1) + }) + t.Run("Limit", func(t *testing.T) { t.Parallel() ctx := testutil.Context(t, testutil.WaitMedium) diff --git a/codersdk/organizations.go b/codersdk/organizations.go index a6bacd2798043..98afd98feda2a 100644 --- a/codersdk/organizations.go +++ b/codersdk/organizations.go @@ -346,7 +346,9 @@ func (c *Client) OrganizationProvisionerDaemons(ctx context.Context, organizatio type OrganizationProvisionerJobsOptions struct { Limit int + IDs []uuid.UUID Status []ProvisionerJobStatus + Tags map[string]string } func (c *Client) OrganizationProvisionerJobs(ctx context.Context, organizationID uuid.UUID, opts *OrganizationProvisionerJobsOptions) ([]ProvisionerJob, error) { @@ -355,9 +357,19 @@ func (c *Client) OrganizationProvisionerJobs(ctx context.Context, organizationID if opts.Limit > 0 { qp.Add("limit", strconv.Itoa(opts.Limit)) } + if len(opts.IDs) > 0 { + qp.Add("ids", joinSliceStringer(opts.IDs)) + } if len(opts.Status) > 0 { qp.Add("status", joinSlice(opts.Status)) } + if len(opts.Tags) > 0 { + tagsRaw, err := json.Marshal(opts.Tags) + if err != nil { + return nil, xerrors.Errorf("marshal tags: %w", err) + } + qp.Add("tags", string(tagsRaw)) + } } res, err := c.Request(ctx, http.MethodGet, @@ -401,6 +413,14 @@ func joinSlice[T ~string](s []T) string { return strings.Join(ss, ",") } +func joinSliceStringer[T fmt.Stringer](s []T) string { + var ss []string + for _, v := range s { + ss = append(ss, v.String()) + } + return strings.Join(ss, ",") +} + // CreateTemplateVersion processes source-code and optionally associates the version with a template. // Executing without a template is useful for validating source-code. func (c *Client) CreateTemplateVersion(ctx context.Context, organizationID uuid.UUID, req CreateTemplateVersionRequest) (TemplateVersion, error) { diff --git a/docs/reference/api/organizations.md b/docs/reference/api/organizations.md index 08fceb2e29d82..8c49f33e31ce3 100644 --- a/docs/reference/api/organizations.md +++ b/docs/reference/api/organizations.md @@ -359,11 +359,13 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi ### Parameters -| Name | In | Type | Required | Description | -|----------------|-------|--------------|----------|--------------------------| -| `organization` | path | string(uuid) | true | Organization ID | -| `limit` | query | integer | false | Page limit | -| `status` | query | string | false | Filter results by status | +| Name | In | Type | Required | Description | +|----------------|-------|--------------|----------|------------------------------------------------------------------------------------| +| `organization` | path | string(uuid) | true | Organization ID | +| `limit` | query | integer | false | Page limit | +| `ids` | query | array(uuid) | false | Filter results by job IDs | +| `status` | query | string | false | Filter results by status | +| `tags` | query | object | false | Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'}) | #### Enumerated Values diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index 09541c9767b89..50b45ccd4d22f 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -1438,7 +1438,9 @@ export interface OrganizationMemberWithUserData extends OrganizationMember { // From codersdk/organizations.go export interface OrganizationProvisionerJobsOptions { readonly Limit: number; + readonly IDs: readonly string[]; readonly Status: readonly ProvisionerJobStatus[]; + readonly Tags: Record; } // From codersdk/idpsync.go From 00e76b881fd7a37d15151c547be2359e520f32f5 Mon Sep 17 00:00:00 2001 From: Jaayden Halko Date: Thu, 13 Feb 2025 19:45:38 +0000 Subject: [PATCH 062/859] chore: migrate to tailwind (#16543) Moving styles to Tailwind --- .../UserTable/EditRolesButton.tsx | 120 ++++-------------- 1 file changed, 24 insertions(+), 96 deletions(-) diff --git a/site/src/pages/OrganizationSettingsPage/UserTable/EditRolesButton.tsx b/site/src/pages/OrganizationSettingsPage/UserTable/EditRolesButton.tsx index d7d3c100acd73..64e059b4134f6 100644 --- a/site/src/pages/OrganizationSettingsPage/UserTable/EditRolesButton.tsx +++ b/site/src/pages/OrganizationSettingsPage/UserTable/EditRolesButton.tsx @@ -1,9 +1,8 @@ -import type { Interpolation, Theme } from "@emotion/react"; import UserIcon from "@mui/icons-material/PersonOutline"; import Checkbox from "@mui/material/Checkbox"; -import IconButton from "@mui/material/IconButton"; import Tooltip from "@mui/material/Tooltip"; import type { SlimRole } from "api/typesGenerated"; +import { Button } from "components/Button/Button"; import { HelpTooltip, HelpTooltipContent, @@ -12,13 +11,11 @@ import { HelpTooltipTrigger, } from "components/HelpTooltip/HelpTooltip"; import { EditSquare } from "components/Icons/EditSquare"; -import { Stack } from "components/Stack/Stack"; import { Popover, PopoverContent, PopoverTrigger, } from "components/deprecated/Popover/Popover"; -import { type ClassName, useClassName } from "hooks/useClassName"; import type { FC } from "react"; const roleDescriptions: Record = { @@ -47,23 +44,23 @@ const Option: FC = ({ onChange, }) => { return ( -