Skip to content

docs(starters): gate function guidance in base scaffold README#12

Open
tkkhq wants to merge 2 commits into
mainfrom
docs/respond-pr-9
Open

docs(starters): gate function guidance in base scaffold README#12
tkkhq wants to merge 2 commits into
mainfrom
docs/respond-pr-9

Conversation

@tkkhq

@tkkhq tkkhq commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Tracking

Problem

The generated internal/projectinit/starters/base/volcano/README.md is shipped with every volcano init (the base starter is always applied first), so it is shared across base-only and template scaffolds. It described the directory as containing "configuration, functions" and unconditionally told users to run volcano functions deploy --all / volcano cloud functions deploy --all — misleading for bare volcano init, which creates no functions or config.

Changes

  • Update the "contents" line to list only what base actually creates: migrations and local variables.
  • Gate function deploy guidance behind If this project includes volcano/functions: — the same conditional pattern already used for config — so the README stays accurate for both base-only and template scaffolds.
  • Add a test assertion confirming functions guidance is gated and the stale "configuration, functions, migrations" line is gone.

Verification

  • make lint
  • go test ./...
  • go build ./...
  • go vet ./...

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.
Copilot AI review requested due to automatic review settings June 15, 2026 14:36
@tkkhq tkkhq requested a review from a team as a code owner June 15, 2026 14:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the base starter scaffold README so it remains accurate for both base-only volcano init projects and template-based scaffolds, particularly by avoiding misleading “deploy functions” guidance when no functions exist.

Changes:

  • Adjusts the base scaffold volcano/README.md description to reflect what base actually creates (migrations + local variables).
  • Gates functions deploy instructions behind a “If this project includes volcano/functions:” condition (matching the existing conditional style for volcano-config.yaml).
  • Extends projectinit tests to assert the updated README content (including removal of the stale “configuration, functions, migrations” phrase).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/projectinit/starters/base/volcano/README.md Updates base scaffold documentation to avoid unconditional functions guidance and improve section structure.
internal/projectinit/projectinit_test.go Adds assertions to ensure the generated base README contains the new gated functions guidance and removes stale text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to +43
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")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — addressed in c5a15ec. The heading-only Contains checks are replaced with structural assertions that verify each deploy command appears directly under its gating heading, plus strings.Count == 1 checks so reintroducing an unconditional copy (the exact failure mode raised) now fails the test. Applied symmetrically to both functions and config, local + cloud. Also restored the README to main's unfenced style to keep this PR's diff limited to the gating change.

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.
@tkkhq

tkkhq commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Replying to @copilot-pull-request-reviewer[bot]'s review: thanks — addressed in c5a15ec.

  • The test now asserts each deploy command appears directly under its gating heading (functions and config, local + cloud), and uses strings.Count == 1 so reintroducing an unconditional volcano functions deploy --all (or the cloud variant) would fail the build — closing the exact failure mode raised in the inline comment.
  • Reverted the README to main's unfenced style so this PR's diff stays limited to the gating change (no unrelated reformatting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants