Skip to content

docs: restructure documentation with updated command references#423

Open
istein1 wants to merge 3 commits into
migtools:mainfrom
istein1:docs/restructure-v2
Open

docs: restructure documentation with updated command references#423
istein1 wants to merge 3 commits into
migtools:mainfrom
istein1:docs/restructure-v2

Conversation

@istein1

@istein1 istein1 commented May 31, 2026

Copy link
Copy Markdown
Member

Summary

  • Reorganizes documentation into a discoverable structure with commands/, development/, and flat user-facing docs under docs/
  • Adds CONTRIBUTING.md at root for GitHub integration and contributor onboarding
  • Creates command references for all 5 commands (export, transform, apply, validate, transfer-pvc)
  • Adds development guides (architecture, setup, testing, plugin development)
  • Adds concept docs (multi-stage pipeline, plugins, resource compatibility)
  • Updates README.md with documentation links section

New structure

crane/
├── CONTRIBUTING.md
├── README.md (updated with docs links)
└── docs/
    ├── README.md
    ├── development/{README, architecture, setup, testing, plugin-development}.md
    ├── commands/{export, transform, apply, validate, transfer-pvc}.md
    ├── installation.md
    ├── multistage-pipeline.md
    ├── plugins.md
    └── resource-compatibility.md

Content updates reflecting current codebase

  • crane apply uses embedded kustomize via krusty API (no kubectl dependency)
  • crane apply documents --skip-cluster-scoped and --kustomize-args flags
  • crane validate documents offline validation mode via --api-resources
  • crane export documents CRD collection behavior and _cluster/ subdirectory
  • All Go version references updated to 1.25+
  • All internal cross-references verified (no broken links)

Test plan

  • All internal markdown links resolve (verified — no broken links)
  • No stale references to kubectl kustomize in descriptions of internal behavior
  • go build ./... passes (docs-only change, no code impact)
  • Review rendered markdown on GitHub for formatting

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a new contributing guide plus a development guide covering setup, testing, architecture, and plugin development.
    • Introduced an expanded documentation index and command reference for export, transform, apply, validate, and transfer-pvc, including detailed examples and flag descriptions.
    • Added multi-stage pipeline documentation and a plugin overview.
    • Added a resource compatibility matrix and clarified the crane apply behavior as running embedded kustomize.

@coderabbitai

coderabbitai Bot commented May 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 96359c94-48bb-4c4d-848f-40a59f685d6c

📥 Commits

Reviewing files that changed from the base of the PR and between 5b76ad6 and 521edcb.

📒 Files selected for processing (17)
  • CONTRIBUTING.md
  • README.md
  • docs/README.md
  • docs/commands/apply.md
  • docs/commands/export.md
  • docs/commands/transfer-pvc.md
  • docs/commands/transform.md
  • docs/commands/validate.md
  • docs/development/README.md
  • docs/development/architecture.md
  • docs/development/plugin-development.md
  • docs/development/setup.md
  • docs/development/testing.md
  • docs/installation.md
  • docs/multistage-pipeline.md
  • docs/plugins.md
  • docs/resource-compatibility.md
✅ Files skipped from review due to trivial changes (15)
  • CONTRIBUTING.md
  • docs/development/README.md
  • docs/README.md
  • docs/development/architecture.md
  • docs/installation.md
  • docs/resource-compatibility.md
  • docs/development/testing.md
  • docs/commands/transfer-pvc.md
  • docs/commands/export.md
  • docs/commands/validate.md
  • docs/development/setup.md
  • docs/development/plugin-development.md
  • docs/plugins.md
  • docs/commands/transform.md
  • docs/multistage-pipeline.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • README.md
  • docs/commands/apply.md

📝 Walkthrough

Walkthrough

Adds comprehensive documentation for Crane, a Kubernetes migration tool, including user guides (installation, CLI commands), conceptual documentation (plugins, resource compatibility, multi-stage pipeline), and developer resources (architecture, setup, testing, plugin development, contribution guidelines). All changes are documentation-only.

Changes

Crane Documentation Suite

Layer / File(s) Summary
Getting Started and Entry Points
CONTRIBUTING.md, README.md, docs/README.md, docs/installation.md
Introduces contribution workflow and guidelines, updates README to document embedded kustomize and adds a docs navigation section, creates a documentation landing page with pipeline overview and table of contents, and provides step-by-step installation instructions from both release binaries and source.
Command Reference Documentation
docs/commands/export.md, docs/commands/transform.md, docs/commands/apply.md, docs/commands/validate.md, docs/commands/transfer-pvc.md
Comprehensive CLI documentation for all five Crane commands covering command purpose, flag descriptions, output directory/file structures, usage examples, common error messages with causes and solutions, and next-step guidance linking the migration pipeline stages.
System Architecture and Pipeline Design
docs/plugins.md, docs/resource-compatibility.md, docs/multistage-pipeline.md
Documents Crane's plugin system (discovery, execution model, stdin/stdout interface, custom plugin development in Go/Bash), resource compatibility rules (namespace-scoped resources fully supported, cluster-scoped resources conditionally migrated based on RBAC and functional linkage), and multi-stage Kustomize pipeline architecture including stage priorities, automatic chaining, and patch generation workflows.
Developer Setup and Contribution Guides
docs/development/README.md, docs/development/architecture.md, docs/development/setup.md, docs/development/testing.md, docs/development/plugin-development.md
Provides developer navigation index, end-to-end pipeline architecture documentation with data-flow diagram, local development environment setup (prerequisites, build/test/format commands, IDE configuration), unit and E2E testing conventions with examples, and complete plugin development guide including interface contracts, Go and Bash examples, testing approaches, and best practices.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • migtools/crane#230: This PR fully documents the crane validate command in docs/commands/validate.md, including both live validation via target cluster API discovery and offline validation using captured API resources.

Possibly related PRs

  • migtools/crane#221: Both PRs define Crane's resource compatibility matrix, specifying namespace-scoped resources as fully supported and cluster-scoped resources as conditionally supported based on functional linkage and RBAC context.
  • migtools/crane#388: The main PR updates crane apply documentation to reference embedded kustomize (rather than kubectl kustomize), aligning with the retrieved PR's code changes embedding kustomize via internal implementation.

Suggested reviewers

  • stillalearner
  • aufi
  • midays

Poem

📚 A rabbit hops through docs so bright,
Install and contribute—the path is in sight!
From export to validate, each stage laid clear,
With plugins that morph resources far and near.
Build Kubernetes migrations with Crane's might! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: restructuring documentation with updated command references. It directly reflects the PR's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 31, 2026

Copy link
Copy Markdown

Test Coverage Report

Total: 46.9%

Per-package coverage

  • github.com/konveyor/crane — 0.0%
  • github.com/konveyor/crane/cmd/apply — 52.7%
  • github.com/konveyor/crane/cmd/convert — 0.0%
  • github.com/konveyor/crane/cmd/export — 92.9%
  • github.com/konveyor/crane/cmd/plugin-manager — 0.0%
  • github.com/konveyor/crane/cmd/plugin-manager/add — 0.0%
  • github.com/konveyor/crane/cmd/plugin-manager/list — 0.0%
  • github.com/konveyor/crane/cmd/plugin-manager/remove — 0.0%
  • github.com/konveyor/crane/cmd/skopeo-sync-gen — 0.0%
  • github.com/konveyor/crane/cmd/transfer-pvc — 9.2%
  • github.com/konveyor/crane/cmd/transform — 54.9%
  • github.com/konveyor/crane/cmd/transform/listplugins — 23.0%
  • github.com/konveyor/crane/cmd/transform/optionals — 0.0%
  • github.com/konveyor/crane/cmd/tunnel-api — 0.0%
  • github.com/konveyor/crane/cmd/validate — 62.7%
  • github.com/konveyor/crane/cmd/version — 20.0%
  • github.com/konveyor/crane/internal/apply — 33.6%
  • github.com/konveyor/crane/internal/buildinfo — 100.0%
  • github.com/konveyor/crane/internal/file — 71.4%
  • github.com/konveyor/crane/internal/flags — 0.0%
  • github.com/konveyor/crane/internal/kustomize — 85.7%
  • github.com/konveyor/crane/internal/plugin — 32.9%
  • github.com/konveyor/crane/internal/transform — 80.9%
  • github.com/konveyor/crane/internal/validate — 58.6%
