Skip to content

Commit b36b4e2

Browse files
docs: Rename HACKING.rst to CONTRIBUTING.rst (canonical#1118)
This is more consistent with other github repositories, and will prompt a first-time contributor to read the contributing guidelines before submitting the pull request. Additionally, added a summary section to the top, updated some outdated language, and removed some outdated typing guidance.
1 parent 31daf66 commit b36b4e2

File tree

4 files changed

+38
-26
lines changed

4 files changed

+38
-26
lines changed

HACKING.rst renamed to CONTRIBUTING.rst

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
*********************
2-
Hacking on cloud-init
3-
*********************
1+
Contributing to cloud-init
2+
**************************
43

54
This document describes how to contribute changes to cloud-init.
65
It assumes you have a `GitHub`_ account, and refers to your GitHub user
@@ -9,6 +8,26 @@ as ``GH_USER`` throughout.
98
Submitting 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+
1231
Follow 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
159180
follow up in the pull request. Look at the `Code Review Process`_ doc
160181
to understand the following steps.
161182

162183
Feel free to ping and/or join ``#cloud-init`` on Libera irc if you
163184
have 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

169189
Design
@@ -188,18 +208,9 @@ Type Annotations
188208
----------------
189209

190210
The 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
203214
variable annotations specified in `PEP-526`_ were introduced in Python
204215
3.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

doc/rtd/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Having trouble? We would like to help!
6868
:titlesonly:
6969
:caption: Development
7070

71-
topics/hacking.rst
71+
topics/contributing.rst
7272
topics/code_review.rst
7373
topics/security.rst
7474
topics/debugging.rst

doc/rtd/topics/contributing.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.. include:: ../../../CONTRIBUTING.rst
2+
.. vi: textwidth=78

doc/rtd/topics/hacking.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)