-
Notifications
You must be signed in to change notification settings - Fork 82
refactor env editor #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
GO_VERSION: "1.24.3" | ||
NODE_VERSION: "20" | ||
|
||
jobs: | ||
ci: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 10 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: "pnpm" | ||
cache-dependency-path: ui/pnpm-lock.yaml | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
cache: true | ||
|
||
- name: Install deps | ||
run: make deps | ||
- name: Build | ||
run: make build | ||
- name: lint | ||
run: make pre-commit | ||
- name: Test | ||
run: ./kite -h |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
|
||
# Variables | ||
BINARY_NAME=kite | ||
STATIC_DIR=static | ||
UI_DIR=ui | ||
DOCKER_IMAGE=kite | ||
DOCKER_TAG=latest | ||
|
@@ -35,7 +34,6 @@ deps: ## Install frontend and backend dependencies | |
# Build targets | ||
build: frontend backend ## Build both frontend and backend | ||
@echo "✅ Build completed successfully!" | ||
@echo "📁 Static files are in ./$(STATIC_DIR)/" | ||
@echo "🚀 Run './$(BINARY_NAME)' to start the server" | ||
|
||
frontend: ## Build frontend only | ||
|
@@ -65,7 +63,7 @@ dev: ## Run in development mode | |
echo "🛑 Stopping backend server..."; \ | ||
kill $$BACKEND_PID 2>/dev/null | ||
|
||
lint: ## Run linters | ||
lint: golangci-lint ## Run linters | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
@echo "🔍 Running linters..." | ||
@echo "Backend linting..." | ||
go vet ./... | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -85,7 +85,7 @@ func (session *TerminalSession) Start(ctx context.Context, subResource string) e | |||||||
}) | ||||||||
|
||||||||
if err != nil { | ||||||||
zxh326 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Replacing the server-side
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||
klog.Errorf("Exec session error: %v", err) | ||||||||
session.SendErrorMessage(err.Error()) | ||||||||
return err | ||||||||
} | ||||||||
|
||||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { useMemo } from 'react' | ||
import { ConfigMap } from 'kubernetes-types/core/v1' | ||
|
||
import { useResources } from '@/lib/api' | ||
import { | ||
Select, | ||
SelectContent, | ||
SelectItem, | ||
SelectTrigger, | ||
SelectValue, | ||
} from '@/components/ui/select' | ||
|
||
export function ConfigMapSelector({ | ||
selectedConfigMap, | ||
onConfigMapChange, | ||
namespace, | ||
placeholder = 'Select a configmap', | ||
className, | ||
}: { | ||
selectedConfigMap?: string | ||
onConfigMapChange: (configMap: string) => void | ||
namespace?: string | ||
placeholder?: string | ||
className?: string | ||
}) { | ||
const { data, isLoading } = useResources('configmaps', namespace) | ||
|
||
const sortedConfigMaps = useMemo(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] The sorting and rendering logic here duplicates the one in Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||
return data?.slice().sort((a, b) => { | ||
const nameA = a.metadata?.name?.toLowerCase() || '' | ||
const nameB = b.metadata?.name?.toLowerCase() || '' | ||
return nameA.localeCompare(nameB) | ||
}) | ||
}, [data]) | ||
|
||
return ( | ||
<Select value={selectedConfigMap} onValueChange={onConfigMapChange}> | ||
<SelectTrigger className={className}> | ||
<SelectValue placeholder={placeholder} /> | ||
</SelectTrigger> | ||
<SelectContent> | ||
{isLoading && ( | ||
<SelectItem disabled value="_loading"> | ||
Loading configmaps... | ||
</SelectItem> | ||
)} | ||
{sortedConfigMaps?.map((configMap: ConfigMap) => ( | ||
<SelectItem | ||
key={configMap.metadata!.name} | ||
value={configMap.metadata!.name!} | ||
> | ||
{configMap.metadata!.name} | ||
</SelectItem> | ||
))} | ||
{!isLoading && (!sortedConfigMaps || sortedConfigMaps.length === 0) && ( | ||
<SelectItem disabled value="_empty"> | ||
No configmaps found | ||
</SelectItem> | ||
)} | ||
</SelectContent> | ||
</Select> | ||
) | ||
} |
Uh oh!
There was an error while loading. Please reload this page.