-
Notifications
You must be signed in to change notification settings - Fork 0
fix: Stabilize diagrams and live render #65
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
base: main
Are you sure you want to change the base?
Changes from all commits
a852fb3
56f6064
c57cf9e
6ab91ff
856b751
7c701de
4892ac7
16e7c94
98d5fc0
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 |
|---|---|---|
|
|
@@ -10,6 +10,22 @@ vars: | |
| # Directories | ||
| DIST_DIR: ./dist | ||
| PDF_OUTPUT_DIR: ../../../static/pdfs | ||
| CLI_NPM_PACKAGE_DIR: "{{.ROOT_DIR}}/.tmp/facet-cli" | ||
| CLI_VERSION: | ||
| sh: node -p "require('./cli/package.json').version" | ||
| BINARY_EXT: '{{if eq OS "windows"}}.exe{{end}}' | ||
| FACET_BINARY: "{{.DIST_DIR}}/facet{{.BINARY_EXT}}" | ||
|
|
||
| # Lab deployment | ||
| APP_NAME: facet | ||
| CHART_DIR: chart | ||
| LAB_CONTEXT: k3s | ||
| LAB_NAMESPACE: facet | ||
| LAB_REGISTRY: docker.c0a801af.sslip.io | ||
| LAB_COMMIT: | ||
| sh: git rev-parse --short=8 HEAD | ||
| LAB_VERSION: | ||
| sh: printf '%s-%s\n' "$(git describe --tags --always --dirty --abbrev=8)" "$(date -u +%Y%m%d%H%M%S)" | tr '/' '-' | ||
|
|
||
| # Source patterns for watching and dependency tracking | ||
| SRC_PATTERN: src/**/*.{tsx,ts,jsx,js,css,mdx} | ||
|
|
@@ -29,18 +45,63 @@ tasks: | |
|
|
||
| build: | ||
| sources: | ||
| - src/**/*.{tsx,ts,jsx,js,css,mdx} | ||
| - cli/src/**/*.{tsx,ts,jsx,js,css,mdx} | ||
| - Taskfile.yml | ||
| - package.json | ||
| - pnpm-lock.yaml | ||
| - openapi.yaml | ||
| - postcss.config.js | ||
| - tailwind.config.js | ||
| - tsconfig.json | ||
| - tsconfig.lib.json | ||
| - vite.lib.config.ts | ||
| - vite.playground.config.ts | ||
| - src/**/* | ||
| - cli/package.json | ||
| - cli/pnpm-lock.yaml | ||
| - cli/scripts/**/* | ||
| - cli/src/**/* | ||
| - cli/tsconfig.json | ||
| - cli/tsdown.config.ts | ||
| - cli/tsdown.sea.config.ts | ||
| generates: | ||
| - dist/facet | ||
| - "{{.FACET_BINARY}}" | ||
| cmds: | ||
| - pnpm run build | ||
|
|
||
| build:npm-cli: | ||
| desc: "Build the local @flanksource/facet-cli npm package" | ||
| cmds: | ||
| - pnpm --dir cli run build:bundle | ||
| - node cli/scripts/pack-npm-cli.cjs "{{.CLI_VERSION}}" "{{.CLI_NPM_PACKAGE_DIR}}" | ||
|
|
||
| install: | ||
| desc: "Build and globally install the local @flanksource/facet-cli package, replacing the active facet executable" | ||
| deps: | ||
| - build | ||
| - build:npm-cli | ||
| cmds: | ||
| - npm install --global --force --install-links "{{.CLI_NPM_PACKAGE_DIR}}" | ||
| - ln -sf "$(npm root --global)/@flanksource/facet-cli/facet.cjs" "$(which facet)" | ||
|
|
||
| install:symlink: | ||
| desc: "Globally link the local Facet CLI and component library to this checkout" | ||
| deps: | ||
| - build:npm-cli | ||
| cmds: | ||
| - task: install:symlink:library | ||
| - task: install:symlink:cli | ||
| - ln -sf "$(npm root --global)/@flanksource/facet-cli/facet.cjs" "$(which facet)" | ||
|
|
||
| install:symlink:library: | ||
| internal: true | ||
| dir: "{{.ROOT_DIR}}" | ||
| cmds: | ||
| - cp dist/facet /usr/local/bin | ||
| - npm link | ||
|
|
||
| install:symlink:cli: | ||
| internal: true | ||
| dir: "{{.CLI_NPM_PACKAGE_DIR}}" | ||
| cmds: | ||
| - npm link | ||
|
|
||
| storybook: | ||
| desc: "Run Storybook development server on port 6006" | ||
|
|
@@ -57,6 +118,12 @@ tasks: | |
| - test:unit | ||
| # - test:storybook | ||
|
|
||
| lint: | ||
| desc: "Typecheck the CLI" | ||
| dir: cli | ||
| cmds: | ||
| - pnpm run lint | ||
|
|
||
| gen-version: | ||
| desc: "Generate cli/src/version-generated.ts" | ||
| dir: cli | ||
|
|
@@ -85,7 +152,45 @@ tasks: | |
| deps: | ||
| - build | ||
| cmds: | ||
| - ./dist/facet serve --templates-dir examples | ||
| - "{{.FACET_BINARY}} serve --templates-dir examples" | ||
|
|
||
| image:lab: | ||
| desc: "Build and push the linux/amd64 Facet image to the lab registry" | ||
| cmds: | ||
| - >- | ||
| docker build | ||
| --platform linux/amd64 | ||
| --build-arg VERSION={{.LAB_VERSION}} | ||
| --build-arg GIT_COMMIT={{.LAB_COMMIT}} | ||
| --tag {{.LAB_REGISTRY}}/{{.APP_NAME}}:{{.LAB_VERSION}} | ||
| . | ||
| - docker push {{.LAB_REGISTRY}}/{{.APP_NAME}}:{{.LAB_VERSION}} | ||
|
|
||
| deploy:lab: | ||
| desc: "Build, push, and deploy Facet to the lab" | ||
| vars: | ||
| DEPLOY_VERSION: "{{.LAB_VERSION}}" | ||
| cmds: | ||
| - task: image:lab | ||
| vars: | ||
| LAB_VERSION: "{{.DEPLOY_VERSION}}" | ||
| - >- | ||
| helm upgrade --install {{.APP_NAME}} {{.CHART_DIR}} | ||
| --kube-context {{.LAB_CONTEXT}} | ||
| --namespace {{.LAB_NAMESPACE}} | ||
| --create-namespace | ||
| --values {{.CHART_DIR}}/values.lab.yaml | ||
| --set-string image.repository={{.LAB_REGISTRY}}/{{.APP_NAME}} | ||
| --set-string image.tag={{.DEPLOY_VERSION}} | ||
| --set-string image.pullPolicy=Always | ||
| --rollback-on-failure | ||
| --wait | ||
| --timeout 10m | ||
| - >- | ||
| kubectl --context {{.LAB_CONTEXT}} | ||
| rollout status deployment/{{.APP_NAME}} | ||
| --namespace {{.LAB_NAMESPACE}} | ||
| --timeout 5m | ||
|
Comment on lines
+177
to
+193
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. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🌐 Web query:
💡 Result: The --rollback-on-failure flag was introduced in Helm 4.0.0 as a replacement for the deprecated --atomic flag [1][2][3]. This change was implemented to provide clearer terminology for the functionality, which automatically reverts a failed installation or upgrade [1]. While the functionality remains similar, the new flag is the standard in Helm 4 [2][3]. Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Taskfile references to helm image/version/context =="
rg -n "helm|Helm|helmfile|kubepi|LAB_|CHART_DIR|kube-context|kubectl" Taskfile.yml .github 2>/dev/null || true
echo
echo "== Helm references in tracked files =="
rg -n "helm (upgrade|install|up|version)|Helm|helmfile|helm3|helm4" -g '!vendor/**' -g '!dist/**' -g '!build/**' . || trueRepository: flanksource/facet Length of output: 4594 🌐 Web query:
💡 Result: The --rollback-on-failure flag is not available in Helm v3. It was introduced in Helm 4 as a replacement for the --atomic flag [1][2]. In Helm v3, the equivalent functionality is provided by the --atomic flag [3][2][4]. When --atomic is used with helm upgrade or helm install, Helm will automatically roll back the release to the previous successful state if the operation fails [2][4]. In Helm 4, the --atomic flag is deprecated in favor of --rollback-on-failure [1][3][2]. While --atomic remains available in some contexts for backward compatibility in early Helm 4 versions, it has been removed in others (such as the install command) [2]. Summary of flag usage: - Helm v3: Use --atomic. - Helm v4: Use --rollback-on-failure (replaces --atomic) [1][3][2]. Citations:
Use This repository is documented as supporting Helm 🤖 Prompt for AI Agents |
||
|
|
||
| default: | ||
| desc: "Show available tasks" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| {{- if .Values.ingress.enabled }} | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| name: {{ include "facet.fullname" . }} | ||
| labels: | ||
| {{- include "facet.labels" . | nindent 4 }} | ||
| {{- with .Values.ingress.annotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- with .Values.ingress.className }} | ||
| ingressClassName: {{ . }} | ||
| {{- end }} | ||
| {{- with .Values.ingress.tls }} | ||
| tls: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| rules: | ||
| {{- range .Values.ingress.hosts }} | ||
| - host: {{ .host | quote }} | ||
| http: | ||
| paths: | ||
| {{- range .paths }} | ||
| - path: {{ .path }} | ||
| pathType: {{ .pathType }} | ||
| backend: | ||
| service: | ||
| name: {{ include "facet.fullname" $ }} | ||
| port: | ||
| number: {{ $.Values.service.port }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ingress: | ||
| enabled: true | ||
| className: traefik | ||
| annotations: | ||
| cert-manager.io/cluster-issuer: lab-ca | ||
| traefik.ingress.kubernetes.io/router.entrypoints: websecure | ||
| hosts: | ||
| - host: facet.c0a801af.sslip.io | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| - host: facet.lab | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| tls: | ||
| - secretName: facet-tls | ||
| hosts: | ||
| - facet.c0a801af.sslip.io | ||
| - facet.lab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Restore
/workspaceafter the warmup.Line 142 makes
/appthe final runtime working directory, overriding the declared/workspacedefault. Relative template and output paths in container invocations will resolve under/appinstead of the intended writable workspace.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents