-
Notifications
You must be signed in to change notification settings - Fork 0
Features/database persistence #55
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
e2adf17
add conditional database fields in UI for advanced node.js template
VH3956 a5dfffb
Feat(operator): auto-generate database credentials (#45)
nghiaz160904 4b44ce3
Merge pull request #46 from helios-platform-team/users/ndvh/feat/dyna…
NgocAnhDo26 6ba077f
feat(scaffolder): add DatabasePicker extension for database selection
NgocAnhDo26 d3f4193
Merge pull request #48 from helios-platform-team/users/dtna/feat/scaf…
NgocAnhDo26 8598e31
feat(setup): add Taskfile and environment configuration for local dev…
NgocAnhDo26 0c1561d
feat: implement postgres provisioning logic for database trait (#34)
PhamHoangKha1403 adf6614
impl: add databasePicker component logic
VH3956 590987e
fix(env): update GIT_AUTHOR_NAME format and remove unused task from T…
NgocAnhDo26 c635aaa
fix(setup scripts): fix the scripts for setting for windows compatibi…
hoangphuc841 8ed980b
Merge pull request #51 from helios-platform-team/users/ndvh/impl/data…
hoangphuc841 b317f4c
fix(setup): resolve windows compatibility for crd generation and argo…
hoangphuc841 4b59a03
fix: address CodeRabbit review feedback for postgres provisioning" -m…
PhamHoangKha1403 5633f5a
[fix]Delete extra rows
PhamHoangKha1403 b0a4d24
Merge pull request #50 from helios-platform-team/features/operator/po…
NgocAnhDo26 4cad016
feat: implement automated secret injection and NestJS Prisma template…
PhuocHoan 5bf25c7
Merge pull request #49 from helios-platform-team/users/dtna/feat/loca…
PhamHoangKha1403 fac30e5
fix: address PR review feedback and modernize Go to 1.26.1
PhuocHoan 8d0aab7
Merge branch 'features/database-persistence' into users/hph/feat/auto…
PhuocHoan ab0a6a7
Merge pull request #53 from helios-platform-team/users/hph/feat/autom…
PhuocHoan 2c1647a
chore: untrack .claude directory
PhuocHoan cb36b23
Merge branch 'main' into features/database-persistence
PhuocHoan bb65ced
chore: harden operator DB flow and upgrade portal to Backstage 1.49.1
PhuocHoan df39c0d
fix: harden operator runtime and address CodeRabbit follow-ups
PhuocHoan 877de42
fix: apply PR review hardening and refactor controller tests
PhuocHoan a98a30b
fix: address latest CodeRabbit follow-up comments
PhuocHoan 9966067
fix: resolve latest CodeRabbit findings and portal-ci formatting
PhuocHoan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # ============================================================================= | ||
| # Helios Platform - Environment Variables | ||
| # ============================================================================= | ||
| # Copy this file to .env and fill in your values: | ||
| # cp .env.example .env | ||
| # | ||
| # This single .env at the repo root is the source of truth for all credentials. | ||
| # The Taskfile distributes these to operator and portal contexts automatically. | ||
| # ============================================================================= | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # GitHub Integration (required) | ||
| # ----------------------------------------------------------------------------- | ||
| # Personal Access Token with 'repo' and 'workflow' scopes | ||
| GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
| GITHUB_USER=your-github-username | ||
| GITHUB_ORG=helios-platform-team | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # GitHub OAuth App (required for portal login) | ||
| # ----------------------------------------------------------------------------- | ||
| # Create an OAuth App at https://github.com/settings/developers | ||
| # Homepage URL: http://localhost:3000 | ||
| # Callback URL: http://localhost:7007/api/auth/github/handler/frame | ||
| AUTH_GITHUB_CLIENT_ID= | ||
| AUTH_GITHUB_CLIENT_SECRET= | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Docker Registry (required for Tekton pipelines) | ||
| # ----------------------------------------------------------------------------- | ||
| DOCKER_SERVER=https://index.docker.io/v1/ | ||
| DOCKER_USERNAME= | ||
| DOCKER_PASSWORD= | ||
| DOCKER_EMAIL= | ||
|
|
||
| # ----------------------------------------------------------------------------- | ||
| # Git Author (optional, used by operator for GitOps commits) | ||
| # ----------------------------------------------------------------------------- | ||
| GIT_AUTHOR_NAME="Helios Operator" | ||
| GIT_AUTHOR_EMAIL=operator@helios.io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,14 @@ | ||
| # SQLite | ||
| *.sqlite | ||
| apps/portal/packages/backend/*.sqlite | ||
|
|
||
| # Environment secrets | ||
| .env | ||
| .env.* | ||
| **/.env | ||
| **/.env.* | ||
| !.env.example | ||
| !**/.env.example | ||
|
|
||
| # Claude | ||
| .claude/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,239 @@ | ||
| # ============================================================================= | ||
| # Helios Platform - Root Taskfile | ||
| # ============================================================================= | ||
| # Usage: | ||
| # task check Verify all prerequisites are installed | ||
| # task setup Bootstrap the full local environment (cluster + deps) | ||
| # task dev Run operator + portal concurrently | ||
| # task test Run all tests | ||
| # task clean Tear down the k3d cluster | ||
| # | ||
| # First-time setup: | ||
| # cp .env.example .env # fill in your credentials | ||
| # task setup # ~5-10 minutes | ||
| # task dev # opens operator + portal | ||
| # | ||
| # Cross-platform: | ||
| # Linux/macOS: works natively | ||
| # Windows: requires Git Bash or WSL (for bash-based sub-scripts) | ||
| # ============================================================================= | ||
| version: '3' | ||
|
|
||
| dotenv: ['.env'] | ||
|
|
||
| vars: | ||
| CLUSTER_NAME: helios-dev | ||
| ARGOCD_PORT: '8080' | ||
| KUBECTL_PROXY_PORT: '8001' | ||
|
|
||
| set: [errexit, pipefail] | ||
|
|
||
| # ============================================================================= | ||
| # Prerequisite Checking | ||
| # ============================================================================= | ||
| tasks: | ||
| check: | ||
| desc: Verify all development prerequisites are installed | ||
| cmds: | ||
| - cmd: bash scripts/check-prereqs.sh | ||
| platforms: [linux, darwin] | ||
| - cmd: cmd /c scripts\\check-prereqs.bat | ||
| platforms: [windows] | ||
|
|
||
| check:env: | ||
| desc: Verify prerequisites and .env configuration | ||
| cmds: | ||
| - cmd: bash scripts/check-prereqs.sh --env | ||
| platforms: [linux, darwin] | ||
| - cmd: cmd /c scripts\\check-prereqs.bat --env | ||
| platforms: [windows] | ||
|
|
||
| # =========================================================================== | ||
| # Setup Tasks | ||
| # =========================================================================== | ||
| setup: | ||
| desc: Bootstrap the full local development environment | ||
| deps: [check:env] | ||
| cmds: | ||
| - task: setup:cluster | ||
| - task: setup:tekton | ||
| - task: setup:argocd | ||
| - task: setup:crds | ||
| - task: setup:tekton-rbac | ||
| - task: setup:credentials | ||
| - task: setup:portal-deps | ||
| - echo "" | ||
| - echo "=============================================" | ||
| - echo " Helios local environment is ready!" | ||
| - echo " Run 'task dev' to start developing." | ||
| - echo "=============================================" | ||
|
|
||
| setup:cluster: | ||
| desc: Create a k3d cluster (idempotent) | ||
| status: | ||
| - k3d kubeconfig get {{.CLUSTER_NAME}} | ||
| cmds: | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - echo "Creating k3d cluster '{{.CLUSTER_NAME}}'..." | ||
| - k3d cluster create {{.CLUSTER_NAME}} --agents 1 --wait --api-port 127.0.0.1:6550 | ||
| - kubectl config set-cluster k3d-{{.CLUSTER_NAME}} --server=https://localhost:6550 | ||
|
PhuocHoan marked this conversation as resolved.
|
||
| - kubectl cluster-info | ||
|
|
||
| setup:tekton: | ||
| desc: Install Tekton Pipeline, Triggers, and Interceptors | ||
| cmds: | ||
| - echo "Installing Tekton Pipeline..." | ||
| - kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml --request-timeout=120s | ||
| - echo "Installing Tekton Triggers..." | ||
| - kubectl apply --filename https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml --request-timeout=120s | ||
| - echo "Installing Tekton Interceptors..." | ||
| - kubectl apply --filename https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml --request-timeout=120s | ||
| - echo "Waiting for Tekton Pipelines controller..." | ||
| - kubectl rollout status deployment/tekton-pipelines-controller -n tekton-pipelines --timeout=600s | ||
| - echo "Waiting for Tekton Pipelines webhook..." | ||
| - kubectl rollout status deployment/tekton-pipelines-webhook -n tekton-pipelines --timeout=600s | ||
| - echo "Waiting for webhook endpoints to register..." | ||
| - cmd: sleep 10 | ||
| platforms: [linux, darwin] | ||
| - cmd: powershell -Command "Start-Sleep -Seconds 10" | ||
| platforms: [windows] | ||
| - echo "Patching Tekton feature flags..." | ||
| - >- | ||
| kubectl patch configmap feature-flags -n tekton-pipelines | ||
| -p '{"data":{"disable-affinity-assistant":"true","coschedule":"disabled"}}' | ||
| - kubectl rollout restart deployment tekton-pipelines-controller -n tekton-pipelines | ||
| - kubectl rollout status deployment/tekton-pipelines-controller -n tekton-pipelines --timeout=600s | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| setup:argocd: | ||
| desc: Install ArgoCD | ||
| cmds: | ||
| - kubectl create namespace argocd --dry-run=client -o yaml | kubectl apply -f - | ||
| - echo "Installing ArgoCD..." | ||
| - kubectl apply -n argocd --server-side --force-conflicts -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml | ||
| - echo "Waiting for ArgoCD server..." | ||
| - kubectl rollout status deployment/argocd-server -n argocd --timeout=600s | ||
|
|
||
| setup:crds: | ||
| desc: Install Helios CRDs into the cluster | ||
| dir: apps/operator | ||
| cmds: | ||
| - cmd: make install | ||
| platforms: [linux, darwin] | ||
| - cmd: kubectl kustomize config/crd | kubectl apply -f - | ||
| platforms: [windows] | ||
|
|
||
| setup:tekton-rbac: | ||
| desc: Grant Tekton Triggers SA the permissions to create PipelineRuns | ||
| cmds: | ||
| - >- | ||
| kubectl create role tekton-triggers-pipelinerun-runner | ||
| --namespace default | ||
| --verb=get,list,watch,create,update,patch | ||
| --resource=pipelineruns.tekton.dev,taskruns.tekton.dev | ||
| --dry-run=client -o yaml | kubectl apply -f - | ||
| - >- | ||
| kubectl create rolebinding tekton-triggers-pipelinerun-runner | ||
| --namespace default | ||
| --role=tekton-triggers-pipelinerun-runner | ||
| --serviceaccount=default:tekton-triggers-sa | ||
| --dry-run=client -o yaml | kubectl apply -f - | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| setup:credentials: | ||
| desc: Create Docker registry secret and link to pipeline SA | ||
| cmds: | ||
| - cmd: | | ||
| if [ -z "$DOCKER_USERNAME" ] || [ -z "$DOCKER_PASSWORD" ]; then | ||
| echo "DOCKER_USERNAME and DOCKER_PASSWORD must be set in .env" >&2 | ||
| exit 1 | ||
| fi | ||
| platforms: [linux, darwin] | ||
| - cmd: | | ||
| powershell -Command "if ([string]::IsNullOrEmpty($env:DOCKER_USERNAME) -or [string]::IsNullOrEmpty($env:DOCKER_PASSWORD)) { Write-Error 'DOCKER_USERNAME and DOCKER_PASSWORD must be set in .env'; exit 1 }" | ||
| platforms: [windows] | ||
| - cmd: | | ||
| kubectl create secret docker-registry docker-credentials \ | ||
| --docker-server=${DOCKER_SERVER:-https://index.docker.io/v1/} \ | ||
| --docker-username=$DOCKER_USERNAME \ | ||
| --docker-password=$DOCKER_PASSWORD \ | ||
| --docker-email=${DOCKER_EMAIL:-dev@helios.io} \ | ||
| --dry-run=client -o yaml | kubectl apply -f - | ||
| platforms: [linux, darwin] | ||
| - cmd: | | ||
| powershell -Command "$server = if ([string]::IsNullOrEmpty($env:DOCKER_SERVER)) { 'https://index.docker.io/v1/' } else { $env:DOCKER_SERVER }; $email = if ([string]::IsNullOrEmpty($env:DOCKER_EMAIL)) { 'dev@helios.io' } else { $env:DOCKER_EMAIL }; kubectl create secret docker-registry docker-credentials --docker-server=$server --docker-username=$env:DOCKER_USERNAME --docker-password=$env:DOCKER_PASSWORD --docker-email=$email --dry-run=client -o yaml | kubectl apply -f -" | ||
| platforms: [windows] | ||
| - cmd: | | ||
| if kubectl get sa pipeline >/dev/null 2>&1; then | ||
| kubectl patch sa pipeline -p '{"secrets": [{"name": "docker-credentials"}]}' | ||
| else | ||
| echo "pipeline ServiceAccount not found yet; skipping patch (will be created by Tekton)" | ||
| fi | ||
| platforms: [linux, darwin] | ||
| - cmd: | | ||
| powershell -Command "kubectl get sa pipeline *> $null; if ($LASTEXITCODE -eq 0) { kubectl patch sa pipeline -p '{\"secrets\": [{\"name\": \"docker-credentials\"}]}' } else { Write-Host 'pipeline ServiceAccount not found yet; skipping patch (will be created by Tekton)' }" | ||
| platforms: [windows] | ||
|
|
||
| setup:portal-deps: | ||
| desc: Install Backstage portal dependencies | ||
| dir: apps/portal | ||
| cmds: | ||
| - yarn install | ||
|
|
||
| # =========================================================================== | ||
| # Development Tasks | ||
| # =========================================================================== | ||
| dev: | ||
| desc: Run operator and portal concurrently | ||
| deps: [dev:operator, dev:portal] | ||
|
|
||
| dev:operator: | ||
| desc: Run the Helios operator locally | ||
| dir: apps/operator | ||
| env: | ||
| HELIOS_CUE_PATH: '{{.ROOT_DIR}}/cue' | ||
| cmds: | ||
|
PhuocHoan marked this conversation as resolved.
|
||
| - cmd: make run | ||
| platforms: [linux, darwin] | ||
| - cmd: go run ./cmd/main.go | ||
| platforms: [windows] | ||
|
|
||
| dev:portal: | ||
| desc: Run the Backstage portal with ArgoCD + kubectl proxy | ||
| cmds: | ||
| - cmd: cd apps/portal && ./start-dev.sh | ||
| platforms: [linux, darwin] | ||
| - cmd: powershell -ExecutionPolicy Bypass -File ../../scripts/start-portal.ps1 -ArgocdPort {{.ARGOCD_PORT}} | ||
| platforms: [windows] | ||
|
|
||
| # =========================================================================== | ||
| # Testing Tasks | ||
| # =========================================================================== | ||
| test: | ||
| desc: Run all tests | ||
| cmds: | ||
| - task: test:operator | ||
| - task: test:portal | ||
|
|
||
| test:operator: | ||
| desc: Run operator unit tests | ||
| dir: apps/operator | ||
| cmds: | ||
| - make test | ||
|
|
||
| test:portal: | ||
| desc: Run portal tests | ||
| dir: apps/portal | ||
| cmds: | ||
| - yarn test | ||
|
|
||
| # =========================================================================== | ||
| # Teardown Tasks | ||
| # =========================================================================== | ||
| clean: | ||
| desc: Delete the k3d cluster and clean up | ||
| cmds: | ||
| - task: clean:cluster | ||
|
|
||
| clean:cluster: | ||
| desc: Delete the k3d cluster | ||
| cmds: | ||
| - k3d cluster delete {{.CLUSTER_NAME}} | ||
| - echo "Cluster '{{.CLUSTER_NAME}}' deleted." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.