Add plugin init scaffold to pipectl#6883
Open
kubeboiii wants to merge 1 commit into
Open
Conversation
Add pipectl plugin init and the pluginscaffold package to generate compile-ready stage-only and deployment-minimal plugin skeletons. Includes golden tests, integration build tests, and documentation. Fixes pipe-cd#6694 Signed-off-by: Himanshu <himanshuwankhadeh@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Adds
pipectl plugin initand thepluginscaffoldpackage to generate compile-ready Piped v1 plugin skeletons from embedded templates:waitplugin)ecs-style layout)The command supports
--kind,--stages,--module,--name,--dry-run, and--force. Tests include golden output, name validation, and integration checks that rungo mod tidyandgo buildfor both kinds.Why we need it:
Plugin authors currently copy and rename files from existing plugins (
wait,ecs), which is slow and easy to get wrong. This addresses the MVP in #6694 and part of the scaffold epic in #6693.Which issue(s) this PR fixes:
Fixes #6694
Related to #6693 (does not implement the full epic; see scope below).
Does this PR introduce a user-facing change?:
pipectl plugin initto create a new plugin directory with a valid layout and stub implementations. Documentation is added under Contributing plugins and Command-line tool.Scope
pipectl plugin initpipectl plugin add-stage(#6705)--livestate,--planpreview,--initialize(#6693)pkg/app/pipedv1/plugin/...helperThis change is additive:
pipedruntime and existing plugins are not modified.pipectl plugin pushis unchanged.The diff is larger than the ~300-line guideline in CONTRIBUTING because of embedded templates and golden
testdata; it is limited to one feature (the init scaffold).Test plan
make checkgo test -race ./pkg/app/pipectl/pluginscaffold/... ./pkg/app/pipectl/cmd/plugin/...