Docs V1: Add plugin tutorial Chapter 3 - Config types and empty implementation - #7152
Conversation
…tation Signed-off-by: rahulshendre <rahulshendre789@gmail.com>
✅ Deploy Preview for pipecd-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@khanhtc1202 @armistcxy @mohammedfirdouss @eeshaanSA, PTAL when you have time |
|
|
||
| ## Define the configuration types | ||
|
|
||
| Recall the three type parameters of a DeploymentPlugin: Config, DeployTargetConfig, and ApplicationConfigSpec. The file plugin needs only one of them. |
There was a problem hiding this comment.
I think we should wrap parameter name with ``
|
|
||
| Recall the three type parameters of a DeploymentPlugin: Config, DeployTargetConfig, and ApplicationConfigSpec. The file plugin needs only one of them. | ||
|
|
||
| - It has no plugin-wide configuration, so it uses `sdk.ConfigNone`, the SDK's type for an empty configuration, in place of a Config type. |
There was a problem hiding this comment.
same as above, wrap Config with ``
| Recall the three type parameters of a DeploymentPlugin: Config, DeployTargetConfig, and ApplicationConfigSpec. The file plugin needs only one of them. | ||
|
|
||
| - It has no plugin-wide configuration, so it uses `sdk.ConfigNone`, the SDK's type for an empty configuration, in place of a Config type. | ||
| - It has no deploy targets, so its DeployTargetConfig is an empty struct. |
There was a problem hiding this comment.
wrap DeployTargetConfig with ``
There was a problem hiding this comment.
Pull request overview
Adds Chapter 3 to the Docs V1 “Creating a plugin” tutorial, covering the basic configuration types and a compiling (but empty) DeploymentPlugin implementation to establish a foundation for later chapters.
Changes:
- Introduces Chapter 3 documentation explaining
Config,DeployTargetConfig, andApplicationConfigSpecchoices for the sample plugin. - Adds example
plugin.gosnippets with type definitions and an initialDeploymentPluginmethod set (placeholder implementations). - Adds example
main.gosnippet showing plugin registration viasdk.NewPluginandsdk.WithDeploymentPlugin.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| ## Add an empty implementation | ||
|
|
||
| Define a `plugin` type and give it a method for every method in the DeploymentPlugin interface. Each method calls `panic` for now. This lets you confirm that the method set and the signatures are correct before writing any real logic. |
| ) | ||
| ``` | ||
|
|
||
| Both `context` and `sdk` are used by the implementation you add next. |
Signed-off-by: rahulshendre <rahulshendre789@gmail.com>
bd1a96b to
6f9549b
Compare
What this PR does:
Adds chapter 3 of creating a plugin tutorial, it covers how to define the plugin's configuration types and add a compiling, empty DeploymentPlugin implementation.
Why we need it:
3rd chapter of the tutorial
Which issue(s) this PR fixes:
Part of #6679
Does this PR introduce a user-facing change?: