Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## What this PR does

<!-- Brief description of the changes -->

## Why we need it

<!-- Motivation, context, or link to issue -->

Fixes #

## How to test

<!-- Steps to verify, or "N/A" for docs/config changes -->

## Checklist

- [ ] Tests added/updated (if applicable)
- [ ] Docs updated (if applicable)
- [ ] `make test` passes locally
60 changes: 60 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
version: 2
updates:
# Backend Go module
- package-ecosystem: "gomod"
directory: "/backend"
schedule:
interval: "weekly"
day: "saturday"
labels:
- "dependencies"
- "backend"
groups:
k8s:
patterns:
- "k8s.io/*"
- "sigs.k8s.io/*"
ignore:
# Pin to the client-go line that matches the cluster we target; major and
# minor bumps here change API behavior and should be deliberate.
- dependency-name: "k8s.io/*"
update-types: ["version-update:semver-major", "version-update:semver-minor"]
- dependency-name: "sigs.k8s.io/*"
update-types: ["version-update:semver-major", "version-update:semver-minor"]

# Frontend npm package
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "weekly"
day: "saturday"
labels:
- "dependencies"
- "frontend"
groups:
# Next.js and React move together; separate PRs tend to break the build.
next:
patterns:
- "next"
- "eslint-config-next"
react:
patterns:
- "react"
- "react-dom"
- "@types/react"
- "@types/react-dom"
testing:
patterns:
- "vitest"
- "@vitest/*"
- "@testing-library/*"

# GitHub Actions used by the workflows
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
labels:
- "dependencies"
- "ci"
47 changes: 47 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Auto-labeling rules applied by .github/workflows/pr-labeler.yml.
# Paths are repo-root relative; in OME these same labels were scoped under
# web-console/.

# Frontend
frontend:
- changed-files:
- any-glob-to-any-file: 'frontend/**/*'

# Backend
backend:
- changed-files:
- any-glob-to-any-file: 'backend/**/*'

# CI/CD
ci:
- changed-files:
- any-glob-to-any-file:
- '.github/**/*'
- '.pre-commit-config.yaml'
- 'Makefile'

# Documentation
documentation:
- changed-files:
- any-glob-to-any-file:
- '**/*.md'

# Tests
tests:
- changed-files:
- any-glob-to-any-file:
- 'backend/**/*_test.go'
- 'frontend/src/**/*.test.*'
- 'frontend/src/**/*.spec.*'
- 'frontend/src/test/**/*'

# Dependencies
dependencies:
- changed-files:
- any-glob-to-any-file:
- 'backend/go.mod'
- 'backend/go.sum'
- 'frontend/package.json'
- 'frontend/package-lock.json'
- 'go.work'
- 'go.work.sum'
94 changes: 94 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Label definitions synced by .github/workflows/sync-labels.yml.
# Colors are carried over from the OME repository so the two stay visually consistent.

# =============================================================================
# Component Labels
# =============================================================================
- name: frontend
color: "F472B6"
description: "Frontend/UI changes"

- name: backend
color: "DB2777"
description: "Backend API changes"

- name: ci
color: "BFD4F2"
description: "CI/CD changes"

- name: documentation
color: "0075CA"
description: "Documentation changes"

- name: dependencies
color: "0366D6"
description: "Dependency updates"

- name: tests
color: "C2E0C6"
description: "Test changes"

# =============================================================================
# Kind Labels
# =============================================================================
- name: kind/bug
color: "D73A4A"
description: "Something isn't working"

- name: kind/feature
color: "A2EEEF"
description: "New feature or request"

- name: kind/enhancement
color: "84B6EB"
description: "Improvement to existing functionality"

- name: kind/documentation
color: "0075CA"
description: "Documentation improvements"

- name: kind/cleanup
color: "FEF2C0"
description: "Code cleanup or refactoring"

- name: kind/breaking-change
color: "B60205"
description: "Breaking change"

# =============================================================================
# Priority Labels
# =============================================================================
- name: priority/critical
color: "B60205"
description: "Critical priority"

- name: priority/high
color: "D93F0B"
description: "High priority"

- name: priority/medium
color: "FBCA04"
description: "Medium priority"

- name: priority/low
color: "0E8A16"
description: "Low priority"

# =============================================================================
# Status Labels
# =============================================================================
- name: status/wip
color: "FBCA04"
description: "Work in progress"

- name: status/blocked
color: "B60205"
description: "Blocked by another issue or PR"

- name: status/needs-review
color: "0E8A16"
description: "Needs review"

- name: status/needs-rebase
color: "E99695"
description: "Needs rebase on main"
102 changes: 102 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: CI

on:
push:
branches: [main, release-*]
pull_request:
branches: [main, release-*]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Frontend checks - lint, format, typecheck, build, test
frontend:
name: Frontend
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: frontend
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '23'
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

- name: Run Prettier check
run: npm run format:check

- name: Run TypeScript type check
run: npm run typecheck

- name: Build
run: npm run build

- name: Run tests
run: npm run test

# Backend checks - vet, build, test
backend:
name: Backend
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: backend
steps:
- name: Checkout code
uses: actions/checkout@v6

# Version comes from go.work so CI can never drift from the repo.
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.work
cache: true
cache-dependency-path: backend/go.sum

- name: Download dependencies
run: go mod download

- name: Run go vet
run: go vet ./...

- name: Build
run: go build ./...

- name: Run tests
run: go test -race ./...

# Single job for branch protection to require.
summary:
name: CI Summary
runs-on: ubuntu-latest
needs: [frontend, backend]
if: always()
steps:
- name: Check results
run: |
# Treat anything other than success (failure, cancelled, skipped) as a
# failure, so a cancelled job can never report the suite as green.
if [[ "${{ needs.frontend.result }}" != "success" ]] || \
[[ "${{ needs.backend.result }}" != "success" ]]; then
echo "::error::CI failed (frontend=${{ needs.frontend.result }}, backend=${{ needs.backend.result }})"
exit 1
fi
echo "CI passed successfully"
60 changes: 60 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CodeQL

# The backend holds cluster credentials and the frontend renders cluster data,
# so both sides are worth scanning.
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Weekly, so newly published queries reach the default branch without a push.
- cron: '30 4 * * 1'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
security-events: write
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
- language: javascript-typescript
build-mode: none
steps:
- name: Checkout code
uses: actions/checkout@v6

# autobuild for Go needs a toolchain matching the workspace.
- name: Setup Go
if: matrix.language == 'go'
uses: actions/setup-go@v6
with:
go-version-file: go.work
cache: true
cache-dependency-path: backend/go.sum

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v4
with:
category: /language:${{ matrix.language }}
Loading
Loading