chore: update NOTES.txt to use studioIngress and add test for validation

This commit is contained in:
chrisfu 2026-04-13 21:48:56 -07:00
parent d916aef22a
commit df93b0d1c5
2 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,5 @@
---
Thank you for installing {{ .Chart.Name }}!
{{ if .Values.ingress.enabled }}
Visit the Studio dashboard at https://{{ (index .Values.ingress.hosts 0).host }}
Visit the Studio dashboard at https://{{ (index .Values.studioIngress.hosts 0).host }}
{{- end }}

View File

@ -6,6 +6,7 @@ from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
_RENDER_PATH = REPO_ROOT / "supabase" / "helm" / "render_supabase.py"
_NOTES_TEMPLATE_PATH = REPO_ROOT / "supabase" / "helm" / "knoe-supabase" / "templates" / "NOTES.txt"
def _load_render_module():
@ -168,6 +169,16 @@ def test_render_supabase_derives_env_indexed_api_host_for_k8s(tmp_path: Path, mo
)
def test_supabase_notes_template_uses_studio_ingress_host():
notes_template = _NOTES_TEMPLATE_PATH.read_text(encoding="utf-8")
assert (
"Visit the Studio dashboard at https://{{ (index .Values.studioIngress.hosts 0).host }}"
in notes_template
)
assert "(index .Values.ingress.hosts 0).host" not in notes_template
def test_render_supabase_rejects_duplicate_api_and_studio_host_claims(tmp_path: Path, monkeypatch):
monkeypatch.delenv("SUPABASE_HOST", raising=False)
monkeypatch.delenv("SUPABASE_HOSTNAME", raising=False)