Full function-level details
github.com/konveyor/crane/cmd/apply/apply.go:42:			Complete					100.0%
github.com/konveyor/crane/cmd/apply/apply.go:48:			Validate					87.5%
github.com/konveyor/crane/cmd/apply/apply.go:62:			Run						0.0%
github.com/konveyor/crane/cmd/apply/apply.go:66:			NewApplyCommand					0.0%
github.com/konveyor/crane/cmd/apply/apply.go:107:			getStageNames					100.0%
github.com/konveyor/crane/cmd/apply/apply.go:115:			addFlagsForOptions				0.0%
github.com/konveyor/crane/cmd/apply/apply.go:129:			run						81.4%
github.com/konveyor/crane/cmd/convert/convert.go:30:			NewConvertOptions				0.0%
github.com/konveyor/crane/cmd/convert/convert.go:63:			addFlagsForConvertOptions			0.0%
github.com/konveyor/crane/cmd/convert/convert.go:74:			Complete					0.0%
github.com/konveyor/crane/cmd/convert/convert.go:83:			Run						0.0%
github.com/konveyor/crane/cmd/convert/convert.go:87:			run						0.0%
github.com/konveyor/crane/cmd/convert/convert.go:112:			getClientFromContext				0.0%
github.com/konveyor/crane/cmd/convert/convert.go:134:			getRestConfigFromContext			0.0%
github.com/konveyor/crane/cmd/export/cluster.go:29:			NewClusterScopeHandler				100.0%
github.com/konveyor/crane/cmd/export/cluster.go:35:			isClusterScopedResource				100.0%
github.com/konveyor/crane/cmd/export/cluster.go:44:			filterRbacResources				100.0%
github.com/konveyor/crane/cmd/export/cluster.go:102:			NewClusterScopedRbacHandler			100.0%
github.com/konveyor/crane/cmd/export/cluster.go:113:			exportedSANamespaces				100.0%
github.com/konveyor/crane/cmd/export/cluster.go:126:			groupMatchesExportedSANamespaces		100.0%
github.com/konveyor/crane/cmd/export/cluster.go:143:			parseServiceAccountUserSubject			100.0%
github.com/konveyor/crane/cmd/export/cluster.go:154:			prepareForFiltering				100.0%
github.com/konveyor/crane/cmd/export/cluster.go:187:			filteredResourcesOfKind				100.0%
github.com/konveyor/crane/cmd/export/cluster.go:213:			accept						100.0%
github.com/konveyor/crane/cmd/export/cluster.go:223:			acceptClusterRoleBinding			100.0%
github.com/konveyor/crane/cmd/export/cluster.go:260:			acceptClusterRole				100.0%
github.com/konveyor/crane/cmd/export/cluster.go:284:			acceptSecurityContextConstraints		100.0%
github.com/konveyor/crane/cmd/export/cluster.go:336:			anyServiceAccountInNamespace			100.0%
github.com/konveyor/crane/cmd/export/crd.go:17:				normalizeGroupSet				85.7%
github.com/konveyor/crane/cmd/export/crd.go:29:				shouldSkipCRDGroup				100.0%
github.com/konveyor/crane/cmd/export/crd.go:50:				crdFailureAPIResourceName			100.0%
github.com/konveyor/crane/cmd/export/crd.go:56:				getOperatorManager				92.9%
github.com/konveyor/crane/cmd/export/crd.go:88:				collectRelatedCRDs				90.6%
github.com/konveyor/crane/cmd/export/discover.go:40:			hasClusterScopedManifests			100.0%
github.com/konveyor/crane/cmd/export/discover.go:58:			prepareClusterResourceDir			100.0%
github.com/konveyor/crane/cmd/export/discover.go:74:			prepareFailuresDir				100.0%
github.com/konveyor/crane/cmd/export/discover.go:86:			writeResources					85.7%
github.com/konveyor/crane/cmd/export/discover.go:134:			writeErrors					83.3%
github.com/konveyor/crane/cmd/export/discover.go:176:			getFilePath					95.2%
github.com/konveyor/crane/cmd/export/discover.go:214:			discoverPreferredResources			100.0%
github.com/konveyor/crane/cmd/export/discover.go:243:			resourceToExtract				100.0%
github.com/konveyor/crane/cmd/export/discover.go:312:			isAdmittedResource				100.0%
github.com/konveyor/crane/cmd/export/discover.go:321:			getObjects					100.0%
github.com/konveyor/crane/cmd/export/discover.go:355:			iterateItemsByGet				93.8%
github.com/konveyor/crane/cmd/export/discover.go:381:			iterateItemsInList				92.3%
github.com/konveyor/crane/cmd/export/export.go:53:			Complete					90.0%
github.com/konveyor/crane/cmd/export/export.go:92:			Validate					100.0%
github.com/konveyor/crane/cmd/export/export.go:122:			validateExportNamespace				87.5%
github.com/konveyor/crane/cmd/export/export.go:139:			allResourceListsForbidden			87.5%
github.com/konveyor/crane/cmd/export/export.go:157:			Run						0.0%
github.com/konveyor/crane/cmd/export/export.go:270:			NewExportCommand				54.2%
github.com/konveyor/crane/cmd/plugin-manager/add/add.go:43:		Complete					0.0%
github.com/konveyor/crane/cmd/plugin-manager/add/add.go:48:		Validate					0.0%
github.com/konveyor/crane/cmd/plugin-manager/add/add.go:91:		Run						0.0%
github.com/konveyor/crane/cmd/plugin-manager/add/add.go:95:		NewAddCommand					0.0%
github.com/konveyor/crane/cmd/plugin-manager/add/add.go:127:		addFlagsForOptions				0.0%
github.com/konveyor/crane/cmd/plugin-manager/add/add.go:132:		run						0.0%
github.com/konveyor/crane/cmd/plugin-manager/add/add.go:204:		downloadBinary					0.0%
github.com/konveyor/crane/cmd/plugin-manager/add/add.go:253:		binaryURIForPlatform				0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:46:		Complete					0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:51:		Validate					0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:56:		Run						0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:60:		NewListCommand					0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:90:		addFlagsForOptions				0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:98:		run						0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:167:		printInstalledInformation			0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:177:		groupInformationForPlugins			0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:196:		printInformation				0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:208:		printParamsInformation				0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:222:		getOptionalFields				0.0%
github.com/konveyor/crane/cmd/plugin-manager/list/list.go:247:		printTable					0.0%
github.com/konveyor/crane/cmd/plugin-manager/plugin-manager.go:33:	Complete					0.0%
github.com/konveyor/crane/cmd/plugin-manager/plugin-manager.go:38:	Validate					0.0%
github.com/konveyor/crane/cmd/plugin-manager/plugin-manager.go:43:	Run						0.0%
github.com/konveyor/crane/cmd/plugin-manager/plugin-manager.go:47:	NewPluginManagerCommand				0.0%
github.com/konveyor/crane/cmd/plugin-manager/plugin-manager.go:78:	addFlagsForOptions				0.0%
github.com/konveyor/crane/cmd/plugin-manager/plugin-manager.go:86:	run						0.0%
github.com/konveyor/crane/cmd/plugin-manager/remove/remove.go:33:	Complete					0.0%
github.com/konveyor/crane/cmd/plugin-manager/remove/remove.go:38:	Validate					0.0%
github.com/konveyor/crane/cmd/plugin-manager/remove/remove.go:43:	Run						0.0%
github.com/konveyor/crane/cmd/plugin-manager/remove/remove.go:47:	NewRemoveCommand				0.0%
github.com/konveyor/crane/cmd/plugin-manager/remove/remove.go:77:	run						0.0%
github.com/konveyor/crane/cmd/skopeo-sync-gen/skopeo-sync-gen.go:61:	Complete					0.0%
github.com/konveyor/crane/cmd/skopeo-sync-gen/skopeo-sync-gen.go:65:	Validate					0.0%
github.com/konveyor/crane/cmd/skopeo-sync-gen/skopeo-sync-gen.go:69:	NewSkopeoSyncGenCommand				0.0%
github.com/konveyor/crane/cmd/skopeo-sync-gen/skopeo-sync-gen.go:103:	shouldAddImageStream				0.0%
github.com/konveyor/crane/cmd/skopeo-sync-gen/skopeo-sync-gen.go:114:	Run						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:37:		NewRsyncLogStream				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:50:		Init						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:138:		writeProgressToFile				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:148:		Close						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:154:		Streams						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:190:		addDataSize					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:215:		String						100.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:219:		MarshalJSON					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:223:		AsString					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:271:		NewProgress					100.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:291:		Completed					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:296:		Status						38.5%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:321:		Merge						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:376:		newDataSize					72.7%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:399:		parseRsyncLogs					76.1%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:479:		waitForPodRunning				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/progress.go:513:		getFinalPodStatus				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:89:		Validate					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:117:		Validate					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:133:		NewTransferPVCCommand				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:169:		addFlagsToTransferPVCCommand			0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:189:		Complete					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:220:		Validate					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:246:		Run						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:250:		getClientFromContext				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:271:		getRestConfigFromContext			0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:278:		run						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:485:		getValidatedResourceName			0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:495:		getNodeNameForPVC				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:515:		getIDsForNamespace				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:541:		getRsyncClientPodSecurityContext		0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:553:		getRsyncServerPodSecurityContext		0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:565:		garbageCollect					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:602:		deleteResourcesIteratively			0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:628:		deleteResourcesForGVK				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:649:		followClientLogs				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:678:		waitForEndpoint					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:690:		createEndpoint					0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:735:		getRouteHostName				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:752:		buildDestinationPVC				0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:773:		ApplyTo						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:793:		ApplyTo						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:805:		ApplyTo						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:821:		String						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:825:		Set						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:835:		Type						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:841:		parseSourceDestinationMapping			100.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:863:		String						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:867:		Set						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:876:		Type						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:880:		String						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:884:		Set						0.0%
github.com/konveyor/crane/cmd/transfer-pvc/transfer-pvc.go:894:		Type						0.0%
github.com/konveyor/crane/cmd/transform/listplugins/listplugins.go:33:	Complete					0.0%
github.com/konveyor/crane/cmd/transform/listplugins/listplugins.go:38:	Validate					0.0%
github.com/konveyor/crane/cmd/transform/listplugins/listplugins.go:43:	Run						0.0%
github.com/konveyor/crane/cmd/transform/listplugins/listplugins.go:47:	NewListPluginsCommand				0.0%
github.com/konveyor/crane/cmd/transform/listplugins/listplugins.go:80:	GetPluginNames					85.7%
github.com/konveyor/crane/cmd/transform/listplugins/listplugins.go:95:	getFilteredPlugins				75.0%
github.com/konveyor/crane/cmd/transform/listplugins/listplugins.go:104:	run						0.0%
github.com/konveyor/crane/cmd/transform/optionals/optionals.go:31:	Complete					0.0%
github.com/konveyor/crane/cmd/transform/optionals/optionals.go:36:	Validate					0.0%
github.com/konveyor/crane/cmd/transform/optionals/optionals.go:41:	Run						0.0%
github.com/konveyor/crane/cmd/transform/optionals/optionals.go:45:	NewOptionalsCommand				0.0%
github.com/konveyor/crane/cmd/transform/optionals/optionals.go:77:	run						0.0%
github.com/konveyor/crane/cmd/transform/transform.go:56:		Complete					0.0%
github.com/konveyor/crane/cmd/transform/transform.go:62:		Validate					83.3%
github.com/konveyor/crane/cmd/transform/transform.go:81:		Run						0.0%
github.com/konveyor/crane/cmd/transform/transform.go:86:		getPluginCompletions				100.0%
github.com/konveyor/crane/cmd/transform/transform.go:111:		NewTransformCommand				0.0%
github.com/konveyor/crane/cmd/transform/transform.go:154:		addFlagsForOptions				0.0%
github.com/konveyor/crane/cmd/transform/transform.go:173:		run						11.8%
github.com/konveyor/crane/cmd/transform/transform.go:324:		optionalFlagsToLower				0.0%
github.com/konveyor/crane/cmd/transform/transform.go:334:		runStageWithCleanup				0.0%
github.com/konveyor/crane/cmd/transform/transform.go:350:		reconcileInstructionStages			80.0%
github.com/konveyor/crane/cmd/transform/transform.go:398:		ensurePreviousStagesRun				83.3%
github.com/konveyor/crane/cmd/transform/transform.go:415:		ensureStagesHaveOutput				92.9%
github.com/konveyor/crane/cmd/transform/transform.go:454:		createDefaultStagesForAllPlugins		94.7%
github.com/konveyor/crane/cmd/transform/transform.go:506:		validateStageNameToken				100.0%
github.com/konveyor/crane/cmd/transform/transform.go:521:		findStageByDirName				100.0%
github.com/konveyor/crane/cmd/transform/transform.go:533:		findStagesByName				100.0%
github.com/konveyor/crane/cmd/transform/transform.go:545:		createStageDirectory				77.8%
github.com/konveyor/crane/cmd/transform/transform.go:566:		createCustomStageWithExplicitName		100.0%
github.com/konveyor/crane/cmd/transform/transform.go:582:		createCustomStageWithAutoPriority		71.4%
github.com/konveyor/crane/cmd/transform/transform.go:604:		createPluginStage				0.0%
github.com/konveyor/crane/cmd/transform/transform.go:637:		resolveAndValidateStages			57.3%
github.com/konveyor/crane/cmd/tunnel-api/tunnel-api.go:35:		NewTunnelAPIOptions				0.0%
github.com/konveyor/crane/cmd/tunnel-api/tunnel-api.go:65:		addFlagsForTunnelAPIOptions			0.0%
github.com/konveyor/crane/cmd/tunnel-api/tunnel-api.go:77:		Complete					0.0%
github.com/konveyor/crane/cmd/tunnel-api/tunnel-api.go:100:		Validate					0.0%
github.com/konveyor/crane/cmd/tunnel-api/tunnel-api.go:116:		Run						0.0%
github.com/konveyor/crane/cmd/tunnel-api/tunnel-api.go:120:		getClientFromContext				0.0%
github.com/konveyor/crane/cmd/tunnel-api/tunnel-api.go:129:		getRestConfigFromContext			0.0%
github.com/konveyor/crane/cmd/tunnel-api/tunnel-api.go:136:		run						0.0%
github.com/konveyor/crane/cmd/validate/validate.go:37:			Complete					83.3%
github.com/konveyor/crane/cmd/validate/validate.go:49:			Validate					100.0%
github.com/konveyor/crane/cmd/validate/validate.go:91:			Run						17.5%
github.com/konveyor/crane/cmd/validate/validate.go:194:			NewValidateCommand				50.0%
github.com/konveyor/crane/cmd/version/version.go:20:			Complete					0.0%
github.com/konveyor/crane/cmd/version/version.go:25:			Validate					0.0%
github.com/konveyor/crane/cmd/version/version.go:30:			Run						0.0%
github.com/konveyor/crane/cmd/version/version.go:34:			NewVersionCommand				0.0%
github.com/konveyor/crane/cmd/version/version.go:60:			run						100.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:20:			CreateTempDir					100.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:27:			ListFilesRecursively				91.7%
github.com/konveyor/crane/e2e-tests/utils/utils.go:50:			ListFilesRecursivelyAsList			80.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:74:			HasFilesRecursively				80.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:85:			ReadTestdataFile				88.9%
github.com/konveyor/crane/e2e-tests/utils/utils.go:104:			TestdataFilePath				0.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:124:			GoldenManifestsDir				90.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:143:			CompareDirectoryFileSets			78.9%
github.com/konveyor/crane/e2e-tests/utils/utils.go:178:			CompareDirectoryYAMLSemantics			82.4%
github.com/konveyor/crane/e2e-tests/utils/utils.go:212:			CompareDirectoryYAMLSemanticsExport		89.3%
github.com/konveyor/crane/e2e-tests/utils/utils.go:264:			buildNormalizedExportIndex			81.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:304:			canonicalizeDocs				87.5%
github.com/konveyor/crane/e2e-tests/utils/utils.go:318:			extractResourceIdentity				77.8%
github.com/konveyor/crane/e2e-tests/utils/utils.go:381:			parseYAMLDocuments				100.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:400:			compareYAMLFileBytes				100.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:420:			AssertNoKindsInOutput				0.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:476:			AssertKindsInOutput				0.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:528:			LooksLikeYAMLFile				100.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:542:			normalizeUnstableFields				100.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:579:			normalizePodServiceAccountVolumeNames		90.9%
github.com/konveyor/crane/e2e-tests/utils/utils.go:638:			normalizeWithPath				92.9%
github.com/konveyor/crane/e2e-tests/utils/utils.go:668:			shouldDropField					100.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:719:			AssertWhiteoutResourceFilesExist		0.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:759:			AssertWhiteoutResourceFileCount			0.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:791:			AssertWhiteoutCommentsInKustomization		0.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:846:			AssertKindsNotInActiveKustomizeResources	0.0%
github.com/konveyor/crane/e2e-tests/utils/utils.go:888:			CaptureAPISurfaceScriptPath			75.0%
github.com/konveyor/crane/internal/apply/kustomize.go:30:		ApplySingleStage				0.0%
github.com/konveyor/crane/internal/apply/kustomize.go:79:		ApplyMultiStage					0.0%
github.com/konveyor/crane/internal/apply/kustomize.go:133:		runKustomizeBuild				0.0%
github.com/konveyor/crane/internal/apply/kustomize.go:142:		filterClusterScopedResources			82.4%
github.com/konveyor/crane/internal/apply/kustomize.go:198:		splitMultiDocYAMLToFiles			85.7%
github.com/konveyor/crane/internal/buildinfo/buildinfo.go:25:		readKustomizeVersion				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:22:		ReadFiles					100.0%
github.com/konveyor/crane/internal/file/file_helper.go:32:		readFiles					84.0%
github.com/konveyor/crane/internal/file/file_helper.go:83:		GetWhiteOutFilePath				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:87:		GetTransformPath				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:91:		GetIgnoredPatchesPath				0.0%
github.com/konveyor/crane/internal/file/file_helper.go:95:		updateTransformDirPath				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:99:		updateIgnoredPatchesDirPath			0.0%
github.com/konveyor/crane/internal/file/file_helper.go:106:		updatePath					100.0%
github.com/konveyor/crane/internal/file/file_helper.go:113:		GetOutputFilePath				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:123:		GetStageDir					100.0%
github.com/konveyor/crane/internal/file/file_helper.go:129:		GetResourcesDir					100.0%
github.com/konveyor/crane/internal/file/file_helper.go:135:		GetPatchesDir					100.0%
github.com/konveyor/crane/internal/file/file_helper.go:141:		GetReportsDir					100.0%
github.com/konveyor/crane/internal/file/file_helper.go:147:		GetWhiteoutsDir					100.0%
github.com/konveyor/crane/internal/file/file_helper.go:153:		GetKustomizationPath				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:159:		GetMetadataPath					100.0%
github.com/konveyor/crane/internal/file/file_helper.go:165:		GetResourceTypeFilePath				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:171:		GetPatchFilePath				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:177:		GetWhiteoutReportPath				100.0%
github.com/konveyor/crane/internal/file/file_helper.go:183:		GetIgnoredPatchReportPath			100.0%
github.com/konveyor/crane/internal/file/file_helper.go:189:		GetStageWorkDir					0.0%
github.com/konveyor/crane/internal/file/file_helper.go:195:		GetStageInputDir				0.0%
github.com/konveyor/crane/internal/file/file_helper.go:202:		GetStageTransformDir				0.0%
github.com/konveyor/crane/internal/file/file_helper.go:208:		GetStageOutputDir				0.0%
github.com/konveyor/crane/internal/file/file_helper.go:215:		GetResourceFilename				0.0%
github.com/konveyor/crane/internal/flags/global_flags.go:14:		ApplyFlags					0.0%
github.com/konveyor/crane/internal/flags/global_flags.go:21:		GetLogger					0.0%
github.com/konveyor/crane/internal/flags/global_flags.go:29:		initConfig					0.0%
github.com/konveyor/crane/internal/flags/help_groups.go:12:		KubernetesClientInheritedFlagNames		0.0%
github.com/konveyor/crane/internal/flags/help_groups.go:40:		SetGroupedHelp					0.0%
github.com/konveyor/crane/internal/kustomize/args.go:20:		ParseAndValidateArgs				100.0%
github.com/konveyor/crane/internal/kustomize/args.go:92:		splitArgs					100.0%
github.com/konveyor/crane/internal/kustomize/runner.go:21:		Build						82.4%
github.com/konveyor/crane/internal/kustomize/runner.go:55:		buildOptions					100.0%
github.com/konveyor/crane/internal/kustomize/runner.go:105:		setEnvVars					46.2%
github.com/konveyor/crane/internal/plugin/plugin_helper.go:21:		GetPlugins					0.0%
github.com/konveyor/crane/internal/plugin/plugin_helper.go:38:		getBinaryPlugins				0.0%
github.com/konveyor/crane/internal/plugin/plugin_helper.go:63:		IsExecAny					0.0%
github.com/konveyor/crane/internal/plugin/plugin_helper.go:67:		GetFilteredPlugins				0.0%
github.com/konveyor/crane/internal/plugin/plugin_helper.go:109:		isPluginInList					0.0%
github.com/konveyor/crane/internal/plugin/plugin_manager_helper.go:24:	BuildManifestMap				0.0%
github.com/konveyor/crane/internal/plugin/plugin_manager_helper.go:68:	GetYamlFromUrl					75.0%
github.com/konveyor/crane/internal/plugin/plugin_manager_helper.go:82:	YamlToManifest					72.7%
github.com/konveyor/crane/internal/plugin/plugin_manager_helper.go:104:	FilterPluginForOsArch				100.0%
github.com/konveyor/crane/internal/plugin/plugin_manager_helper.go:119:	GetDefaultSource				0.0%
github.com/konveyor/crane/internal/plugin/plugin_manager_helper.go:128:	LocateBinaryInPluginDir				0.0%
github.com/konveyor/crane/internal/plugin/plugin_manager_helper.go:140:	IsUrl						100.0%
github.com/konveyor/crane/internal/plugin/plugin_manager_helper.go:146:	getData						80.0%
github.com/konveyor/crane/internal/transform/instructions.go:31:	LoadInstructions				61.1%
github.com/konveyor/crane/internal/transform/instructions.go:63:	friendlyInstructionsDecodeError			87.5%
github.com/konveyor/crane/internal/transform/instructions.go:78:	ValidateInstructions				100.0%
github.com/konveyor/crane/internal/transform/instructions.go:112:	GenerateStageDirNames				100.0%
github.com/konveyor/crane/internal/transform/orchestrator.go:41:	RunMultiStage					75.0%
github.com/konveyor/crane/internal/transform/orchestrator.go:147:	executeStage					72.7%
github.com/konveyor/crane/internal/transform/orchestrator.go:199:	transformResources				68.4%
github.com/konveyor/crane/internal/transform/orchestrator.go:250:	formatResourceID				0.0%
github.com/konveyor/crane/internal/transform/orchestrator.go:257:	getPluginForStage				90.9%
github.com/konveyor/crane/internal/transform/orchestrator.go:284:	getAvailablePluginNames				0.0%
github.com/konveyor/crane/internal/transform/orchestrator.go:297:	applyStageTransforms				82.1%
github.com/konveyor/crane/internal/transform/orchestrator.go:364:	loadResourcesFromDirectory			85.7%
github.com/konveyor/crane/internal/transform/orchestrator.go:379:	writeResourcesToDirectory			73.1%
github.com/konveyor/crane/internal/transform/stages.go:22:		DiscoverStages					90.5%
github.com/konveyor/crane/internal/transform/stages.go:83:		FilterStages					100.0%
github.com/konveyor/crane/internal/transform/stages.go:112:		GetFirstStage					100.0%
github.com/konveyor/crane/internal/transform/stages.go:122:		GetLastStage					66.7%
github.com/konveyor/crane/internal/transform/stages.go:132:		GetPreviousStage				100.0%
github.com/konveyor/crane/internal/transform/stages.go:142:		GetNextStage					100.0%
github.com/konveyor/crane/internal/transform/stages.go:152:		ValidateStageName				100.0%
github.com/konveyor/crane/internal/transform/stages.go:161:		GenerateStageName				100.0%
github.com/konveyor/crane/internal/transform/test_helpers.go:8:		hasKustomizeCommand				100.0%
github.com/konveyor/crane/internal/transform/test_helpers.go:14:	contains					100.0%
github.com/konveyor/crane/internal/transform/test_helpers.go:23:	findInString					100.0%
github.com/konveyor/crane/internal/transform/writer.go:28:		NewKustomizeWriter				100.0%
github.com/konveyor/crane/internal/transform/writer.go:37:		WriteStage					68.4%
github.com/konveyor/crane/internal/transform/writer.go:218:		getResourceID					100.0%
github.com/konveyor/crane/internal/transform/writer.go:231:		filterValidRemoveOps				76.2%
github.com/konveyor/crane/internal/transform/writer.go:275:		pathExists					93.5%
github.com/konveyor/crane/internal/transform/writer.go:352:		generateKustomizationWithComments		93.8%
github.com/konveyor/crane/internal/transform/writer.go:383:		checkStageDirectory				23.1%
github.com/konveyor/crane/internal/validate/api_resources.go:24:	ParseAPIResourcesJSON				89.7%
github.com/konveyor/crane/internal/validate/matcher.go:25:		MatchResults					75.0%
github.com/konveyor/crane/internal/validate/matcher.go:36:		MatchResultsFromIndex				100.0%
github.com/konveyor/crane/internal/validate/matcher.go:76:		buildDiscoveryIndex				71.4%
github.com/konveyor/crane/internal/validate/matcher.go:110:		matchEntry					100.0%
github.com/konveyor/crane/internal/validate/matcher.go:139:		buildKindIndex					100.0%
github.com/konveyor/crane/internal/validate/matcher.go:151:		addSuggestion					92.3%
github.com/konveyor/crane/internal/validate/report.go:17:		FormatTable					91.3%
github.com/konveyor/crane/internal/validate/report.go:60:		FormatJSON					100.0%
github.com/konveyor/crane/internal/validate/report.go:67:		FormatYAML					0.0%
github.com/konveyor/crane/internal/validate/report.go:79:		WriteFailures					0.0%
github.com/konveyor/crane/internal/validate/report.go:115:		failureFileName					0.0%
github.com/konveyor/crane/internal/validate/report.go:129:		safeFilePart					0.0%
github.com/konveyor/crane/internal/validate/report.go:145:		parseAPIVersion					0.0%
github.com/konveyor/crane/internal/validate/scanner.go:34:		ScanManifests					76.5%
github.com/konveyor/crane/internal/validate/types.go:46:		HasIncompatible					100.0%
github.com/konveyor/crane/internal/validate/types.go:49:		IncompatibleResults				0.0%
github.com/konveyor/crane/main.go:21:					main						0.0%
total:									(statements)					46.9%

