From 25bedb7ad5da4c434ad222d36cc7a95cf84428cb Mon Sep 17 00:00:00 2001 From: Ted Kim Date: Mon, 15 Jun 2026 10:35:28 -0400 Subject: [PATCH 1/2] docs(starters): gate function guidance in base scaffold README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The base starter is applied on every volcano init, so its README is shared across base-only and template scaffolds. It described the directory as containing "configuration, functions" and unconditionally listed volcano functions deploy --all / cloud functions deploy --all, which is misleading for bare volcano init (no functions or config are created). Gate the function deploy guidance behind "If this project includes volcano/functions:" — the same conditional already used for config — so the README stays accurate for both base-only and template scaffolds. Update the contents line to list only what base actually creates (migrations and local variables), and add a test assertion to lock in the gated guidance. Addresses review feedback on #9. --- internal/projectinit/projectinit_test.go | 2 ++ .../starters/base/volcano/README.md | 29 +++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/internal/projectinit/projectinit_test.go b/internal/projectinit/projectinit_test.go index 2b45dd8..1bac442 100644 --- a/internal/projectinit/projectinit_test.go +++ b/internal/projectinit/projectinit_test.go @@ -39,6 +39,8 @@ func TestRunCreatesScaffold(t *testing.T) { readme := readProjectFile(t, dir, filepath.Join("volcano", "README.md")) assert.Contains(t, readme, "If this project includes volcano/volcano-config.yaml") + assert.Contains(t, readme, "If this project includes volcano/functions:") + assert.NotContains(t, readme, "configuration, functions, migrations") } func TestRunRejectsInvalidStarterNames(t *testing.T) { diff --git a/internal/projectinit/starters/base/volcano/README.md b/internal/projectinit/starters/base/volcano/README.md index f9a6cd4..5423173 100644 --- a/internal/projectinit/starters/base/volcano/README.md +++ b/internal/projectinit/starters/base/volcano/README.md @@ -1,25 +1,36 @@ # Volcano -This directory contains Volcano configuration, functions, migrations, and local variables. - -Local development: +This directory contains Volcano migrations and local variables. +## Local development +``` volcano start volcano variables deploy - volcano functions deploy --all volcano migrations deploy --all -d app +``` -If this project includes volcano/volcano-config.yaml: +If this project includes volcano/functions: +``` + volcano functions deploy --all +``` +If this project includes volcano/volcano-config.yaml: +``` volcano config deploy +``` -Cloud deployment: - +## Cloud deployment +``` volcano login volcano use volcano cloud variables deploy - volcano cloud functions deploy --all +``` +If this project includes volcano/functions: +``` + volcano cloud functions deploy --all +``` If this project includes volcano/volcano-config.yaml: - +``` volcano cloud config deploy +``` From c5a15ecc18a04e8ed61a0b8d18d64d612589ce69 Mon Sep 17 00:00:00 2001 From: Ted Kim Date: Mon, 15 Jun 2026 12:44:33 -0400 Subject: [PATCH 2/2] test(projectinit): verify deploy guidance is gated in scaffold README Address Copilot review on #12: the prior Contains checks only asserted the gating headings existed, not that the deploy commands sit behind them. Assert each function/config command appears under its gating heading (local + cloud) and that each command occurs exactly once, so reintroducing an unconditional copy would fail the test. Restore the base README to the unfenced style used on main; the prior commit had inadvertently rewritten the whole file with fenced code blocks and ## headings, adding unrelated reformatting noise to a gating-only change. --- internal/projectinit/projectinit_test.go | 11 +++++++-- .../starters/base/volcano/README.md | 23 ++++++++----------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/internal/projectinit/projectinit_test.go b/internal/projectinit/projectinit_test.go index 1bac442..fc40c82 100644 --- a/internal/projectinit/projectinit_test.go +++ b/internal/projectinit/projectinit_test.go @@ -3,6 +3,7 @@ package projectinit import ( "os" "path/filepath" + "strings" "testing" "github.com/stretchr/testify/assert" @@ -38,8 +39,14 @@ func TestRunCreatesScaffold(t *testing.T) { assert.Contains(t, ignore, "volcano.env") readme := readProjectFile(t, dir, filepath.Join("volcano", "README.md")) - assert.Contains(t, readme, "If this project includes volcano/volcano-config.yaml") - assert.Contains(t, readme, "If this project includes volcano/functions:") + assert.Contains(t, readme, "If this project includes volcano/functions:\n\n volcano functions deploy --all") + assert.Contains(t, readme, "If this project includes volcano/functions:\n\n volcano cloud functions deploy --all") + assert.Contains(t, readme, "If this project includes volcano/volcano-config.yaml:\n\n volcano config deploy") + assert.Contains(t, readme, "If this project includes volcano/volcano-config.yaml:\n\n volcano cloud config deploy") + assert.Equal(t, 1, strings.Count(readme, "volcano functions deploy --all")) + assert.Equal(t, 1, strings.Count(readme, "volcano cloud functions deploy --all")) + assert.Equal(t, 1, strings.Count(readme, "volcano config deploy")) + assert.Equal(t, 1, strings.Count(readme, "volcano cloud config deploy")) assert.NotContains(t, readme, "configuration, functions, migrations") } diff --git a/internal/projectinit/starters/base/volcano/README.md b/internal/projectinit/starters/base/volcano/README.md index 5423173..ccf57c4 100644 --- a/internal/projectinit/starters/base/volcano/README.md +++ b/internal/projectinit/starters/base/volcano/README.md @@ -2,35 +2,30 @@ This directory contains Volcano migrations and local variables. -## Local development -``` +Local development: + volcano start volcano variables deploy volcano migrations deploy --all -d app -``` If this project includes volcano/functions: -``` + volcano functions deploy --all -``` If this project includes volcano/volcano-config.yaml: -``` + volcano config deploy -``` -## Cloud deployment -``` +Cloud deployment: + volcano login volcano use volcano cloud variables deploy -``` If this project includes volcano/functions: -``` + volcano cloud functions deploy --all -``` + If this project includes volcano/volcano-config.yaml: -``` + volcano cloud config deploy -```