diff --git a/CHANGELOG.md b/CHANGELOG.md index c8cfad2..a19f906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,11 @@ releases yet; everything is under Unreleased. another cluster's file. Check now has a row for every app whose config template names an `org_repo`: absent (the app's first run makes it), this install's, another install's with the project and cluster it names, or a rename forward, which is a stop. +- **Check names where skills come from.** None ship with kobo (the stranger run, 2026-12-01: the + first clean bootstrap made `/kobo-skills` and the catalog came up with skills=0). The row + says skills go in that repo, that its publish workflow has no cloud identity in a stranger's + template (`skills_publish_wif_provider` and `skills_publish_service_account` blank), and how to + publish by hand from a signed-in machine until one is set. - **The page before a cluster exists.** A kubeconfig with nothing to read used to be "unknown": no App card, no Install Gojira, though terraform would make the cluster. When the env file says `GOJIRA_TERRAFORM=1` and names a `CLUSTER`, the page now says "no cluster @@ -143,6 +148,10 @@ releases yet; everything is under Unreleased. ### Fixed +- **The stranger's kobo says its open room is on purpose.** `examples/stack/kobo-config.template.yaml` + left `allow_unauthenticated` unset beside an empty `iap_audience`, so kobo 0.3.86 logged an ERROR + at every boot (its issue #198: an open room must never be silent). The template sets it, with the + line to swap for `iap_audience` behind a sign-in proxy. - **Install Gojira was gated on a checkout the stranger no longer has.** Since the release is fetched at `gojira.version`, a new profile has no `gojira_repo`; the page still required one for the button and said "Set the profile's Gojira checkout". The env file is the only gate. diff --git a/examples/stack/kobo-config.template.yaml b/examples/stack/kobo-config.template.yaml index cb6397a..2679d52 100644 --- a/examples/stack/kobo-config.template.yaml +++ b/examples/stack/kobo-config.template.yaml @@ -39,6 +39,8 @@ workdir: /data/work db_url: sqlite:////data/kobo.db ui_dist: /srv/ui iap_audience: "" # empty: no sign-in proxy; reach the room through a port-forward +allow_unauthenticated: true # says the open room is on purpose; without it kobo logs an ERROR at every boot. + # Behind a sign-in proxy: set iap_audience and drop this line. # The same GitHub App Gojira uses (install.md step 2): its id and the id of its # installation on your org, both read when the Secret is written; and where the # Secret kobo-github mounts the key. diff --git a/stack/preflight.py b/stack/preflight.py index d66387e..0539f7f 100644 --- a/stack/preflight.py +++ b/stack/preflight.py @@ -91,10 +91,9 @@ def check_tools(stack: Stack, target: Target, which: Callable[[str], str | None] return out -def _org_repos(stack: Stack, target: Target) -> list[tuple[str, str]]: - """(app, org repo) for every app whose config template names an `org_repo`: - the repo the app reads its org-wide config from at boot and makes on its - first run when it is not there (kobo's /kobo-config).""" +def _template_docs(stack: Stack, target: Target) -> list[tuple[str, dict]]: + """(app, parsed YAML) for every config template the stack fills with the + four things: what the app will read at boot, seen before it boots.""" import yaml from stack.site import fill @@ -112,9 +111,50 @@ def _org_repos(stack: Stack, target: Target) -> list[tuple[str, str]]: doc = yaml.safe_load(fill(path.read_text(), target.values)) or {} except (ValueError, yaml.YAMLError): continue # the four are not set yet, or not YAML: nothing to name - repo = doc.get("org_repo") if isinstance(doc, dict) else None - if isinstance(repo, str) and "/" in repo: - out.append((app.name, repo)) + if isinstance(doc, dict): + out.append((app.name, doc)) + return out + + +def _org_repos(stack: Stack, target: Target) -> list[tuple[str, str]]: + """(app, org repo) for every app whose config template names an `org_repo`: + the repo the app reads its org-wide config from at boot and makes on its + first run when it is not there (kobo's /kobo-config).""" + out = [] + for app, doc in _template_docs(stack, target): + repo = doc.get("org_repo") + if isinstance(repo, str) and "/" in repo: + out.append((app, repo)) + return out + + +def check_skills(stack: Stack, target: Target, github: GitHubClient) -> list[Check]: + """What an assembled agent can be given: none ship with kobo. Skills live in + / (made by kobo's first run) and reach the room only through + that repo's publish workflow, which signs in to the bucket with the identity + the template names in skills_publish_wif_provider + skills_publish_service_account. + A stranger's template leaves both blank (the stranger run, 2026-12-01: the + bootstrap made tenishai/kobo-skills with `workload_identity_provider:` empty; + the catalog came up with skills=0), so the row says where skills go and that a + merged one will not arrive until an identity is set or someone publishes by hand.""" + out = [] + for app, doc in _template_docs(stack, target): + org, name, bucket = doc.get("github_org"), doc.get("skills_repo"), doc.get("skills_bucket") + if not (isinstance(org, str) and isinstance(name, str) and org and name): + continue + repo = f"{org}/{name}" + there = "exists" if github.repo_exists(repo) else f"{app}'s first run makes it" + provider, account = doc.get("skills_publish_wif_provider"), doc.get("skills_publish_service_account") + what = f"{app}: skills {repo}" + if provider and account: + out.append(Check(what, "ok", f"{there}; a merged skill is published to {bucket} as {account}")) + else: + out.append(Check(what, "warn", f"none ship with {app}; they go in {repo} ({there}), and its publish " + f"workflow has no cloud identity (skills_publish_wif_provider and " + f"skills_publish_service_account are blank in the template): a merged " + f"skill reaches {bucket} only when one is set, or by hand from a " + f"signed-in machine: `python .github/scripts/publish_skills.py " + f"--bucket {bucket}` in a clone of {repo}")) return out @@ -293,6 +333,7 @@ def preflight(stack: Stack, target: Target, which: Callable[[str], str | None] = gh = GhCLI(target.env) out += check_github(stack, gh) out += check_org_repos(stack, target, gh) + out += check_skills(stack, target, gh) except ToolError as exc: out.append(Check("gh login", "fail", str(exc))) # The cluster row: a missing namespace is a different case from an unreadable diff --git a/tests/test_preflight.py b/tests/test_preflight.py index 2dce82a..9ee37c2 100644 --- a/tests/test_preflight.py +++ b/tests/test_preflight.py @@ -167,6 +167,37 @@ def test_the_org_config_repo_an_app_reads_at_boot_is_a_row(tmp_path): assert check_org_repos(stack, target, gh) == [] +def test_skills_are_a_row_naming_where_they_go_and_the_missing_publisher(tmp_path): + """Shaz: "where are the skills coming from?" None ship with kobo; they go in + /kobo-skills and reach the bucket through that repo's publish workflow, + which has no cloud identity in a stranger's template. The row says so, and + says how to publish by hand until one is set.""" + from stack.preflight import check_skills + (tmp_path / "kobo.tmpl").write_text('github_org: "{org}"\nskills_repo: kobo-skills\n' + 'skills_bucket: "{project}-kobo-skills"\n') + stack, target = _stack(tmp_path, """ +apps: + - {name: kobo, repo: o/kobo, image: r/kobo:v1, deploy_repo: "acme/infra-kobo-deploy", + secrets: {kobo-config: {config.yaml: "template:kobo.tmpl"}}} +""") + target.values = {"org": "acme", "project": "acme-agents", "region": "us-central1", "cluster": "gojira-sandbox"} + gh = FakeGitHub() + row = _by(check_skills(stack, target, gh), "kobo: skills acme/kobo-skills") + assert row.status == "warn" and "none ship with kobo" in row.detail + assert "kobo's first run makes it" in row.detail and "--bucket acme-agents-kobo-skills" in row.detail + gh.repos["acme/kobo-skills"] = {"README.md": ""} + row = _by(check_skills(stack, target, gh), "kobo: skills acme/kobo-skills") + assert row.status == "warn" and "(exists)" in row.detail + (tmp_path / "kobo.tmpl").write_text('github_org: "{org}"\nskills_repo: kobo-skills\n' + 'skills_bucket: "{project}-kobo-skills"\n' + 'skills_publish_wif_provider: projects/1/locations/global/workloadIdentityPools/p/providers/g\n' + 'skills_publish_service_account: skills@acme-agents.iam.gserviceaccount.com\n') + row = _by(check_skills(stack, target, gh), "kobo: skills acme/kobo-skills") + assert row.status == "ok" and "as skills@acme-agents.iam.gserviceaccount.com" in row.detail + target.values = {} + assert check_skills(stack, target, gh) == [] + + def test_no_cluster_yet_is_a_warn_naming_what_install_gojira_makes(tmp_path, monkeypatch): """The stranger's Check before the cluster exists said FAIL "has no namespace 'gojira'. Is KUBECONFIG the install's…": a riddle for a cluster terraform has