From b06166fd3c4be9f3e8d75241e8b619cd7687f90c Mon Sep 17 00:00:00 2001 From: Sheikah45 Date: Wed, 6 May 2026 18:43:24 -0400 Subject: [PATCH 1/6] Cache helm output for CI runs --- .github/workflows/checks.yml | 7 +++++++ Tiltfile | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index aaa578d5..f4045bef 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -21,6 +21,13 @@ jobs: - name: Create k8s Kind Cluster run: ctlptl create cluster kind --registry=ctlptl-registry + - name: Cache Helm Output + id: cache-helm-ooutput + uses: actions/cache@v5 + with: + path: .helm-cache + key: helm-cache + - name: Test Using Local Config run: tilt ci --timeout "5m" diff --git a/Tiltfile b/Tiltfile index e0091a90..a50346e2 100644 --- a/Tiltfile +++ b/Tiltfile @@ -8,6 +8,7 @@ config.define_string("faf-data-dir", args=False, usage="Directory where the FAF config.define_string("base-domain", args=False, usage="Base Domain to use for all faf services. Defaults to faforever.localhost") config.define_string_list("local-services", args=False, usage="Names of services that you intend to run locally") cfg = config.parse() +is_ci = os.getenv("CI", False) windows_bash_path = cfg.get("windows-bash-path", "C:\\Program Files\\Git\\bin\\bash.exe") host_ip = cfg.get("host-ip", "") local_services = cfg.get("local-services", []) @@ -102,18 +103,21 @@ def helm_with_build_cache(chart, namespace="", values=[], set=[], specifier = "" command.extend(value_flags) command.extend(set_flags) command.extend(["--set", "baseDomain=" + base_domain]) - - deps = [chart] - deps.extend(values) - agnostic_local_resource(name=chart_resource + "-helm", cmd=command, labels=["helm"], deps=deps, allow_parallel=True) - if not os.path.exists(cached_yaml): + if is_ci: agnostic_local(command) + else: + deps = [chart] + deps.extend(values) + agnostic_local_resource(name=chart_resource + "-helm", cmd=command, labels=["helm"], deps=deps, allow_parallel=True) + + if not os.path.exists(cached_yaml): + agnostic_local(command) - objects = read_yaml_stream(cached_yaml) - if not objects: - agnostic_local(command) objects = read_yaml_stream(cached_yaml) + if not objects: + agnostic_local(command) + objects = read_yaml_stream(cached_yaml) watch_file(cached_yaml) From 338e67c0f6a4c11322baad43229735ac6d163086 Mon Sep 17 00:00:00 2001 From: Sheikah45 Date: Wed, 6 May 2026 18:46:19 -0400 Subject: [PATCH 2/6] load objects in ci and fail if none --- Tiltfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tiltfile b/Tiltfile index a50346e2..13f42bb3 100644 --- a/Tiltfile +++ b/Tiltfile @@ -106,6 +106,9 @@ def helm_with_build_cache(chart, namespace="", values=[], set=[], specifier = "" if is_ci: agnostic_local(command) + objects = read_yaml_stream(cached_yaml) + if not objects: + fail("No objects found for chart " + chart) else: deps = [chart] deps.extend(values) From 4f40dc9eccfde469efb470b52dd56e01573a25f3 Mon Sep 17 00:00:00 2001 From: Sheikah45 Date: Wed, 6 May 2026 18:54:28 -0400 Subject: [PATCH 3/6] Use more specific keys and restore_key --- .github/workflows/checks.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f4045bef..e819d5b0 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -26,8 +26,12 @@ jobs: uses: actions/cache@v5 with: path: .helm-cache - key: helm-cache - + key: ${{ github.ref_name }} + restore_keys: | + ${{ github.base_ref }} + develop + main + - name: Test Using Local Config run: tilt ci --timeout "5m" From 5bb610cac1cdd36295a75f0ff81191a2c269c9cf Mon Sep 17 00:00:00 2001 From: Sheikah45 Date: Wed, 6 May 2026 18:59:20 -0400 Subject: [PATCH 4/6] Fix restore-keys and don't use reloader in ci --- .github/workflows/checks.yml | 4 ++-- Tiltfile | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index e819d5b0..f2dc8ed8 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -22,12 +22,12 @@ jobs: run: ctlptl create cluster kind --registry=ctlptl-registry - name: Cache Helm Output - id: cache-helm-ooutput + id: cache-helm-output uses: actions/cache@v5 with: path: .helm-cache key: ${{ github.ref_name }} - restore_keys: | + restore-keys: | ${{ github.base_ref }} develop main diff --git a/Tiltfile b/Tiltfile index 13f42bb3..21b5bbbf 100644 --- a/Tiltfile +++ b/Tiltfile @@ -151,7 +151,7 @@ def helm_with_build_cache(chart, namespace="", values=[], set=[], specifier = "" entryPoints = spec["entryPoints"] if "websecure" in entryPoints: entryPoints.append("web") - if containers or job_template_containers: + if not is_ci and (containers or job_template_containers): metadata = object["metadata"] if "annotations" not in metadata or not metadata["annotations"]: metadata["annotations"] = {} @@ -252,8 +252,9 @@ k8s_resource(new_name="namespaces", objects=["faf-infra:namespace", "faf-apps:na k8s_resource(new_name="clusterroles", objects=["read-cm-secrets:clusterrole"], labels=["core"]) k8s_resource(new_name="init-apps", objects=["init-apps:serviceaccount:faf-infra", "init-apps:serviceaccount:faf-apps", "allow-init-apps-read-app-config-infra:rolebinding", "allow-init-apps-read-app-config-apps:rolebinding"], resource_deps=["clusterroles"], labels=["core"]) -k8s_yaml(helm_with_build_cache("disabled/reloader", namespace="faf-ops", values=["config/local.yaml"])) -k8s_resource(workload="release-name-reloader", new_name="reloader", objects=["release-name-reloader:serviceaccount", "release-name-reloader-metadata-role:role", "release-name-reloader-role:clusterrole", "release-name-reloader-metadata-role-binding:rolebinding", "release-name-reloader-role-binding:clusterrolebinding"], resource_deps=["namespaces"], labels=["core"]) +if not is_ci: + k8s_yaml(helm_with_build_cache("disabled/reloader", namespace="faf-ops", values=["config/local.yaml"])) + k8s_resource(workload="release-name-reloader", new_name="reloader", objects=["release-name-reloader:serviceaccount", "release-name-reloader-metadata-role:role", "release-name-reloader-role:clusterrole", "release-name-reloader-metadata-role-binding:rolebinding", "release-name-reloader-role-binding:clusterrolebinding"], resource_deps=["namespaces"], labels=["core"]) storage_yaml = helm_with_build_cache("cluster/storage", values=["config/local.yaml"], set=["dataPath="+data_absolute_path]) storage_yaml = to_hostpath_storage(storage_yaml, use_named_volumes=use_named_volumes) From d6735e49e9d7a9caa4ce84278266673201ac3fe7 Mon Sep 17 00:00:00 2001 From: Sheikah45 Date: Wed, 6 May 2026 19:06:33 -0400 Subject: [PATCH 5/6] Remove main from restore-keys --- .github/workflows/checks.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f2dc8ed8..d40f38f7 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -22,15 +22,14 @@ jobs: run: ctlptl create cluster kind --registry=ctlptl-registry - name: Cache Helm Output - id: cache-helm-output + id: cache-helm-ooutput uses: actions/cache@v5 with: path: .helm-cache key: ${{ github.ref_name }} - restore-keys: | + restore_keys: | ${{ github.base_ref }} develop - main - name: Test Using Local Config run: tilt ci --timeout "5m" From c132ee902de08809f47690d11bcc21924d6559d6 Mon Sep 17 00:00:00 2001 From: Sheikah45 Date: Wed, 6 May 2026 19:07:52 -0400 Subject: [PATCH 6/6] Mose base_ref after develop --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d40f38f7..6261666a 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -28,8 +28,8 @@ jobs: path: .helm-cache key: ${{ github.ref_name }} restore_keys: | - ${{ github.base_ref }} develop + ${{ github.base_ref }} - name: Test Using Local Config run: tilt ci --timeout "5m"