Posted by CI

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/development/plugin-development.md (1)

181-188: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Best practices contradict the code examples.

Best practice #2 states "Defensive: Check if fields exist before removing them," but this principle should also apply to add operations. The Go and Bash examples earlier in the document add labels without checking if /metadata/labels exists, which violates defensive programming and will cause patches to fail.

Consider adding:

  • "Check if parent objects exist before adding fields" as an explicit best practice
  • Or revise #2 to: "Defensive: Check if fields and parent objects exist before modifying them"
♻️ Proposed expanded best practices
 ## Best Practices
 
 1. **Idempotent**: Running the plugin multiple times should produce the same result
-2. **Defensive**: Check if fields exist before removing them
+2. **Defensive**: Check if fields and parent objects exist before modifying them
 3. **Focused**: Each plugin should handle one concern
 4. **Documented**: Include usage instructions and examples
 5. **Tested**: Cover edge cases (missing fields, different resource types)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/development/plugin-development.md` around lines 181 - 188, Update the
Best Practices section to ensure consistency with the examples: change item `#2`
(Defensive) to explicitly mention both fields and parent objects (e.g.,
"Defensive: Check that fields and parent objects exist before modifying them")
and/or add a new bullet saying "Check if parent objects exist before adding
fields"; also reference the problematic path used in examples (/metadata/labels)
and mention the Go and Bash examples so readers know where to apply the
defensive check.
🧹 Nitpick comments (1)
docs/development/plugin-development.md (1)

92-98: ⚡ Quick win

Add nil check for defensive programming.

While the key existence check at line 93 prevents adding a remove patch for non-existent annotations, if GetAnnotations() returns nil, the map access could panic. Consider adding a nil check.

♻️ Proposed defensive nil check
     // Example: remove a specific annotation
     annotations := resource.GetAnnotations()
-    if _, ok := annotations["source-cluster-only"]; ok {
+    if annotations != nil {
+        if _, ok := annotations["source-cluster-only"]; ok {
+            patches = append(patches, PatchOp{
+                Op:   "remove",
+                Path: "/metadata/annotations/source-cluster-only",
+            })
+        }
+    }
+}
+```

Or more concisely:
```diff
     // Example: remove a specific annotation
     annotations := resource.GetAnnotations()
-    if _, ok := annotations["source-cluster-only"]; ok {
+    if len(annotations) > 0 {
+        if _, ok := annotations["source-cluster-only"]; ok {
+            patches = append(patches, PatchOp{
+                Op:   "remove",
+                Path: "/metadata/annotations/source-cluster-only",
+            })
+        }
-    }
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/development/plugin-development.md` around lines 92 - 98, The code reads
annotations := resource.GetAnnotations() and then does a key existence check
which could panic if annotations is nil; add a defensive nil check before
accessing the map (e.g., ensure annotations != nil) and only append the PatchOp
when annotations is non-nil and the "source-cluster-only" key exists; update the
block around resource.GetAnnotations(), the annotations variable and the patches
= append(patches, PatchOp{...}) call to perform this conditional check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/commands/transfer-pvc.md`:
- Around line 36-37: The table currently marks `--ingress-class` and
`--subdomain` as optional but the Endpoint Options text later says they are
required for nginx-ingress, causing ambiguity; update the flag table entries for
`--ingress-class` and `--subdomain` to read "Required when endpoint is
nginx-ingress" (or similar) and/or add a clarifying sentence in the "Endpoint
Options" section that explicitly states these flags are conditionally required
when the endpoint is set to `nginx-ingress` and optional otherwise so both
places match `--ingress-class` and `--subdomain`.

In `@docs/development/plugin-development.md`:
- Around line 115-124: The example patch fails when /metadata/labels doesn't
exist; update the bash plugin to read the incoming resource from stdin, inspect
whether .metadata.labels exists (e.g., using jq), and emit a JSONPatch that
first ensures labels exists (an "add" to "/metadata/labels" with {} if missing)
before adding "/metadata/labels/environment" — alternatively emit two operations
in order (add "/metadata/labels" -> {} then add "/metadata/labels/environment"
-> "production") when labels is absent; reference the script that produces the
static JSONPatch and the JSON Pointer "/metadata/labels/environment" when making
this conditional change.
- Around line 85-89: The JSONPatch add at PatchOp with Path
"/metadata/labels/migrated-by" will fail when the parent "/metadata/labels" is
missing; update the patch sequence around the PatchOp to first ensure the labels
map exists (either prepend a test+add pattern that tests for "/metadata/labels"
and adds an empty map if absent, or add an explicit add for "/metadata/labels"
before adding "/metadata/labels/migrated-by"), or switch the operation to
"replace" only if you guarantee labels always exist; modify the PatchOp list to
implement one of these defensive approaches so the add to
"/metadata/labels/migrated-by" cannot error on resources without labels.

In `@docs/multistage-pipeline.md`:
- Line 166: Resolve the contradiction about stage-specific applies: determine
whether the CLI supports the --stage flag for the "apply" command; if the flag
is implemented, update the statement that "The apply command does not support
stage-specific flags" to reflect that apply can target a single stage (mention
the --stage flag) and document its behavior and limitations in the "apply"
section; if the flag is not implemented, remove the suggestion to run `crane
apply --stage <stage>` and replace the troubleshooting note with an alternative
(for example, suggest isolating the stage by running the stage-specific command
that does exist, or using `crane run --stage <stage>` if that is the supported
command) and ensure both places consistently state the correct behavior of
"apply" and the correct command to isolate a failing stage.

