From 1e2cfc0575d12e4ec760c8746c9c0643e18fddff Mon Sep 17 00:00:00 2001 From: Nick Marais Date: Thu, 18 Dec 2025 16:43:35 +0000 Subject: [PATCH 1/3] Fix branch input placeholder text --- .../src/Bots/Add/GitHubActionsK8s/ConnectGitHub.test.tsx | 8 ++++++-- .../src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.test.tsx b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.test.tsx index d34c325a00b81..00778e8db8726 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.test.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.test.tsx @@ -89,7 +89,9 @@ describe('ConnectGitHub', () => { screen.getByPlaceholderText('https://github.com/gravitational/teleport') ).toHaveValue('https://github.com/gravitational/teleport'); - expect(screen.getByPlaceholderText('main')).toHaveValue('main'); + expect(screen.getAllByPlaceholderText('refs/heads/main')[0]).toHaveValue( + 'main' + ); expect(screen.getByPlaceholderText('my-workflow')).toHaveValue( 'my-workflow' @@ -97,7 +99,9 @@ describe('ConnectGitHub', () => { expect(screen.getByPlaceholderText('production')).toHaveValue('production'); - expect(screen.getByPlaceholderText('ref/heads/main')).toHaveValue('main'); + expect(screen.getAllByPlaceholderText('refs/heads/main')[1]).toHaveValue( + 'main' + ); expect(screen.getByPlaceholderText('octo-enterprise')).toHaveValue( 'octo-enterprise' diff --git a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx index 142e75d2397cd..77f1bcf1bad7e 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx @@ -120,7 +120,7 @@ export function ConnectGitHub(props: FlowStepProps) { } disabled={state.isBranchDisabled} label="Branch" - placeholder="main" + placeholder="refs/heads/main" value={state.branch} onChange={e => { dispatch({ @@ -210,7 +210,7 @@ export function ConnectGitHub(props: FlowStepProps) { { dispatch({ From 237c20814feb9bed494bfb19dd3f14f47387218c Mon Sep 17 00:00:00 2001 From: Nick Marais Date: Thu, 18 Dec 2025 16:44:57 +0000 Subject: [PATCH 2/3] Fix GHA workflow env syntax --- .../src/Bots/Add/GitHubActionsK8s/templates.ts | 17 +++++++---------- .../GitHubActionsK8s/useGitHubK8sFlow.test.tsx | 3 --- .../Add/GitHubActionsK8s/useGitHubK8sFlow.tsx | 1 - 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/templates.ts b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/templates.ts index fe6044dcdc3ad..2afcec2401d11 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/templates.ts +++ b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/templates.ts @@ -19,14 +19,11 @@ export function makeGhaWorkflow(params: { tokenName: string; clusterPublicUrl: string; - toolsVersion: string; }) { return GHA_WORKFLOW.replaceAll( ':token_name', JSON.stringify(params.tokenName) - ) - .replaceAll(':cluster_public_url', JSON.stringify(params.clusterPublicUrl)) - .replaceAll(':tools_version', JSON.stringify(params.toolsVersion)); + ).replaceAll(':cluster_public_url', JSON.stringify(params.clusterPublicUrl)); } export const GHA_WORKFLOW = `# This file contains a GitHub Actions workflow which enrolls with Teleport in @@ -43,7 +40,6 @@ export const GHA_WORKFLOW = `# This file contains a GitHub Actions workflow whic on: workflow_dispatch env: - TELEPORT_TOOLS_VERSION: :tools_version TELEPORT_PROXY_ADDR: :cluster_public_url TELEPORT_JOIN_TOKEN_NAME: :token_name @@ -67,14 +63,15 @@ jobs: - name: Fetch Teleport binaries uses: teleport-actions/setup@v1 with: - version: $TELEPORT_TOOLS_VERSION + version: auto + proxy: \${{ env.TELEPORT_PROXY_ADDR }} - name: Fetch credentials using Machine & Workload Identity uses: teleport-actions/auth-k8s@v2 with: - proxy: $TELEPORT_PROXY_ADDR - token: $TELEPORT_JOIN_TOKEN_NAME - kubernetes-cluster: $TELEPORT_K8S_CLUSTER_NAME + proxy: \${{ env.TELEPORT_PROXY_ADDR }} + token: \${{ env.TELEPORT_JOIN_TOKEN_NAME }} + kubernetes-cluster: \${{ env.TELEPORT_K8S_CLUSTER_NAME }} # Enable the submission of anonymous usage telemetry. This helps us # shape the future development of \`tbot\`. You can disable this by # omitting this. @@ -83,5 +80,5 @@ jobs: # Use kubectl or other compatible tools to interact with your Kubernetes # cluster. - name: List pods - run: kubectl get pods -A + run: kubectl version `; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/useGitHubK8sFlow.test.tsx b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/useGitHubK8sFlow.test.tsx index 3288713f88fe5..3eb6c9fb91728 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/useGitHubK8sFlow.test.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/useGitHubK8sFlow.test.tsx @@ -74,9 +74,6 @@ describe('useGitHubK8sFlow', () => { 'mock terraform template' ); - expect(result.current.template.ghaWorkflow).toContain( - 'TELEPORT_TOOLS_VERSION: "4.4.0-dev"' - ); expect(result.current.template.ghaWorkflow).toContain( 'TELEPORT_PROXY_ADDR: "some-long-cluster-public-url-name.cloud.teleport.gravitational.io:1234"' ); diff --git a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/useGitHubK8sFlow.tsx b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/useGitHubK8sFlow.tsx index 900f68ccd1c3b..efb17ee8e19f7 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/useGitHubK8sFlow.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/useGitHubK8sFlow.tsx @@ -152,7 +152,6 @@ export function GitHubK8sFlowProvider( ghaWorkflow: makeGhaWorkflow({ tokenName: `gha-${state.info?.owner ?? 'gravitational'}-${state.info?.repository ?? 'teleport'}`, clusterPublicUrl: cluster.publicURL, - toolsVersion: cluster.authVersion, }), }, }; From 90ed1b353a91255e98e8715f0b04c26a230df922 Mon Sep 17 00:00:00 2001 From: Nick Marais Date: Thu, 18 Dec 2025 17:01:28 +0000 Subject: [PATCH 3/3] Layout: distribute content and code panels 40/60 --- .../src/Bots/Add/GitHubActionsK8s/ConfigureAccess.tsx | 4 ++-- .../src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx | 4 ++-- .../teleport/src/Bots/Add/GitHubActionsK8s/Finish.tsx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConfigureAccess.tsx b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConfigureAccess.tsx index 84e2be6650c5c..caa16802f7f5f 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConfigureAccess.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConfigureAccess.tsx @@ -229,14 +229,14 @@ const Container = styled(Flex)` `; const FormContainer = styled(Flex)` - flex: 1; + flex: 4; flex-direction: column; overflow: auto; padding-right: ${({ theme }) => theme.space[5]}px; `; const CodeContainer = styled(Flex)` - flex: 1; + flex: 6; flex-direction: column; overflow: auto; `; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx index 77f1bcf1bad7e..7c73b6624c753 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/ConnectGitHub.tsx @@ -346,14 +346,14 @@ const Container = styled(Flex)` `; const FormContainer = styled(Flex)` - flex: 1; + flex: 4; flex-direction: column; overflow: auto; padding-right: ${({ theme }) => theme.space[5]}px; `; const CodeContainer = styled(Flex)` - flex: 1; + flex: 6; flex-direction: column; overflow: auto; `; diff --git a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/Finish.tsx b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/Finish.tsx index aac72ba6371dc..d62f0016998f8 100644 --- a/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/Finish.tsx +++ b/web/packages/teleport/src/Bots/Add/GitHubActionsK8s/Finish.tsx @@ -63,7 +63,7 @@ export function Finish(props: FlowStepProps) { return ( - +

Setup Workflow

@@ -157,11 +157,11 @@ export function Finish(props: FlowStepProps) { const Container = styled(Flex)` flex: 1; overflow: auto; - gap: ${({ theme }) => theme.space[3]}px; + gap: ${({ theme }) => theme.space[5]}px; `; const CodeContainer = styled(Flex)` - flex: 1; + flex: 6; flex-direction: column; overflow: auto; `;