Skip to content

feat: hint the resources layout for narrowed exports - #35

Merged
jwmoss merged 1 commit into
mainfrom
feat/resource-layout-hint
Sep 8, 2026
Merged

feat: hint the resources layout for narrowed exports#35
jwmoss merged 1 commit into
mainfrom
feat/resource-layout-hint

Conversation

@jwmoss

@jwmoss jwmoss commented Sep 8, 2026

Copy link
Copy Markdown
Member

Export hint

export prints one hint line after it writes the export:

Hint: this export selects one or more resource groups. Use --module-layout resources to call the individual Registry modules. See docs/module-layouts.md.

Conditions for the hint:

  • The user passed --resources or --name.
  • The effective --module-layout is workspace.
  • The export wrote its files. A partial export that blocks Terraform output prints no hint.

The hint uses the existing rc.progress() stderr channel, so --quiet and --json suppress it.
needsLayoutHint holds the condition.

Documentation

docs/resource-selection.md gains a "Selection and module layout" section. It states that
--resources and --name choose the objects, that --module-layout chooses the modules and the
Terraform addresses, and that a narrower selection does not change the layout. It includes the
--resources catalogs --module-layout resources --scaffold example and links to
docs/module-layouts.md.

Changelog

CHANGELOG.md is new. It uses the Keep a Changelog format and covers v0.1.0 through v0.5.0 from
the merged pull requests in each tag range, plus an Unreleased section for this change.
CONTRIBUTING.md gains one sentence that asks contributors to add an Unreleased entry with each
pull request.

Tests

TestExportHintsResourceLayout in internal/cli/export_test.go is table-driven. It covers
--resources, --name, the default groups, --module-layout resources, and --quiet. The two
positive cases failed before the change.

make check passes.

Intended for release v0.5.1. This pull request creates no tag and no release.

Print one hint after a written export when the user passes --resources or
--name and the effective layout is workspace. The hint uses the existing
progress channel, so --quiet and --json suppress it.

Document the --resources and --module-layout pairing in resource selection.
Add CHANGELOG.md for every published tag and an Unreleased section.
@jwmoss
jwmoss merged commit b30fad0 into main Sep 8, 2026
2 checks passed
@jwmoss
jwmoss deleted the feat/resource-layout-hint branch September 8, 2026 02:43
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.

1 participant