blob: 2f5ffb7da042532fd3703865df63b5e48646ff75 [file] [log] [blame]
Marian Harbachebeb1542019-12-13 10:42:46 +01001:linkattrs:
Edwin Kempina751c6a2019-10-01 13:56:53 +02002= Plugin Lifecycle
3
4Most of the plugins are hosted on the same instance as the
Marian Harbach34253372019-12-10 18:01:31 +01005link:https://gerrit-review.googlesource.com[Gerrit project itself,role=external,window=_blank] to make them
Edwin Kempina751c6a2019-10-01 13:56:53 +02006more discoverable and have more chances to be reviewed by the whole community.
7
8[[hosting_lifecycle]]
9== Hosting Lifecycle
10
11The process of writing a new plugin goes through different phases:
12
13- Ideation and Discussion:
14+
15The idea of creating a new plugin is posted and discussed on the
Marian Harbach34253372019-12-10 18:01:31 +010016link:https://groups.google.com/d/forum/repo-discuss[repo-discuss,role=external,window=_blank] mailing list.
Edwin Kempina751c6a2019-10-01 13:56:53 +020017+
Nasser Grainawic219c332022-03-03 09:47:19 -070018Also see section <<ideation_discussion>> below.
Edwin Kempina751c6a2019-10-01 13:56:53 +020019
20- Prototyping (optional):
21+
22The author of the plugin creates a working prototype on a public repository
23accessible to the community.
24+
Nasser Grainawic219c332022-03-03 09:47:19 -070025Also see section <<plugin_prototyping>> below.
Edwin Kempina751c6a2019-10-01 13:56:53 +020026
27- Proposal and Hosting:
28+
29The author proposes to release the plugin under the
30link:https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 OpenSource
Marian Harbach34253372019-12-10 18:01:31 +010031license,role=external,window=_blank] and requests the plugin to be hosted on
32link:https://gerrit-review.googlesource.com[the Gerrit project site,role=external,window=_blank]. The
Edwin Kempina751c6a2019-10-01 13:56:53 +020033proposal must be accepted by at least one Gerrit maintainer. In case of
34disagreement between maintainers, the issue can be escalated to the
35link:dev-processes.html#steering-committee[Engineering Steering Committee]. If
36the plugin is accepted, the Gerrit maintainer creates the project under the
37plugins path on link:https://gerrit-review.googlesource.com[the Gerrit project
Marian Harbach34253372019-12-10 18:01:31 +010038site,role=external,window=_blank].
Edwin Kempina751c6a2019-10-01 13:56:53 +020039+
Nasser Grainawic219c332022-03-03 09:47:19 -070040Also see section <<plugin_proposal>> below.
Edwin Kempina751c6a2019-10-01 13:56:53 +020041
42- Build:
43+
44To make the consumption of the plugin easy and to notice plugin breakages early
45the plugin author should setup build jobs on
Marian Harbach34253372019-12-10 18:01:31 +010046link:https://gerrit-ci.gerritforge.com[the GerritForge CI,role=external,window=_blank] that build the
Edwin Kempina751c6a2019-10-01 13:56:53 +020047plugin for each Gerrit version that it supports.
48+
Nasser Grainawic219c332022-03-03 09:47:19 -070049Also see section <<build>> below.
Edwin Kempina751c6a2019-10-01 13:56:53 +020050
51- Development and Contribution:
52+
53The author develops a production-ready code base of the plugin, with
54contributions, reviews, and help from the Gerrit community.
55+
Nasser Grainawic219c332022-03-03 09:47:19 -070056Also see section <<development_contribution>>
Edwin Kempina751c6a2019-10-01 13:56:53 +020057below.
58
59- Release:
60+
61The author releases the plugin by creating a Git tag and announcing the plugin
Marian Harbach34253372019-12-10 18:01:31 +010062on the link:https://groups.google.com/d/forum/repo-discuss[repo-discuss,role=external,window=_blank]
Edwin Kempina751c6a2019-10-01 13:56:53 +020063mailing list.
64+
Nasser Grainawic219c332022-03-03 09:47:19 -070065Also see section <<plugin_release>> below.
Edwin Kempina751c6a2019-10-01 13:56:53 +020066
67- Maintenance:
68+
69The author maintains their plugins as new Gerrit versions are released, updates
70them when necessary, develops further existing or new features and reviews
71incoming contributions.
72
73- Deprecation:
74+
75The author declares that the plugin is not maintained anymore or is deprecated
76and should not be used anymore.
77+
Nasser Grainawic219c332022-03-03 09:47:19 -070078Also see section <<plugin_deprecation>> below.
Edwin Kempina751c6a2019-10-01 13:56:53 +020079
80[[ideation_discussion]]
81== Ideation and Discussion
82
83Starting a new plugin project is a community effort: it starts with the
84identification of a gap in the Gerrit Code Review product but evolves with the
85contribution of ideas and suggestions by the whole community.
86
87The ideator of the plugin starts with an RFC (Request For Comments) post on the
Marian Harbach34253372019-12-10 18:01:31 +010088link:https://groups.google.com/d/forum/repo-discuss[repo-discuss,role=external,window=_blank] mailing list
Edwin Kempina751c6a2019-10-01 13:56:53 +020089with a description of the main reasons for starting a new plugin.
90
91Example of a post:
92
93----
94 [RFC] Code-Formatter plugin
95
96 Hello, community,
97 I am proposing to create a new plugin for Gerrit called 'Code-Formatter', see
98 the details below.
99
100 *The gap*
101 Often, when I post a new change to Gerrit, I forget to run the common code
102 formatting tool (e.g. Google-Java-Format for the Gerrit project). I would
103 like Gerrit to be in charge of highlighting these issues to me and save many
104 people's time.
105
106 *The proposal*
107 The Code-Formatter plugin reads the formatting rules in the project config
108 and applies them automatically to every patch-set. Any issue is reported as a
109 regular review comment to the patchset, highlighting the part of the code to
110 be changed.
111
112 What do you think? Did anyone have the same idea or need?
113----
114
115The idea is discussed on the mailing list and can evolve based on the needs and
116inputs from the entire community.
117
118After the discussion, the ideator of the plugin can decide to start prototyping
119on it or park the proposal, if the feedback provided an alternative solution to
120the problem. The prototype phase can be optionally skipped if the idea is clear
121enough and receives a general agreement from the Gerrit maintainers. The author
122can be given a "leap of faith" and can go directly to the format plugin
123proposal (see below) and the creation of the plugin repository.
124
125[[plugin_prototyping]]
126== Plugin Prototyping
127
128The initial idea is translated to code by the plugin author. The development
129can happen on any public or private source code repository and can involve one
130or more contributors. The purpose of prototyping is to verify that the idea can
131be implemented and provides the expected benefits.
132
133Once a working prototype is ready, it can be announced as a follow-up to the
134initial RFC proposal so that other members of the community can see the code
135and try the plugin themselves.
136
137[[plugin_proposal]]
138== Plugin Proposal
139
140The author decides that the plugin prototype makes sense as a general purpose
141plugin and decides to release the code with the same
Marian Harbach34253372019-12-10 18:01:31 +0100142link:https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license,role=external,window=_blank]
Edwin Kempina751c6a2019-10-01 13:56:53 +0200143as the Gerrit Code Review project and have it hosted on
Marian Harbach34253372019-12-10 18:01:31 +0100144link:https://gerrit-review.googlesource.com[the Gerrit project site,role=external,window=_blank].
Edwin Kempina751c6a2019-10-01 13:56:53 +0200145
146The plugin author formalizes the proposal with a follow-up of the initial RFC
147post and asks for public opinion on it.
148
149Example:
150
151----
152 Re - [RFC] Code-Formatter plugin
153
154 Hello, community,
155 thanks for your feedback on the prototype. I have now decided to donate the
156 project to the Gerrit Code Review project and make it a plugin:
157
158 Plugin name:
159 /plugins/code-formatter
160
161 Plugin description:
162 Plugin to allow automatic posting review based on code-formatting rules
163----
164
165The community discusses the proposal and the value of the plugin for the whole
166project; the result of the discussion can end up in one of the following cases:
167
168- The plugin's project request is widely appreciated and formally accepted by
169 at least one Gerrit maintainer who creates the repository as child project of
170 'Public-Projects' on link:https://gerrit-review.googlesource.com[the Gerrit
Marian Harbach34253372019-12-10 18:01:31 +0100171 project site,role=external,window=_blank], creates an associated plugin owners group with "Owner"
Edwin Kempina751c6a2019-10-01 13:56:53 +0200172 permissions for the plugin and adds the plugin's author as member of it.
173- The plugin's project is widely appreciated; however, another existing plugin
174 already partially covers the same use-case and thus it would make more sense
175 to have the features integrated into the existing plugin. The new plugin's
176 author contributes his prototype commits refactored to be included as change
177 into the existing plugin.
178- The plugin's project is found useful; however, it is too specific to the
179 author's use-case and would not make sense outside of it. The plugin remains
180 in a public repository, widely accessible and OpenSource, but not hosted on
Marian Harbach34253372019-12-10 18:01:31 +0100181 link:https://gerrit-review.googlesource.com[the Gerrit project site,role=external,window=_blank].
Edwin Kempina751c6a2019-10-01 13:56:53 +0200182
183[[build]]
184== Build
185
186The plugin's maintainer creates a job on the
Marian Harbach34253372019-12-10 18:01:31 +0100187link:https://gerrit-ci.gerritforge.com[GerritForge CI,role=external,window=_blank] by creating a new YAML
Edwin Kempina751c6a2019-10-01 13:56:53 +0200188definition in the link:https://gerrit.googlesource.com/gerrit-ci-scripts[Gerrit
Marian Harbach34253372019-12-10 18:01:31 +0100189CI Scripts,role=external,window=_blank] repository.
Edwin Kempina751c6a2019-10-01 13:56:53 +0200190
191Example of a YAML CI job for plugins:
192
193----
194 - project:
195 name: code-formatter
196 jobs:
197 - 'plugin-{name}-bazel-{branch}':
198 branch:
199 - master
200----
201
202[[development_contribution]]
203== Development and Contribution
204
205The plugin follows the same lifecycle as Gerrit Code Review and needs to be
206kept up-to-date with the current active branches, according to the
Marian Harbach34253372019-12-10 18:01:31 +0100207link:https://www.gerritcodereview.com/#support[current support policy,role=external,window=_blank].
Edwin Kempina751c6a2019-10-01 13:56:53 +0200208During the development, the plugin's maintainer can reward contributors
209requesting to be more involved and making them maintainers of his plugin,
210adding them to the list of the project owners.
211
212[[plugin_release]]
213== Plugin Release
214
215The plugin's maintainer is the only person responsible for making and
216announcing the official releases, typically, but not limited to, in conjunction
217with the major releases of Gerrit Code Review. The plugin's maintainer may tag
218his plugin and follow the notation and semantics of the Gerrit Code Review
219project; however it is not mandatory and many of the plugins do not have any
220tags or releases.
221
222Example of a YAML CI job for a plugin compatible with multiple Gerrit versions:
223
224----
225 - project:
226 name: code-formatter
227 jobs:
228 - 'plugin-{name}-bazel-{branch}-{gerrit-branch}':
229 branch:
230 - master
231 gerrit-branch:
232 - master
233 - stable-3.0
234 - stable-2.16
235----
236
237[[plugin_deprecation]]
238== Plugin Deprecation
239
240The plugin's maintainer and the community have agreed that the plugin is not
241useful anymore or there isn't anyone willing to contribute to bringing it
242forward and keeping it up-to-date with the recent versions of Gerrit Code
243Review.
244
245The plugin's maintainer puts a deprecation notice in the README.md of the
246plugin and pushes it for review. If nobody is willing to bring the code
247forward, the change gets merged, and the master branch is removed from the list
248of branches to be built on the GerritFoge CI.
249
250GERRIT
251------
252Part of link:index.html[Gerrit Code Review]
253
254SEARCHBOX
255---------