1- *********************
2- Hacking on cloud-init
3- *********************
1+ Contributing to cloud-init
2+ **************************
43
54This document describes how to contribute changes to cloud-init.
65It assumes you have a `GitHub `_ account, and refers to your GitHub user
@@ -9,6 +8,26 @@ as ``GH_USER`` throughout.
98Submitting your first pull request
109==================================
1110
11+ Summary
12+ -------
13+
14+ Before any pull request can be accepted, you must do the following:
15+
16+ * Sign the Canonical `contributor license agreement `_
17+ * Add yourself (alphabetically) to the in-repository list that we use
18+ to track CLA signatures:
19+ `tools/.github-cla-signers `_
20+ * Add or update any `unit tests `_ accordingly
21+ * Add or update any `integration tests `_ (if applicable)
22+ * Ensure unit tests and linting pass using `tox `_
23+ * Submit a PR against the `main ` branch of the `cloud-init ` repository
24+
25+ .. _unit tests : https://cloudinit.readthedocs.io/en/latest/topics/testing.html
26+ .. _integration tests : https://cloudinit.readthedocs.io/en/latest/topics/integration_tests.html
27+
28+ The detailed instructions
29+ -------------------------
30+
1231Follow these steps to submit your first pull request to cloud-init:
1332
1433* To contribute to cloud-init, you must sign the Canonical `contributor
@@ -78,7 +97,6 @@ Follow these steps to submit your first pull request to cloud-init:
7897.. _repository : https://github.com/canonical/cloud-init
7998.. _contributor license agreement : https://ubuntu.com/legal/contributors
8099.. _contributor-agreement-canonical : https://launchpad.net/%7Econtributor-agreement-canonical/+members
81- .. _tools/.github-cla-signers : https://github.com/canonical/cloud-init/blob/main/tools/.github-cla-signers
82100.. _PR #344 : https://github.com/canonical/cloud-init/pull/344
83101.. _PR #345 : https://github.com/canonical/cloud-init/pull/345
84102
@@ -123,7 +141,7 @@ Do these things for each feature or bug
123141
124142 git push -u GH_USER my-topic-branch
125143
126- * Use your browser to create a merge request:
144+ * Use your browser to create a pull request:
127145
128146 - Open the branch on GitHub
129147
@@ -142,28 +160,30 @@ Do these things for each feature or bug
142160 as footers with syntax as shown here.
143161
144162 The commit message should be one summary line of less than
145- 74 characters followed by a blank line, and then one or more
146- paragraphs describing the change and why it was needed.
163+ 70 characters followed by a blank line, and then one or more
164+ paragraphs wrapped at 72 characters describing the change and why
165+ it was needed.
147166
148167 This is the message that will be used on the commit when it
149- is sqaushed and merged into trunk.
168+ is sqaushed and merged into main. If there is a related launchpad
169+ bug, specify it at the bottom of the commit message.
150170
151- LP: #1
171+ LP: #NNNNNNN (replace with the appropriate bug reference or remove
172+ this line entirely if there is no associated bug)
152173
153174 Note that the project continues to use LP: #NNNNN format for closing
154175 launchpad bugs rather than GitHub Issues.
155176
156177 - Click 'Create Pull Request`
157178
158- Then, someone in the ` Ubuntu Server `_ team will review your changes and
179+ Then, a cloud-init committer will review your changes and
159180follow up in the pull request. Look at the `Code Review Process `_ doc
160181to understand the following steps.
161182
162183Feel free to ping and/or join ``#cloud-init `` on Libera irc if you
163184have any questions.
164185
165186.. _tox : https://tox.readthedocs.io/en/latest/
166- .. _Ubuntu Server : https://github.com/orgs/canonical/teams/ubuntu-server
167187.. _Code Review Process : https://cloudinit.readthedocs.io/en/latest/topics/code_review.html
168188
169189Design
@@ -188,18 +208,9 @@ Type Annotations
188208----------------
189209
190210The cloud-init codebase uses Python's annotation support for storing
191- type annotations in the style specified by `PEP-484 `_. Their use in
192- the codebase is encouraged but with one important caveat: types from
193- the ``typing `` module cannot be used.
194-
195- cloud-init still supports Python 3.4, which doesn't have the ``typing ``
196- module in the stdlib. This means that the use of any types from the
197- ``typing `` module in the codebase would require installation of an
198- additional Python module on platforms using Python 3.4. As such
199- platforms are generally in maintenance mode, the introduction of a new
200- dependency may act as a break in compatibility in practical terms.
201-
202- Similarly, only function annotations are appropriate for use, as the
211+ type annotations in the style specified by `PEP-484 `_. Their use in
212+ the codebase is encouraged but with one important caveat: only
213+ function annotations or comment annotations are supported, as the
203214variable annotations specified in `PEP-526 `_ were introduced in Python
2042153.6.
205216
@@ -517,6 +528,7 @@ References
517528* `PR #363 `_, the discussion which prompted finally starting this
518529 refactor (and where a lot of the above details were hashed out)
519530
531+ .. _tools/.github-cla-signers : https://github.com/canonical/cloud-init/blob/main/tools/.github-cla-signers
520532.. _get_interfaces_by_mac : https://github.com/canonical/cloud-init/blob/961239749106daead88da483e7319e9268c67cde/cloudinit/net/__init__.py#L810-L818
521533.. _Mina Galić's email the the cloud-init ML in 2018 : https://lists.launchpad.net/cloud-init/msg00185.html
522534.. _Mina Galić's email to the cloud-init ML in 2019 : https://lists.launchpad.net/cloud-init/msg00237.html
0 commit comments