Skip to content

Overhaul get-started example and make kpt.dev the docs source of truth - #769

Open
efiacor wants to merge 2 commits into
kptdev:mainfrom
Nordix:feat/get-started-and-docs-single-source
Open

Overhaul get-started example and make kpt.dev the docs source of truth#769
efiacor wants to merge 2 commits into
kptdev:mainfrom
Nordix:feat/get-started-and-docs-single-source

Conversation

@efiacor

@efiacor efiacor commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Two related changes to improve the getting-started experience for KRM function authors:

1. go/get-started is now a working hello-world function (was a no-op scaffold).
It builds a greeting from its functionConfig and stamps it as an annotation on every resource, so the golden test shows a real input→output diff. It implements fn.Runner (the recommended interface for transformers), demonstrates functionConfig-to-field mapping, and documents itself via README.md/metadata.yaml (surfaced through --help/--doc).

2. Documentation is now single-source on kpt.dev.
The developer guide (tutorial, interfaces, testing, containerizing) lives on the kpt documentation site under guides/krm-functions. To avoid two copies drifting, this removes the duplicated markdown from docs/ here and repoints the top-level README at the canonical pages on kpt.dev. The runnable example stays here as the source of truth for example code.

Companion docs PR: kptdev/kpt#4726 (adds the guide and reconciles the developing-functions chapter). That PR should merge first so the kpt.dev links resolve.

Testing

  • go build, go vet, and go test pass for go/get-started (golden test deterministic across runs).
  • --help and --doc verified against the updated README/metadata.
  • Confirmed no dangling links to the removed docs/*.md files remain.

Refs kptdev/kpt#4725


This PR was prepared with AI assistance.

Replace the no-op scaffold with a small, working hello-world mutator that
builds a greeting from its functionConfig and stamps it as an annotation on
every resource. The example now:
- implements fn.Runner (the recommended interface for transformers)
- demonstrates functionConfig-to-field mapping via JSON tags
- ships a golden test whose _expected.yaml shows a real input->output diff
- documents its behavior in README.md/metadata.yaml (used by --help/--doc)

Rename the testdata case from noop-passthrough to hello-world.

Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
The developer guide (tutorial, interfaces, testing, containerizing) now lives
on the kpt documentation site under guides/krm-functions. To avoid two copies
drifting apart, remove the duplicated markdown from this repo and point the
top-level README at the canonical pages on kpt.dev.

The runnable example (go/get-started) stays here as the source of truth for
example code.

Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
@efiacor
efiacor requested review from a team September 2, 2026 17:57
@efiacor efiacor added documentation Improvements or additions to documentation go Pull requests that update Go code labels Sep 2, 2026
@efiacor efiacor self-assigned this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant