CONTRIBUTING.md revision 1.1.1.10 1 1.1 christos <!--
2 1.1.1.5 christos Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3 1.1.1.5 christos
4 1.1.1.5 christos SPDX-License-Identifier: MPL-2.0
5 1.1.1.5 christos
6 1.1.1.5 christos This Source Code Form is subject to the terms of the Mozilla Public
7 1.1.1.5 christos License, v. 2.0. If a copy of the MPL was not distributed with this
8 1.1.1.5 christos file, you can obtain one at https://mozilla.org/MPL/2.0/.
9 1.1.1.5 christos
10 1.1.1.5 christos See the COPYRIGHT file distributed with this work for additional
11 1.1.1.5 christos information regarding copyright ownership.
12 1.1 christos -->
13 1.1.1.3 christos ## BIND 9 Source Access and Contributor Guidelines
14 1.1.1.9 christos *Nov 26, 2024*
15 1.1 christos
16 1.1 christos ### Contents
17 1.1 christos
18 1.1 christos 1. [Access to source code](#access)
19 1.1 christos 1. [Reporting bugs](#bugs)
20 1.1 christos 1. [Contributing code](#contrib)
21 1.1.1.10 christos 1. [Generated code](#generated-code)
22 1.1 christos
23 1.1 christos ### Introduction
24 1.1 christos
25 1.1.1.3 christos Thank you for using BIND 9!
26 1.1 christos
27 1.1 christos BIND is open source software that implements the Domain Name System (DNS)
28 1.1 christos protocols for the Internet. It is a reference implementation of those
29 1.1 christos protocols, but it is also production-grade software, suitable for use in
30 1.1.1.3 christos high-volume and high-reliability applications. It is very
31 1.1 christos widely used DNS software, providing a robust and stable platform on top of
32 1.1 christos which organizations can build distributed computing systems with the
33 1.1 christos knowledge that those systems are fully compliant with published DNS
34 1.1 christos standards.
35 1.1 christos
36 1.1 christos BIND is and will always remain free and openly available. It can be
37 1.1 christos used and modified in any way by anyone.
38 1.1 christos
39 1.1.1.3 christos BIND is maintained by [Internet Systems Consortium](https://www.isc.org),
40 1.1 christos a public-benefit 501(c)(3) nonprofit, using a "managed open source" approach:
41 1.1 christos anyone can see the source, but only ISC employees have commit access.
42 1.1.1.3 christos In the past, the source could only be seen once ISC had published
43 1.1.1.3 christos a release; read access to the source repository was restricted just
44 1.1.1.3 christos as commit access was. That has changed, as ISC now provides a
45 1.1.1.4 christos public git repository of the BIND source tree (see below).
46 1.1 christos
47 1.1.1.3 christos At ISC, we're committed to
48 1.1.1.3 christos building communities that are welcoming and inclusive: environments where people
49 1.1.1.2 christos are encouraged to share ideas, treat each other with respect, and collaborate
50 1.1.1.3 christos towards the best solutions. To reinforce our commitment, ISC
51 1.1.1.3 christos has adopted a slightly modified version of the Django
52 1.1.1.4 christos [Code of Conduct](https://gitlab.isc.org/isc-projects/bind9/-/blob/main/CODE_OF_CONDUCT.md)
53 1.1.1.4 christos for the BIND 9 project, as well as for the conduct of our developers throughout
54 1.1.1.4 christos the industry.
55 1.1.1.2 christos
56 1.1 christos ### <a name="access"></a>Access to source code
57 1.1 christos
58 1.1 christos Public BIND releases are always available from the
59 1.1 christos [ISC FTP site](ftp://ftp.isc.org/isc/bind9).
60 1.1 christos
61 1.1.1.4 christos A public-access git repository is also available at
62 1.1.1.4 christos [https://gitlab.isc.org](https://gitlab.isc.org). This repository
63 1.1.1.4 christos contains all public release branches. Upcoming releases can be viewed in
64 1.1.1.4 christos their current state at any time. Short-lived development branches
65 1.1.1.4 christos contain unreviewed work in progress. Commits which address security
66 1.1.1.4 christos vulnerablilities are withheld until after public disclosure.
67 1.1 christos
68 1.1 christos You can browse the source online via
69 1.1 christos [https://gitlab.isc.org/isc-projects/bind9](https://gitlab.isc.org/isc-projects/bind9)
70 1.1 christos
71 1.1 christos To clone the repository, use:
72 1.1 christos
73 1.1 christos > $ git clone https://gitlab.isc.org/isc-projects/bind9.git
74 1.1 christos
75 1.1.1.6 christos Release branch names are of the form `bind-9.X`, where X represents the second
76 1.1.1.9 christos number in the BIND 9 version number. So, to check out the BIND 9.20
77 1.1 christos branch, use:
78 1.1 christos
79 1.1.1.9 christos > $ git checkout bind-9.20
80 1.1 christos
81 1.1.1.3 christos Whenever a branch is ready for publication, a tag is placed of the
82 1.1.1.9 christos form `v9.X.Y`. The 9.20.0 release, for instance, is tagged as `v9.20.0`.
83 1.1 christos
84 1.1 christos The branch in which the next major release is being developed is called
85 1.1.1.4 christos `main`.
86 1.1 christos
87 1.1 christos ### <a name="bugs"></a>Reporting bugs
88 1.1 christos
89 1.1 christos Reports of flaws in the BIND package, including software bugs, errors
90 1.1 christos in the documentation, missing files in the tarball, suggested changes
91 1.1.1.3 christos or requests for new features, etc., can be filed using
92 1.1 christos [https://gitlab.isc.org/isc-projects/bind9/issues](https://gitlab.isc.org/isc-projects/bind9/issues).
93 1.1 christos
94 1.1 christos Due to a large ticket backlog, we are sometimes slow to respond,
95 1.1 christos especially if a bug is cosmetic or if a feature request is vague or
96 1.1.1.3 christos low in priority, but we try at least to acknowledge legitimate
97 1.1 christos bug reports within a week.
98 1.1 christos
99 1.1.1.3 christos ISC's GitLab system is publicly readable; however, you must have
100 1.1.1.3 christos an account to create a new issue. You can either register locally or
101 1.1 christos use credentials from an existing account at GitHub, GitLab, Google,
102 1.1 christos Twitter, or Facebook.
103 1.1 christos
104 1.1 christos ### Reporting possible security issues
105 1.1.1.4 christos
106 1.1.1.7 christos See `SECURITY.md`.
107 1.1 christos
108 1.1.1.2 christos ### <a name="contrib"></a>Contributing code
109 1.1 christos
110 1.1 christos BIND is licensed under the
111 1.1.1.3 christos [Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/2.0/).
112 1.1.1.4 christos Earlier versions (BIND 9.10 and earlier) were licensed under the
113 1.1.1.4 christos [ISC License](https://www.isc.org/licenses/)
114 1.1 christos
115 1.1 christos ISC does not require an explicit copyright assignment for patch
116 1.1 christos contributions. However, by submitting a patch to ISC, you implicitly
117 1.1.1.3 christos certify that you are the author of the code, that you intend to relinquish
118 1.1 christos exclusive copyright, and that you grant permission to publish your work
119 1.1 christos under the open source license used for the BIND version(s) to which your
120 1.1 christos patch will be applied.
121 1.1 christos
122 1.1 christos #### <a name="bind"></a>BIND code
123 1.1 christos
124 1.1 christos Patches for BIND may be submitted directly via merge requests in
125 1.1.1.9 christos [ISC's GitLab](https://gitlab.isc.org/isc-projects/bind9/) source repository for
126 1.1.1.9 christos BIND. Please contact ISC and provide your GitLab username in order to be allowed
127 1.1.1.9 christos to fork the project and submit merge requests.
128 1.1 christos
129 1.1 christos Patches can also be submitted as diffs against a specific version of
130 1.1.1.4 christos BIND -- preferably the current top of the `main` branch. Diffs may
131 1.1 christos be generated using either `git format-patch` or `git diff`.
132 1.1 christos
133 1.1 christos Those wanting to write code for BIND may be interested in the
134 1.1 christos [developer information](doc/dev/dev.md) page, which includes information
135 1.1 christos about BIND design and coding practices, including discussion of internal
136 1.1.1.3 christos APIs and overall system architecture.
137 1.1 christos
138 1.1.1.3 christos Every patch submitted is reviewed by ISC engineers following our
139 1.1 christos [code review process](doc/dev/dev.md#reviews) before it is merged.
140 1.1 christos
141 1.1 christos It may take considerable time to review patch submissions, especially if
142 1.1 christos they don't meet ISC style and quality guidelines. If a patch is a good
143 1.1 christos idea, we can and will do additional work to bring it up to par, but if
144 1.1 christos we're busy with other work, it may take us a long time to get to it.
145 1.1 christos
146 1.1 christos To ensure your patch is acted on as promptly as possible, please:
147 1.1 christos
148 1.1 christos * Try to adhere to the [BIND 9 coding style](doc/dev/style.md).
149 1.1.1.9 christos * Run unit and system tests to ensure your change hasn't caused any
150 1.1.1.9 christos functional regressions (these can be checked in the CI pipeline).
151 1.1 christos * Document your work, both in the patch itself and in the
152 1.1 christos accompanying email.
153 1.1 christos * In patches that make non-trivial functional changes, include system
154 1.1 christos tests if possible; when introducing or substantially altering a
155 1.1 christos library API, include unit tests. See [Testing](doc/dev/dev.md#testing)
156 1.1 christos for more information.
157 1.1 christos
158 1.1 christos ##### Changes to `configure`
159 1.1 christos
160 1.1 christos If you need to make changes to `configure`, you should not edit it
161 1.1.1.9 christos directly; instead, edit `configure.ac`, then run `autoconf`. Similarly,
162 1.1.1.9 christos instead of editing `config.h.in` directly, edit `configure.ac` and run
163 1.1 christos `autoheader`.
164 1.1 christos
165 1.1 christos When submitting a patch as a diff, it's fine to omit the `configure`
166 1.1.1.9 christos diffs to save space. Just send the `configure.ac` diffs and we'll
167 1.1 christos generate the new `configure` during the review process.
168 1.1 christos
169 1.1 christos ##### Documentation
170 1.1 christos
171 1.1 christos All functional changes should be documented. There are three types
172 1.1 christos of documentation in the BIND source tree:
173 1.1 christos
174 1.1 christos * Man pages are kept alongside the source code for the commands
175 1.1.1.3 christos they document, in files ending in `.rst`: for example, the
176 1.1.1.3 christos `named` man page is `bin/named/named.rst`.
177 1.1.1.3 christos * The *BIND 9 Administrator Reference Manual* is in the .rst files in
178 1.1.1.8 christos `doc/arm/`; the HTML version is automatically generated from
179 1.1.1.4 christos the `.rst` files.
180 1.1 christos * API documentation is in the header file describing the API, in
181 1.1 christos Doxygen-formatted comments.
182 1.1 christos
183 1.1 christos Patches to improve existing documentation are also very welcome!
184 1.1 christos
185 1.1 christos ##### Tests
186 1.1 christos
187 1.1 christos BIND is a large and complex project. We rely heavily on continuous
188 1.1 christos automated testing and cannot merge new code without adequate test coverage.
189 1.1.1.3 christos Please see [the "Testing" section of doc/dev/dev.md](doc/dev/dev.md#testing)
190 1.1 christos for more information.
191 1.1 christos
192 1.1.1.10 christos ### <a name="generated-code"></a>Guidelines for Tool-Generated Content
193 1.1.1.10 christos
194 1.1.1.10 christos #### Purpose
195 1.1.1.10 christos
196 1.1.1.10 christos BIND 9 contributors have long used tooling to assist in development.
197 1.1.1.10 christos These tools can increase the volume and velocity of contributions. At
198 1.1.1.10 christos the same time, reviewer and maintainer bandwidth is a scarce resource,
199 1.1.1.10 christos and the stability of DNS software is critical infrastructure.
200 1.1.1.10 christos Understanding which portions of a contribution come from humans versus
201 1.1.1.10 christos tools is helpful to maintain those resources, assess risk, and keep
202 1.1.1.10 christos BIND 9 development healthy.
203 1.1.1.10 christos
204 1.1.1.10 christos The goal here is to clarify community expectations around tools,
205 1.1.1.10 christos particularly LLMs (Large Language Models) and generative AI. This
206 1.1.1.10 christos lets everyone become more productive while maintaining high degrees of
207 1.1.1.10 christos trust between submitters and reviewers.
208 1.1.1.10 christos
209 1.1.1.10 christos #### Out of Scope
210 1.1.1.10 christos
211 1.1.1.10 christos These guidelines do not apply to tools that make trivial tweaks to
212 1.1.1.10 christos preexisting content or verify adherence to style guides. Nor do they
213 1.1.1.10 christos pertain to AI tooling that helps with menial tasks. Some examples:
214 1.1.1.10 christos
215 1.1.1.10 christos - Spelling and grammar fix-ups, like rephrasing documentation to the
216 1.1.1.10 christos imperative voice.
217 1.1.1.10 christos - Typing aids like IDE identifier completion, common boilerplate, or
218 1.1.1.10 christos trivial pattern completion.
219 1.1.1.10 christos - Purely mechanical transformations like variable renaming across a
220 1.1.1.10 christos scope.
221 1.1.1.10 christos - Reformatting using the standard BIND 9 clang-format configuration
222 1.1.1.10 christos or black (for Python system tests).
223 1.1.1.10 christos
224 1.1.1.10 christos Even if your tool use is out of scope, you should still always
225 1.1.1.10 christos consider if it would assist the review of your contribution if the
226 1.1.1.10 christos reviewer knows about the tool that you used.
227 1.1.1.10 christos
228 1.1.1.10 christos #### In Scope
229 1.1.1.10 christos
230 1.1.1.10 christos These guidelines apply when a meaningful amount of content in a BIND 9
231 1.1.1.10 christos contribution (code, documentation, or tests) was not written by a
232 1.1.1.10 christos person contributing the patch or merge request, but was instead
233 1.1.1.10 christos created by a tool.
234 1.1.1.10 christos
235 1.1.1.10 christos Detection of a problem and testing the fix for it is also part of the
236 1.1.1.10 christos development process; if a tool was used to find a problem addressed by
237 1.1.1.10 christos a change (e.g., a fuzzer or static analyzer), that should be noted in
238 1.1.1.10 christos the commit message or MR description. This not only gives credit where
239 1.1.1.10 christos it is due, it also helps fellow developers find out about these tools.
240 1.1.1.10 christos
241 1.1.1.10 christos Some examples:
242 1.1.1.10 christos
243 1.1.1.10 christos - Complex semantic patches generated by Coccinelle scripts.
244 1.1.1.10 christos - A chatbot or AI assistant generated a new function in your Merge
245 1.1.1.10 christos Request to handle a specific DNS RR type.
246 1.1.1.10 christos - A .c file or system test in the MR was originally generated by a
247 1.1.1.10 christos coding assistant but cleaned up by hand.
248 1.1.1.10 christos - The commit message or MR description was generated by handing the
249 1.1.1.10 christos diff to a generative AI tool.
250 1.1.1.10 christos - Documentation or comments were translated from another language
251 1.1.1.10 christos using an automated tool.
252 1.1.1.10 christos
253 1.1.1.10 christos If in doubt, choose transparency and assume these guidelines apply to
254 1.1.1.10 christos your contribution.
255 1.1.1.10 christos
256 1.1.1.10 christos #### Guidelines
257 1.1.1.10 christos
258 1.1.1.10 christos You are responsible for the code you submit, regardless of how it was generated.
259 1.1.1.10 christos When opening a Merge Request, be transparent about the origin of content in the
260 1.1.1.10 christos MR description and commit messages. You can be more transparent by adding
261 1.1.1.10 christos information like this:
262 1.1.1.10 christos
263 1.1.1.10 christos - What tools were used?
264 1.1.1.10 christos - The input to the tools you used, like the Coccinelle source script
265 1.1.1.10 christos or specific configuration.
266 1.1.1.10 christos - If code was largely generated from a single or short set of
267 1.1.1.10 christos prompts, include those prompts. For longer sessions, include a
268 1.1.1.10 christos summary of the prompts and the nature of the resulting assistance.
269 1.1.1.10 christos - Which portions of the content were affected by that tool?
270 1.1.1.10 christos - How is the submission tested? (e.g., "I used tool X to generate a
271 1.1.1.10 christos system test case that triggers the bug.")
272 1.1.1.10 christos
273 1.1.1.10 christos As with all contributions, BIND 9 maintainers have discretion to
274 1.1.1.10 christos choose how they handle the contribution. For example, they might:
275 1.1.1.10 christos
276 1.1.1.10 christos - Treat it just like any other contribution.
277 1.1.1.10 christos - Reject it outright if the provenance is unclear or the code quality
278 1.1.1.10 christos is low.
279 1.1.1.10 christos - Treat the contribution specially, such as reviewing with extra
280 1.1.1.10 christos scrutiny regarding memory safety or RFC compliance.
281 1.1.1.10 christos - Suggest a better prompt or approach instead of suggesting specific
282 1.1.1.10 christos code changes.
283 1.1.1.10 christos - Ask the submitter to explain in more detail about the contribution
284 1.1.1.10 christos to ensure the submitter fully understands the DNS logic or internal
285 1.1.1.10 christos BIND 9 architecture implemented by the tool.
286 1.1.1.10 christos
287 1.1 christos #### Thanks
288 1.1 christos
289 1.1 christos Thank you for your interest in contributing to the ongoing development
290 1.1.1.3 christos of BIND 9.
291