Use feature flags to land specs ahead of the implementation. The spec is real, runnable, and ships with the PR; CI just skips it until the flag flips.
-
Pick a flag name in kebab-case, descriptive of the feature: rename-detection, multi-tenant-config, progressive-streaming. Avoid generic names (new-feature, wip).
-
Add the flag to tests/e2e/features.yaml with false:
enabled:
rename-detection: false
Add a comment with a tracking link (issue number, PR, ticket) so future-you knows what the flag is gating.
-
Gate the spec with requires: [feature:<name>]:
spec_version: 1
name: rename-detection-basic
requires: [feature:rename-detection]
repo:
helper: two-commit-rename
steps:
- …
-
Verify the spec is skipped by default:
go test ./tests/e2e/ -run "TestE2E/<wave>/<spec>" -v
Expect --- SKIP with the message about the flag not being shipped.
-
Verify the spec runs when forced on:
<PREFIX>_E2E_FEATURES=rename-detection go test ./tests/e2e/ -run "TestE2E/<wave>/<spec>" -v
Substitute <PREFIX> with the project's EnvPrefix. The spec should now run (and may fail if the feature isn't implemented — that's expected).
-
When shipping the feature, flip the flag in the same PR that lands the implementation:
enabled:
rename-detection: true
The spec activates automatically on the next CI run; no spec edits needed.