---

Outside diff comments:
In `@docs/development/plugin-development.md`:
- Around line 181-188: Update the Best Practices section to ensure consistency
with the examples: change item `#2` (Defensive) to explicitly mention both fields
and parent objects (e.g., "Defensive: Check that fields and parent objects exist
before modifying them") and/or add a new bullet saying "Check if parent objects
exist before adding fields"; also reference the problematic path used in
examples (/metadata/labels) and mention the Go and Bash examples so readers know
where to apply the defensive check.

---

Nitpick comments:
In `@docs/development/plugin-development.md`:
- Around line 92-98: The code reads annotations := resource.GetAnnotations() and
then does a key existence check which could panic if annotations is nil; add a
defensive nil check before accessing the map (e.g., ensure annotations != nil)
and only append the PatchOp when annotations is non-nil and the
"source-cluster-only" key exists; update the block around
resource.GetAnnotations(), the annotations variable and the patches =
append(patches, PatchOp{...}) call to perform this conditional check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d1a7bd49-ea9b-46bb-800e-1da548d8b32d

📥 Commits

Reviewing files that changed from the base of the PR and between 74262d4 and 5b76ad6.

📒 Files selected for processing (17)
  • CONTRIBUTING.md
  • README.md
  • docs/README.md
  • docs/commands/apply.md
  • docs/commands/export.md
  • docs/commands/transfer-pvc.md
  • docs/commands/transform.md
  • docs/commands/validate.md
  • docs/development/README.md
  • docs/development/architecture.md
  • docs/development/plugin-development.md
  • docs/development/setup.md
  • docs/development/testing.md
  • docs/installation.md
  • docs/multistage-pipeline.md
  • docs/plugins.md
  • docs/resource-compatibility.md

Comment thread docs/commands/transfer-pvc.md Outdated
Comment thread docs/development/plugin-development.md
Comment thread docs/development/plugin-development.md
Comment thread docs/multistage-pipeline.md Outdated

@aufi aufi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are some things that could be updated (now or later), I left few comments, but overall looks good to me.

Comment thread docs/commands/transform.md Outdated

# Create a new pass-through stage for manual editing
# Stage name NOT ending with "Plugin" creates empty pass-through
crane transform --stage 40_CustomManualEdits

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are some updates of this in open PRs #395, but I will send an update to docs when the PR gets merged.

@@ -0,0 +1,523 @@
# Multi-Stage Kustomize Transform Pipeline

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks quite close to transform command doc, maybe belongs partially there and partially to some example migration scenario, but could be updated later, not blocking this PR.

Comment thread docs/plugins.md

The [konveyor/crane-plugins](https://github.com/konveyor/crane-plugins) repository contains community-contributed plugins based on experience from real-world Kubernetes migrations.

### OpenShift Plugin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thinking if we want mention that those community plugins (including openshift) are not fully maintained at this moment.

Comment thread CONTRIBUTING.md Outdated
- `feat:` for new features
- `refactor:` for code restructuring
- `test:` for test additions
- `docs:` for documentation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is -1 from me (mentioned on previous PR #310 (review)), but not a blocker if thers are OK with this.

Ilanit Stein and others added 2 commits June 17, 2026 11:18
Reorganize documentation into docs/ with commands/ and development/
subdirectories. Add CONTRIBUTING.md for contributor onboarding.

New structure:
- docs/commands/ — reference for all 5 commands (export, transform,
  apply, validate, transfer-pvc)
- docs/development/ — architecture, setup, testing, plugin development
- docs/multistage-pipeline.md — multi-stage Kustomize pipeline guide
- docs/plugins.md — plugin overview
- docs/resource-compatibility.md — resource type compatibility matrix
- docs/installation.md — installation and prerequisites

Content updated to reflect current codebase:
- crane apply uses embedded kustomize (no kubectl dependency)
- crane apply supports --skip-cluster-scoped and --kustomize-args flags
- crane validate supports offline mode via --api-resources
- crane export documents CRD collection and _cluster/ subdirectory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update all doc files to reflect 35 commits merged to main since the
original PR: --stage flag replaced with positional arguments, --overwrite
added to export/apply/validate, transform default behavior changed to
create stages for all plugins, --skip-plugins and --instructions-file
flags added, --api-resources mutual exclusion expanded, and
--plugin-priorities/--stage-name/--plugin-name flags removed.

Address reviewer feedback: use verb-first commit/PR titles instead of
conventional commit prefixes (aufi), add community plugin maintenance
note (aufi), fix conditional Required status for transfer-pvc nginx
flags (CodeRabbit), add defensive JSONPatch parent-object checks in
plugin examples (CodeRabbit), add nil check for GetAnnotations
(CodeRabbit), and resolve apply stage-specific flag contradiction
(CodeRabbit).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@istein1 istein1 force-pushed the docs/restructure-v2 branch from 5b76ad6 to a677530 Compare June 17, 2026 08:31
…igration

- Fix stale ApplyFinalStage() reference in multistage-pipeline.md (only
  ApplySingleStage and ApplyMultiStage exist)
- Fix misleading "Single Stage Mode" heading (default creates stages for
  all plugins)
- Fix transform.md title to "crane transform" for consistency
- Add capture-api-surface.sh script to validate.md offline validation
  section (from PR migtools#321 suggestion)
- Document admin vs non-admin migration in export.md (graceful Forbidden
  handling, CRD skip behavior)
- Enhance --skip-cluster-scoped docs in apply.md with non-admin pipeline
  example

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@istein1

istein1 commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

Rebased on latest main and pushed two follow-up commits addressing all review feedback:

First commit covers the bulk of the review comments — replaced all stale --stage flag references with positional args, added missing flags (--overwrite,
--skip-plugins, --instructions-file), fixed plugin-development.md code examples (defensive parent-object creation, nil checks), updated commit conventions in
CONTRIBUTING.md per aufi's suggestion, and corrected the default transform behavior description.

Second commit fixes remaining issues found during re-review — removed the non-existent ApplyFinalStage() from the API reference, fixed the misleading "Single Stage
Mode" heading, added the capture-api-surface.sh script to validate.md for offline validation workflows, and documented admin vs non-admin migration support across
export and apply docs.

All docs are now current with the 35 commits that landed on main since the original PR.

More details on the 2 commits:

Commit 1: a677530 — Update docs for latest CLI changes and review feedback

Files (9): CONTRIBUTING.md, docs/commands/apply.md, docs/commands/export.md, docs/commands/transfer-pvc.md, docs/commands/transform.md, docs/commands/validate.md,
docs/development/plugin-development.md, docs/multistage-pipeline.md, docs/plugins.md

  • Replaced all stale --stage / --stage-name / --plugin-priorities flag references with positional argument syntax
  • Added --overwrite flag to export, apply, validate docs
  • Added --skip-plugins, --instructions-file, autocompletion note to transform docs
  • Expanded --api-resources mutual exclusion to all 6 flags in validate docs
  • Fixed plugin-development.md examples with defensive JSONPatch parent-object creation and nil checks
  • Fixed transfer-pvc.md Required column for nginx-ingress flags
  • Changed CONTRIBUTING.md commit conventions from fix:/feat: to verb-first titles per aufi's review
  • Updated default transform behavior: stages for ALL available plugins, not just KubernetesPlugin
  • Added community plugin maintenance warning to plugins.md

Commit 2: 521edcb — Fix review issues, add API surface script, document non-admin migration

Files (5): docs/commands/apply.md, docs/commands/export.md, docs/commands/transform.md, docs/commands/validate.md, docs/multistage-pipeline.md

  • Removed stale ApplyFinalStage() API reference (method doesn't exist; replaced with ApplyMultiStage)
  • Fixed misleading "Single Stage Mode" heading to "Default Mode (All Plugins)"
  • Fixed transform.md title to "crane transform" for consistency
  • Added capture-api-surface.sh script (script + one-liner) to validate.md offline validation section
  • Added admin vs non-admin migration documentation to export.md and apply.md

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