Debian Codegraph @

CONTRIBUTING.md

raw symbols SCIP
1 # Guide to contributing to Rocq #
2
3 ## Foreword ##
4
5 As with any documentation, this guide is most useful if it's promptly
6 updated to reflect changes in processes, development tools, or the Rocq
7 ecosystem. If you notice anything inaccurate or outdated, please
8 signal it in a new issue, or fix it in a new pull request. If you
9 find some parts are not sufficiently clear, you may open an issue as
10 well.
11
12 ## Table of contents ##
13
14 - [Guide to contributing to Rocq](#guide-to-contributing-to-rocq)
15 - [Foreword](#foreword)
16 - [Table of contents](#table-of-contents)
17 - [Introduction](#introduction)
18 - [Contributing to the ecosystem](#contributing-to-the-ecosystem)
19 - [Asking and answering questions](#asking-and-answering-questions)
20 - [Writing tutorials and blog posts](#writing-tutorials-and-blog-posts)
21 - [Contributing to the wiki](#contributing-to-the-wiki)
22 - [Creating and maintaining Rocq packages](#creating-and-maintaining-rocq-packages)
23 - [Distribution of Rocq packages](#distribution-of-rocq-packages)
24 - [Support for plugin and library authors](#support-for-plugin-and-library-authors)
25 - [Standard libraries](#standard-libraries)
26 - [Maintaining existing packages in Rocq-community](#maintaining-existing-packages-in-rocq-community)
27 - [Contributing to the editor support packages](#contributing-to-the-editor-support-packages)
28 - [Contributing to the website or the package archive](#contributing-to-the-website-or-the-package-archive)
29 - [Other ways of creating content](#other-ways-of-creating-content)
30 - [Issues](#issues)
31 - [Reporting a bug, requesting an enhancement](#reporting-a-bug-requesting-an-enhancement)
32 - [Beta testing](#beta-testing)
33 - [Helping triage existing issues](#helping-triage-existing-issues)
34 - [Code changes](#code-changes)
35 - [Using GitHub pull requests](#using-github-pull-requests)
36 - [Fixing bugs and performing small changes](#fixing-bugs-and-performing-small-changes)
37 - [Proposing large changes: Rocq RFCs](#proposing-large-changes-rocq-rfcs)
38 - [Seeking early feedback on work-in-progress](#seeking-early-feedback-on-work-in-progress)
39 - [Taking feedback into account](#taking-feedback-into-account)
40 - [Understanding automatic feedback](#understanding-automatic-feedback)
41 - [Test-suite failures](#test-suite-failures)
42 - [Linter failures](#linter-failures)
43 - [Plugin failures](#plugin-failures)
44 - [Library failures](#library-failures)
45 - [Understanding reviewers' feedback](#understanding-reviewers-feedback)
46 - [Fixing your branch](#fixing-your-branch)
47 - [Improving the official documentation](#improving-the-official-documentation)
48 - [Becoming a maintainer](#becoming-a-maintainer)
49 - [Reviewing pull requests](#reviewing-pull-requests)
50 - [Collaborating on a pull request](#collaborating-on-a-pull-request)
51 - [Merging pull requests](#merging-pull-requests)
52 - [Additional notes for pull request reviewers and assignees](#additional-notes-for-pull-request-reviewers-and-assignees)
53 - [Joining / leaving maintainer teams](#joining--leaving-maintainer-teams)
54 - [Core development team](#core-development-team)
55 - [Release management](#release-management)
56 - [Packaging Rocq](#packaging-rocq)
57 - [Additional resources](#additional-resources)
58 - [Developer documentation](#developer-documentation)
59 - [Where to find the resources](#where-to-find-the-resources)
60 - [Building Rocq](#building-rocq)
61 - [Continuous integration](#continuous-integration)
62 - [Restarting failed jobs](#restarting-failed-jobs)
63 - [Code owners, issue and pull request templates](#code-owners-issue-and-pull-request-templates)
64 - [Style guide](#style-guide)
65 - [OCaml resources](#ocaml-resources)
66 - [Git documentation, tips and tricks](#git-documentation-tips-and-tricks)
67 - [GitHub documentation, tips and tricks](#github-documentation-tips-and-tricks)
68 - [Watching the repository](#watching-the-repository)
69 - [Draft pull requests](#draft-pull-requests)
70 - [Turning a PR into draft mode](#turning-a-pr-into-draft-mode)
71 - [GitLab documentation, tips and tricks](#gitlab-documentation-tips-and-tricks)
72 - [Merge script dependencies](#merge-script-dependencies)
73 - [Coqbot](#coqbot)
74 - [Online forum and chat to talk to developers](#online-forum-and-chat-to-talk-to-developers)
75 - [Rocq calls](#rocq-calls)
76 - [Rocq remote working groups](#rocq-remote-working-groups)
77 - [Rocq Users and Developers Workshops](#rocq-users-and-developers-workshops)
78
79 ## Introduction ##
80
81 Thank you for your interest in contributing to Rocq! There are many
82 ways to contribute, and we appreciate all of them.
83
84 People often begin by making small contributions, and contributions to
85 the ecosystem, before working their way up incrementally to the core
86 parts of the system, and start to propose larger changes, or take an
87 active role in maintaining the system. So this is the way this
88 contributing guide is organized. However, it is by no means necessary
89 that you go through these steps in this order. Feel free to use this
90 guide as a reference and quickly jump to the part that is most
91 relevant to you at the current time.
92
93 We want to make sure that contributing to Rocq is a fun and positive
94 experience for everyone, so please make sure you read and abide by our
95 [Code of Conduct][Code-of-conduct].
96
97 ## Contributing to the ecosystem ##
98
99 In this section, we present all the ways to contribute to Rocq outside
100 of the Rocq repository itself.
101
102 ### Asking and answering questions ###
103
104 One very important way of contributing is by asking and answering
105 questions, in order to create a body of easily-browsable,
106 problem-oriented, additional documentation.
107
108 There are many platforms for this purpose:
109
110 - Our [Zulip chat][Zulip], which contains a main "#Rocq users" stream,
111 but also many other streams dedicated to specific Rocq packages, such
112 as Equations, MathComp, etc.
113 - Our [Discourse forum][Discourse], which contains a main "Using Rocq"
114 category, but also categories dedicated to asking questions in other
115 languages than English. They have yet to find their public, so do not
116 hesitate to advertise them to people you know who might not be at
117 ease with English.
118 - The [Proof Assistants Stack Exchange][Proof-Assistants-SE], a Q&A
119 site for users of proof assistants, including the Rocq Prover.
120 - Other [Stack Exchange][Stack-Exchange] sites, and particularly
121 [Stack Overflow][Stack-Overflow], receive questions about Rocq.
122 Questions asked anywhere on Stack Exchange with the `coq` tag are
123 automatically relayed to Zulip in a [dedicated topic][Stack-Exchange-to-Zulip].
124
125 Other active places to answer questions include the [Coq-Club][]
126 mailing list, the [Coq IRC channel][IRC], the
127 [/r/Coq subreddit][Reddit], etc.
128
129 ### Writing tutorials and blog posts ###
130
131 Writing about the Rocq Prover, in the form of tutorials or blog posts, is also a
132 very important contribution. In particular, it can help new users get
133 interested in Rocq, and learn about it, and existing users learn about
134 advanced features. The [reference manual][refman] is not suited for learning Rocq, but
135 we now also provide short, action-oriented tutorials as part of our official resources.
136 See the [Platform Docs][Platform-docs] repository for more information.
137
138 The Rocq website has a page listing known
139 [books][Rocq-books], including non-English books,
140 which you can expand through a pull request on the
141 [Rocq website repository][Rocq-website-repository].
142
143 Blog posts from the Rocq ecosystem are aggregated on the [Rocq Planet][Rocq-planet] page.
144 If your blog is mainly about Rocq, you can contribute by adding it to the list.
145
146 ### Contributing to the wiki ###
147
148 Rocq's [wiki][] is an informal source of additional documentation which
149 anyone with a GitHub account can edit directly. In particular, it
150 contains the Rocq [FAQ][] which has not seen so many updates in the
151 recent years. You should feel free to fix it, expand it, and even
152 refactor it (if you are not sure if some changes would be welcome, you
153 can open an issue to discuss them before performing them).
154
155 People who watch the Rocq repository will see recent wiki edits in
156 their GitHub feed. It is recommended to review them *a posteriori* to
157 check no mistake was introduced. The wiki is also a standard git
158 repository, so people can follow the changes using any standard git
159 tool.
160
161 Rocq's wiki is formatted using GitHub's flavored Markdown, with some
162 wiki-specific extensions. See:
163
164 - [GitHub's Markdown guide][GitHub-markdown]
165 - [GitHub's wiki extensions][GitHub-wiki-extensions]
166
167 ### Creating and maintaining Rocq packages ###
168
169 *Note: this sub-section is about packages extending Rocq, such as
170 plugins or libraries. A different, but also very valuable,
171 contribution is to package Rocq for your preferred package manager (see
172 [Packaging Rocq](#packaging-rocq)).*
173
174 Sharing reusable assets in the form of new libraries, plugins, and
175 tools is great so that others can start building new things on top.
176 Having an extensive and healthy package ecosystem is key to the
177 success of Rocq.
178
179 #### Distribution of Rocq packages ####
180
181 You can distribute your library or plugin through the [Rocq package
182 index][Rocq-package-index]. Important packages and tools can be advertised on the [Awesome Coq][Awesome-Coq] list. Some packages are
183 distributed along Rocq, within the [Rocq Platform][Rocq-Platform]. Check
184 the Platform's charter if you consider adding your package to it.
185
186 #### Support for plugin and library authors ####
187
188 You can find advice and best practices about maintaining a Rocq project
189 on the [Rocq-community wiki][rocq-community-wiki].
190
191 Learn how to write a Rocq plugin, and about best practices, in the Rocq
192 [plugin tutorial][plugin-tutorial]. This tutorial is still a work in
193 progress, so do not hesitate to expand it, or ask questions.
194
195 If you want quick feedback on best practices, or how to talk to the
196 Rocq API, a good place to hang out is the [Rocq devs & plugin devs
197 stream][Zulip-dev] of our Zulip chat.
198
199 Finally, we strongly encourage authors of plugins to submit their
200 plugins to join Rocq's continuous integration (CI) early on. Indeed,
201 the Rocq API gets continuously reworked, so this is the best way of
202 ensuring your plugin stays compatible with new Rocq versions, as this
203 means Rocq developers will fix your plugin for you. Learn more about
204 this in the [CI README (user part)][CI-README-users].
205
206 Pure Rocq libraries are also welcome to join Rocq's CI, especially if
207 they test underused / undertested features.
208
209 #### Standard libraries ####
210
211 There are many general purpose Rocq libraries, so before you publish
212 yours, consider whether you could contribute to an existing one
213 instead (either the official [standard
214 library][standard-library], or one of the many
215 [alternative standard libraries][other-standard-libraries]).
216
217 #### Maintaining existing packages in Rocq-community ####
218
219 Some Rocq packages are not maintained by their initial authors anymore
220 (for instance if they've moved on to new jobs or new projects) even if
221 they were useful, or interesting. The Rocq-community organization is a
222 place for volunteers to take over the maintenance of such packages.
223
224 If you want to contribute by becoming a maintainer, there is [a list
225 of packages waiting for a
226 maintainer][rocq-community-maintainer-wanted]. You can also propose a
227 package that is not listed. Find out more about Rocq-community in [the
228 manifesto's README][rocq-community-manifesto].
229
230 ### Contributing to the editor support packages ###
231
232 Besides Rocqide, whose sources are available in this repository, and to
233 which you are welcome to contribute, there are a number of alternative
234 user interfaces for the Rocq Prover, more often as an editor support package.
235
236 Here are the URLs of the repositories of the various editor support
237 packages:
238
239 - Proof-General (Emacs major mode) <https://github.com/ProofGeneral/PG>
240 - Company-coq (Emacs minor mode) <https://github.com/cpitclaudel/company-coq>
241 - Coqtail (Vim) <https://github.com/whonore/Coqtail>
242 - VsCoq (VsCode) <https://github.com/rocq-prover/vscoq>
243
244 And here are alternative user interfaces to be run in the web browser:
245
246 - JsCoq (Coq executed in your browser) <https://github.com/ejgallego/jscoq>
247 - Jupyter kernel for Coq <https://github.com/EugeneLoy/coq_jupyter/>
248
249 Each of them has their own contribution process.
250
251 ### Contributing to the website or the package archive ###
252
253 The website and the package archive have their own repositories:
254
255 - <https://github.com/rocq-prover/rocq-prover.org>
256 - <https://github.com/rocq-prover/opam>
257
258 You can contribute to them by using issues and pull requests on these
259 repositories. These repositories should get their own contributing
260 guides, but they don't have any at the time of writing this.
261
262 ### Other ways of creating content ###
263
264 There are many other ways of creating content and making the Rocq
265 community thrive, including many which we might not have thought
266 about. Feel free to add more references / ideas to this sub-section.
267
268 You can post about Rocq on social media, give talks about Rocq both in
269 academic and non-academic venues (such as developer conferences).
270
271 [Codewars][] is a platform where people can try to solve some
272 programming challenges that were proposed by other community members.
273 Rocq is supported and the community is eager to get more challenges.
274
275 ## Issues ##
276
277 ### Reporting a bug, requesting an enhancement ###
278
279 Bug reports are enormously useful to identify issues with Rocq; we
280 can't fix what we don't know about. To report a bug, please open an
281 issue in the [Rocq issue tracker][Rocq-issue-tracker] (you'll need a
282 GitHub account). You can file a bug for any of the following:
283
284 - An anomaly. These are always considered bugs, so the Rocq Prover will even ask
285 you to file a bug report!
286 - An error you didn't expect. If you're not sure whether it's a bug or
287 intentional, feel free to file a bug anyway. We may want to improve
288 the documentation or error message.
289 - Missing or incorrect documentation. It's helpful to track where the
290 documentation should be improved, so please file a bug if you can't
291 find or don't understand some bit of documentation.
292 - An error message that wasn't as helpful as you'd like. Bonus points
293 for suggesting what information would have helped you.
294 - Bugs in Rocqide should also be filed in the [Rocq issue
295 tracker][Rocq-issue-tracker]. Bugs in the Emacs plugin should be
296 filed against [ProofGeneral][ProofGeneral-issues], or against
297 [company-coq][company-coq-issues] if they are specific to
298 company-coq features.
299
300 It would help if you search the existing issues before reporting a
301 bug. This can be difficult, so consider it extra credit. We don't
302 mind duplicate bug reports. If unsure, you are always very welcome to
303 ask on our [Discourse forum][Discourse] or [Zulip chat][Zulip]
304 before, after, or while writing a bug report.
305
306 It is better if you can test that your bug is still present in the
307 current testing or development version of the Rocq Prover (see the [next
308 sub-section](#beta-testing)) before reporting it, but if you can't, it
309 should not discourage you from reporting it.
310
311 When it applies, it's extremely helpful for bug reports to include sample
312 code, and much better if the code is self-contained and complete. It's not
313 necessary to minimize your bug or identify precisely where the issue is,
314 since someone else can often do this if you include a complete example. We
315 tend to include the code in the bug description itself, but if you have a
316 very large input file then you can add it as an attachment.
317
318 If you want to minimize your bug (or help minimize someone else's) for
319 more extra credit, then you can use the [Rocq bug
320 minimizer][JasonGross-coq-tools] (specifically, the bug minimizer is
321 the `find-bug.py` script in that repo). Nowadays, the easiest way to
322 use the Rocq bug minimizer is to call it through `@coqbot`, as documented
323 [here][coqbot-minimize].
324
325 ### Beta testing ###
326
327 The Rocq Prover gets a new major release about every six months, which is then
328 distributed through the [Rocq Platform][Rocq-Platform].
329 New major versions of Rocq are first made available for beta-testing,
330 before being declared stable and the new default version of the Rocq
331 Platform. You can help make by testing the beta
332 version, and trying to port your projects to it. You should report
333 any bug you notice, but also any change of behavior that is not
334 documented in the changelog. Then Rocq developers will be able to
335 check if what you reported is a regression that needs to be fixed, or
336 an expected change that needs to be mentioned in the changelog.
337
338 You can go even further by using the development version (`master`
339 branch) of Rocq on a day by day basis, and report problems as soon as
340 you notice them. If you wish to do so, the easiest way to install Rocq
341 is through opam (using the `dev` version of the Rocq package, available
342 in the <https://rocq-prover.org/opam/core-dev> repository) or through
343 [Nix][]. The documentation of the development version is [available
344 online][master-doc], including the [unreleased
345 changelog][unreleased-changelog].
346
347 ### Helping triage existing issues ###
348
349 The Rocq Prover has too many bug reports for its core developers alone to manage.
350 You can help a lot by:
351
352 - confirming that reported bugs are still active with the current
353 version of the Rocq Prover;
354 - determining if the bug is a regression (new, and unexpected,
355 behavior from a recent Rocq version);
356 - more generally, by reproducing a bug, on another system,
357 configuration, another version of Rocq, and by documenting what you
358 did;
359 - giving a judgement about whether the reported behavior is really a
360 bug, or is expected but just improperly documented, or expected and
361 already documented;
362 - producing a trace if it is relevant and you know how to do it;
363 - producing another example exhibiting the same bug, or minimizing the
364 initial example using the bug minimizer mentioned above;
365 - using `git bisect` to find the commit that introduced a regression;
366 - fixing the bug if you have an idea of how to do so (see the
367 [following section](#code-changes)).
368
369 Once you have some experience with the Rocq issue tracker, you can
370 request to join the **@rocq-prover/contributors** team (any member of the
371 **@rocq-prover/core** team can give you access using [this link][add-contributor]).
372 Being in this team will grant you the following access:
373
374 - **Updating labels:** every open issue and pull request should
375 ideally get one or several `kind:` and `part:` labels. In
376 particular, valid issues should generally get either a `kind: bug`
377 (the reported behavior can indeed be considered a bug, this can be
378 completed with the `kind: anomaly`, and `kind: regression` labels),
379 `kind: documentation` (e.g. if a reported behavior is expected but
380 improperly documented), `kind: enhancement` (a request for
381 enhancement of an existing feature), or `kind: feature` label (an
382 idea for a new feature).
383 - **Creating new labels:** if you feel a `part:` label is missing, do
384 not hesitate to create it. If you are not sure, you may discuss it
385 with other contributors and developers on [Zulip][Zulip-dev] first.
386 - **Closing issues:** if a bug cannot be reproduced anymore, is a
387 duplicate, or should not be considered a bug report in the first
388 place, you should close it. When doing so, try putting an
389 appropriate `resolved:` label to indicate the reason. If the bug
390 has been fixed already, and you know in which version, you can add a
391 milestone to it, even a milestone that's already closed, instead of
392 a `resolved:` label. When closing a duplicate issue, try to add all
393 the additional info that could be gathered to the original issue.
394 - **Editing issue titles:** you may want to do so to better reflect
395 the current understanding of the underlying issue.
396 - **Editing comments:** feel free to do so to fix typos and formatting
397 only (in particular, some old comments from the Bugzilla era or
398 before are not properly formatted). You may also want to edit the
399 OP's initial comment (a.k.a. body of the issue) to better reflect
400 the current understanding of the issue, especially if the discussion
401 is long. If you do so, only add to the original comment, and mark
402 it clearly with an `EDITED by @YourNickname:`.
403 - **Hiding comments:** when the discussion has become too long, this
404 can be done to hide irrelevant comments (off-topic, outdated or
405 resolved sub-issues).
406 - **Deleting things:** please don't delete any comment or issue, our
407 policy doesn't allow for comments to be deleted, unless done by the
408 community moderators. You should hide them instead. An audit log
409 is available to track deleted items if needed (but does not allow
410 recovering them).
411
412 However, and contrary to most other repositories, it will not give you
413 the ability to push new branches or tags to the repository. This is
414 disabled because we prefer to use forks to work on feature branches.
415
416 Yet to be fully specified: use of priority, difficulty, `help wanted`,
417 and `good first issue` labels, milestones, assignments, and GitHub
418 projects.
419
420 ## Code changes ##
421
422 ### Using GitHub pull requests ###
423
424 If you want to contribute a documentation update, bug fix or feature
425 yourself, pull requests (PRs) on the [GitHub
426 repository][rocq-repository] are the way to contribute directly to the
427 Rocq Prover implementation (all changes, even the smallest changes from core
428 developers, go through PRs). You will need to create a fork of the
429 repository on GitHub and push your changes to a new "topic branch" in
430 that fork (instead of using an existing branch name like `master`).
431
432 PRs should always target the `master` branch. Make sure that your
433 copy of this branch is up-to-date before starting to do your changes,
434 and that there are no conflicts before submitting your PR. If you
435 need to fix conflicts, we generally prefer that you rebase your branch
436 on top of `master`, instead of creating a merge commit.
437
438 If you are not familiar with `git` or GitHub, Sections [Git
439 documentation, tips and tricks](#git-documentation-tips-and-tricks),
440 and [GitHub documentation, tips and
441 tricks](#github-documentation-tips-and-tricks), should be helpful (and
442 even if you are, you might learn a few tricks).
443
444 Once you have submitted your PR, it may take some time to get
445 feedback, in the form of reviews from maintainers, and test results
446 from our continuous integration system. Our code owner system will
447 automatically request reviews from relevant maintainers. Then, one
448 maintainer should self-assign the PR (if that does not happen after a
449 few days, feel free to ping the maintainers that were requested a
450 review). The PR assignee will then become your main point of contact
451 for handling the PR: they should ensure that everything is in order
452 and merge when it is the case (you can ping them if the PR is ready
453 from your side but nothing happens for a few days).
454
455 After your PR is accepted and merged, it may get backported to a
456 release branch if appropriate, and will eventually make it to a
457 release. You do not have to worry about this, it is the role of the
458 assignee and the release manager to do so (see Section [Release
459 management](#release-management)). The milestone should give you an
460 indication of when to expect your change to be released (this could be
461 several months after your PR is merged). That said, you can start
462 using the latest Rocq `master` branch to take advantage of all the new
463 features, improvements, and fixes.
464
465 #### Fixing bugs and performing small changes ####
466
467 Before fixing a bug, it is best to check that it was reported before:
468
469 - If it was already reported and you intend to fix it, self-assign the
470 issue (if you have the permission), or leave a comment marking your
471 intention to work on it (and a contributor with write-access may
472 then assign the issue to you).
473
474 - If the issue already has an assignee, you should check with them if
475 they still intend to work on it. If the assignment is several
476 weeks, months, or even years (!) old, there are good chances that it
477 does not reflect their current priorities.
478
479 - If the bug has not been reported before, it can be a good idea to
480 open an issue about it, while stating that you are preparing a fix.
481 The issue can be the place to discuss about the bug itself while the
482 PR will be the place to discuss your proposed fix.
483
484 It is generally a good idea to add a regression test to the
485 test-suite. See the test-suite [README][test-suite-README] for how to
486 do so.
487
488 Small fixes do not need any documentation, or changelog update. New,
489 or updated, user-facing features, and major bug fixes do. See the
490 [corresponding section](#improving-the-official-documentation) for
491 on how to contribute to the documentation, and the README in
492 [`doc/changelog`][user-changelog] for how to add a changelog entry.
493
494 #### Proposing large changes: Rocq RFCs ####
495
496 Please refrain to open very large PRs without discussing them first.
497 Indeed, you should be aware that the larger the change, the higher
498 the chances it will take very long to review, and possibly never get
499 merged.
500
501 So it is recommended that before spending a lot of time coding, you
502 seek feedback from maintainers to see if your change would be
503 supported, and if they have recommendations about its implementation.
504 You can do this informally by opening an issue, or more formally by
505 producing a design document as a [RFCs][RFCs].
506
507 Another recommendation is that you do not put several unrelated
508 changes in the same PR (even if you produced them together). In
509 particular, make sure you split bug fixes into separate PRs when this
510 is possible. More generally, smaller-sized PRs, or PRs changing fewer
511 components, are more likely to be reviewed and merged promptly.
512
513 #### Seeking early feedback on work-in-progress ####
514
515 You should always feel free to open your PR before the documentation,
516 changelog entry and tests are ready. That's the purpose of the
517 checkboxes in the PR template which you can leave unticked. This can
518 be a way of getting reviewers' approval before spending time on
519 writing the documentation (but you should still do it before your PR
520 can be merged).
521
522 If even the implementation is not ready but you are still looking for
523 early feedback on your code changes, please use the [draft
524 PR](#draft-pull-requests) mechanism.
525
526 If you are looking for feedback on the design of your change, rather
527 than on its implementation, then please refrain from opening a PR.
528 You may open an issue to start a discussion, or create a [Rocq RFC][RFCs] if you have a clear enough view of the
529 design to write a document about it.
530
531 ### Taking feedback into account ###
532
533 #### Understanding automatic feedback ####
534
535 When you open or update a PR, you get automatically some feedback: we
536 have a bot whose job will be to push a branch to our GitLab mirror to
537 run some continuous integration (CI) tests. The tests will run on a
538 commit merging your branch with the base branch, so if there is a
539 conflict and this merge cannot be performed automatically, the bot
540 will put a `needs: rebase` label, and the tests won't run.
541
542 Otherwise, a suite of tests will be run on GitLab, plus some
543 additional tests on GitHub Actions for Windows and macOS compatibility.
544
545 The complete suite of tests is no longer run by default to save
546 resources. But it is still required before merging a PR, so this is why
547 the bot will put a `needs: full CI` label if it has only run the
548 lightweight tests. If you are a member of **@rocq-prover/contributors**, you can
549 request a full run of the CI by putting the `request: full CI` label
550 before pushing to your PR branch, or by commenting
551 `@coqbot: run full CI` after having pushed. (In case you need to re-run
552 the tests, e.g., because the results are outdated, you can also request
553 the bot to do so by commenting `@coqbot: run full CI` or
554 `@coqbot: run light CI`. If you comment `@coqbot: run CI`, the bot will
555 decide whether to run the full or the lightweight tests based on the
556 presence of the `request: full CI` label.)
557
558 If a test fails on GitLab, you will see in the GitHub PR interface,
559 both the failure of the whole pipeline, and of the specific failed
560 job. Most of these failures indicate problems that should be
561 addressed, but some can still be due to synchronization issues out of
562 your control. In particular, if you get a failure in one of the
563 tested plugins but you didn't change the Rocq API, it is probably a
564 transient issue and you shouldn't have to worry about it. In case of
565 doubt, ask the reviewers.
566
567 To re-run a specific failed job, you can use the Re-run jobs button
568 in the GitHub interface (if you are a member of **@rocq-prover/contributors**).
569 This won't create a new merge commits with the base branch, so if you
570 need this, you can use the `@coqbot: run ... CI` commands instead.
571
572 ##### Test-suite failures #####
573
574 If you broke the test-suite, you should get many failed jobs, because
575 the test-suite is run multiple times in various settings. You should
576 get the same failure locally by running `make test-suite`. It's
577 helpful to run this locally and ensure the test-suite is not broken
578 before submitting a PR as this will spare a lot of runtime on distant
579 machines.
580
581 To learn more about the test-suite, you should refer to its
582 [README][test-suite-README].
583
584 ##### Linter failures #####
585
586 We have a linter that checks a few different things:
587
588 - **Every commit can build.** This is an important requirement to
589 allow the use of `git bisect` in the future. It should be possible
590 to build every commit, and in principle even the test-suite should
591 pass on every commit (but this isn't tested in CI because it would
592 take too long). A good way to test this locally is to use
593 `git rebase master --exec "make check"`.
594 - **No tabs or end-of-line spaces on updated lines**. We are trying
595 to get rid of all tabs and all end-of-line spaces from the code base
596 (except in some very special files that need them). This checks not
597 only that you didn't introduce new ones, but also that updated lines
598 are clean (even if they were there before). You can avoid worrying
599 about tabs and end-of-line spaces by installing our [pre-commit git
600 hook][git-hook], which will fix these issues at commit time.
601 Running `./configure` once will install this hook automatically
602 unless you already have a pre-commit hook installed. If you are
603 encountering these issues nonetheless, you can fix them by rebasing
604 your branch with `git rebase --whitespace=fix`.
605 - **All files should end with a single newline**. See the section
606 [Style guide](#style-guide) for additional style recommendations.
607 - **Documented syntax is up-to-date**. If you update the grammar, you
608 should run `make doc_gram_rsts` to update the
609 documented syntax. You should then update the text describing the
610 syntax in the documentation and commit the changes. In some cases,
611 the documented syntax is edited to make the documentation more
612 readable. In this case, you may have to edit
613 `doc/tools/docgram/common.edit_mlg` to make `doc_gram_rsts` pass.
614 See [doc_grammar's README][doc_gram] for details.
615
616 Note that in the case where you added new commands or tactics, you
617 will have to manually insert them in the documentation, the tool
618 won't do that for you, although it should detect in most cases if you
619 have forgotten to add documentation for your new command or tactic,
620 or if the documentation is not consistent with the parser.
621 - **.opam files are up to date**. Rocq's `*.opam` files are generated
622 automatically from metadata in `dune-project`. If the meta-data
623 becomes out of sync, the linter will complain. This can be fixed
624 doing `dune build *.opam` at the root of Rocq's repository.
625
626 You may run the linter yourself with `dev/lint-repository.sh`.
627
628 ##### Plugin failures #####
629
630 If you did change the Rocq API, then you may have broken a plugin.
631 After ensuring that the failure comes from your change, you will have
632 to provide a fix to the plugin, and the PR assignee will have to
633 ensure that this fix is merged in the plugin simultaneously with your
634 PR on the Rocq repository.
635
636 If your changes to the API are not straightforward, you should also
637 document them in `dev/doc/changes.md`.
638
639 The [CI README (developer part)][CI-README-developers] contains more
640 information on how to fix plugins, test and submit your changes, and
641 how you can anticipate the results of the CI before opening a PR.
642
643 ##### Library failures #####
644
645 Such a failure can indicate either a bug in your branch, or a breaking
646 change that you introduced voluntarily. All such breaking changes
647 should be properly documented in the [user changelog][user-changelog].
648 Furthermore, a backward-compatible fix should be found, properly
649 documented in the changelog when non-obvious, and this fix should be
650 merged in the broken projects *before* your PR to the Rocq repository
651 can be.
652
653 Note that once the breaking change is well understood, it should not
654 feel like it is your role to fix every project that is affected: as
655 long as reviewers have approved and are ready to integrate your
656 breaking change, you are entitled to (politely) request project
657 authors / maintainers to fix the breakage on their own, or help you
658 fix it. Obviously, you should leave enough time for this to happen
659 (you cannot expect a project maintainer to allocate time for this as
660 soon as you request it) and you should be ready to listen to more
661 feedback and reconsider the impact of your change.
662
663 If you need help figuring out why your PR is breaking a tested project,
664 you may consider requesting automatic minimization of the failure with
665 the bot. In principle, the bot should automatically propose this option
666 to you if it is available (it needs to detect a failure in a Rocq file
667 and it needs to confirm that the failure was not already present in the
668 base branch to propose to run the minimization process).
669
670 #### Understanding reviewers' feedback ####
671
672 The reviews you get are highly dependent on the kind of changes you
673 did. In any case, you should always remember that reviewers are
674 friendly volunteers that do their best to help you get your changes in
675 (and should abide by our [Code of Conduct][Code-of-Conduct]). But at
676 the same time, they try to ensure that code that is introduced or
677 updated is of the highest quality and will be easy to maintain in the
678 future, and that's why they may ask you to perform small or even large
679 changes. If you need a clarification, do not hesitate to ask.
680
681 Here are a few labels that reviewers may add to your PR to track its
682 status. In general, this will come in addition to comments from the
683 reviewers, with specific requests.
684
685 - [needs: fixing][needs-fixing] indicates the PR needs a fix, as
686 discussed in the comments.
687 - [needs: documentation][needs-documentation] indicates the PR
688 introduces changes that should be documented before it can be merged.
689 This label may be used to reflect that the corresponding checkbox is
690 not yet checked in the PR template (so that we don't forget when
691 we intend to merge the PR).
692 - [needs: changelog entry][needs-changelog] indicates the PR introduces
693 changes that should be documented in the [user
694 changelog][user-changelog]. Similarly to the previous label, this
695 may be used to reflect that the corresponding checkbox is not yet
696 checked in the PR template.
697 - [needs: test-suite update][needs-test-suite] indicates that tests
698 should be added to the test-suite / modified to ensure that the
699 changes are properly tested. Similarly to the previous two labels,
700 this may be used to reflect that the corresponding checkbox is not
701 yet checked in the PR template.
702 - [needs: benchmarking][needs-benchmarking] and [needs: testing][needs-testing]
703 indicate the PR needs testing beyond what the test suite can handle.
704 For example, performance benchmarking is currently performed with a different
705 infrastructure ([documented in the wiki][Benchmarking]). Unless some followup
706 is specifically requested, you aren't expected to do this additional testing.
707
708 More generally, such labels should come with a description that should
709 allow you to understand what they mean.
710
711 #### Fixing your branch ####
712
713 If you have changes to perform before your PR can be merged, you might
714 want to do them in separate commits at first to ease the reviewers'
715 task, but we generally appreciate that they are squashed with the
716 commits that they fix before merging. This is especially true of
717 commits fixing previously introduced bugs or failures.
718
719 ### Improving the official documentation ###
720
721 The documentation is usually a good place to start contributing,
722 because you can get used to the pull request submitting and review
723 process, without needing to learn about the code source of Rocq at the
724 same time.
725
726 The official documentation is formed of two components:
727
728 - the [reference manual][refman],
729 - the [documentation of the prelude][stdlib-doc].
730
731 The sources of the reference manual are located in the
732 [`doc/sphinx`][refman-sources] directory. They are written in rst
733 (Sphinx) format with some Rocq-specific extensions, which are
734 documented in the [README][refman-README] in the above directory.
735 This README was written to be read from begin to end. As soon as your
736 edits to the documentation are more than changing the textual content,
737 we strongly encourage you to read this document.
738
739 The documentation of the prelude is generated with
740 [rocq doc][rocqdoc-documentation] from the comments in the sources of the
741 standard library.
742
743 The [README in the `doc` directory][doc-README] contains more
744 information about the documentation's build dependencies, and the
745 `make` targets.
746
747 You can browse through the list of open documentation issues using the
748 [kind: documentation][kind-documentation] label, or the [user
749 documentation GitHub project][documentation-github-project] (you can
750 look in particular at the "Writing" and "Fixing" columns).
751
752 ## Becoming a maintainer ##
753
754 ### Reviewing pull requests ###
755
756 You can start reviewing PRs as soon as you feel comfortable doing so
757 (anyone can review anything, although some designated reviewers
758 will have to give a final approval before a PR can be merged, as is
759 explained in the next sub-section).
760
761 Reviewers should ensure that the code that is changed or introduced is
762 in good shape and will not be a burden to maintain, is unlikely to
763 break anything, or the compatibility-breakage has been identified and
764 validated, includes documentation, changelog entries, and test files
765 when necessary. Reviewers can use `needs:` labels, or change requests
766 to further emphasize what remains to be changed before they can approve
767 the PR. Once reviewers are satisfied (regarding the part they
768 reviewed), they should formally approve the PR, possibly stating what
769 they reviewed.
770
771 That being said, reviewers should also make sure that they do not make
772 the contributing process harder than necessary: they should make it
773 clear which comments are really required to perform before approving,
774 and which are just suggestions. They should strive to reduce the
775 number of rounds of feedback that are needed by posting most of their
776 comments at the same time. If they are opposed to the change, they
777 should clearly say so from the beginning to avoid the contributor
778 spending time in vain. They should avoid making nitpick comments when
779 in fact, they have larger concerns that should be addressed first
780 (these larger concerns should then be made very clear).
781
782 Furthermore, when reviewing a first contribution (GitHub highlights
783 first-time contributors), be extra careful to be welcoming, whatever
784 the decision on the PR is. When approving a PR, consider thanking the
785 newcomer for their contribution, even if it is a very small one (in
786 cases where, if the PR had come from a regular contributor, it would
787 have felt OK to just merge it without comment). When rejecting a PR,
788 take some extra steps to explain the reasons, so that it doesn't feel
789 hurtful. Don't hesitate to still thank the contributor and possibly
790 redirect them to smaller tasks that might be more appropriate for a
791 newcomer.
792
793 #### Collaborating on a pull request ####
794
795 Beyond making suggestions to a PR author during the review process,
796 you may want to collaborate further by checking out the code, making
797 changes, and pushing them. There are two main ways of doing this:
798
799 - **Pull requests on pull requests:** You can checkout the PR branch
800 (GitHub provides the link to the remote to pull from and the branch
801 name on the top and the bottom of the PR discussion thread),
802 checkout a new personal branch from there, do some changes, commit
803 them, push to your fork, and open a new PR on the PR author's fork.
804 - **Pushing to the PR branch:** If the PR author has not unchecked the
805 "Allow edit from maintainers" checkbox, and you have write-access to
806 the repository (i.e. you are in the **@rocq-prover/contributors** team),
807 then you can also push (and even force-push) directly to the PR
808 branch, on the main author's fork. Obviously, don't do it without
809 coordinating with the PR author first (in particular, in case you
810 need to force-push).
811
812 When several people have co-authored a single commit (e.g. because
813 someone fixed something in a commit initially authored by someone
814 else), this should be reflected by adding ["Co-authored-by:"
815 tags][GitHub-co-authored-by] at the end of the commit message. The
816 line should contain the co-author name and committer e-mail address.
817
818 ### Merging pull requests ###
819
820 Our [CODEOWNERS][] file associates a team of maintainers to each
821 component. When a PR is opened (or a [draft PR](#draft-pull-requests)
822 is marked as ready for review), GitHub will automatically request
823 reviews to maintainer teams of affected components. As soon as it is
824 the case, one available member of a team that was requested a review
825 should self-assign the PR, and will act as its shepherd from then on.
826
827 The PR assignee is responsible for making sure that all the proposed
828 changes have been reviewed by relevant maintainers (at least one
829 reviewer for each component that is significantly affected), that
830 change requests have been implemented, that CI is passing, and
831 eventually will be the one who merges the PR.
832
833 The PR assignee may use their own judgement to decide to merge a PR that
834 has not received reviews from all maintainers of affected components,
835 depending on how large or controversial the changes to these components
836 are. It is also admissible to have an assignee who is not a maintainer
837 of any of the affected components, in case relevant maintainers are not
838 available, and as long as the assignee is a member of the
839 **@rocq-prover/pushers** team and is able to understand the changes in the PR.
840
841 *If you have already frequently contributed to a component, we would
842 be happy to have you join one of the maintainer teams.* See the
843 [section below](#joining--leaving-maintainer-teams) on joining /
844 leaving maintainer teams.
845
846 The complete list of maintainer teams is available [here][rocq-pushers]
847 (link only accessible to people who are already members of the Rocq
848 Prover organization, however, this list is also used to [generate](https://github.com/rocq-prover/rocq-prover.org/tree/main/data#github-teams)
849 the various [Rocq team][rocq-team] subpages on the website).
850
851 #### Additional notes for pull request reviewers and assignees ####
852
853 - NEVER USE GITHUB'S MERGE BUTTON. Instead, you should either:
854
855 - post a comment containing "@coqbot: merge now";
856 This is the recommended method and more convenient than the previous
857 script based method (see next bullet) e.g. for developers who do not have
858 a GPG key and for when you do not have access to a console.
859 "coqbot" will **not** check CI status - it is expected that the merger does
860 this manually upfront, but coqbot will deny the merge with an error
861 response in the following cases:
862 - no assignee
863 - no milestone
864 - no `kind` label
865 - left-over `needs` labels
866 - you try to merge a PR which you authored (this is decided by the
867 creator of the PR - reviewers can still do minor changes and merge)
868
869 - alternatively run the [`dev/tools/merge-pr.sh`][merge-pr] script;
870 Since "coqbot" this method is deprecated with a few exceptions, like
871 merges to release branches - which only release managers do.
872 This requires having configured gpg with git.
873
874 - PR authors or co-authors cannot review, self-assign, or merge the PR
875 they contributed to. However, reviewers may push small fixes to the
876 PR branch to facilitate the PR integration.
877
878 - PRs are merged when there is consensus. Consensus is defined by an
879 explicit approval from at least one maintainer for each component
880 that is significantly affected and an absence of dissent. As soon
881 as a developer opposes a PR, it should not be merged without being
882 discussed first (usually in a call or working group).
883
884 - Sometimes (especially for large or potentially controversial PRs),
885 it is a good practice to announce the intent to merge, one or
886 several days in advance, when unsure that everyone had a chance to
887 voice their opinion, or to finish reviewing the PR.
888
889 - Only PRs targeting the `master` branch can be merged by a
890 maintainer. For PRs targeting an actively maintained release
891 branch, the assignee should always be the release manager. For older
892 release branches, any **@rocq-prover/core** member can merge any PR (but such
893 PRs should be limited to fixing build issues).
894
895 - Before merging, the assignee must also select a milestone for the PR
896 (see also Section [Release management](#release-management)).
897
898 - To know which files you are a maintainer of, you can look for black
899 shields icons in the "Files changed" tab.
900
901 ![shield icon](dev/doc/shield-icon.png)
902
903 - When a PR has [overlays][user-overlays], then:
904
905 - the overlays that are backward-compatible (normally the case for
906 overlays fixing Rocq code) should have been merged *before* the PR
907 can be merged; it might be a good idea to ask the PR author to
908 remove the overlay information from the PR to get a fresh CI run
909 and ensure that all the overlays have been merged; the PR assignee
910 may also push a commit removing the overlay information (in that
911 case the assignee is not considered a co-author, hence no need to
912 change the assignee)
913
914 - the overlays that are not backward-compatible (normally only the
915 case for overlays fixing OCaml code) should be merged *just after*
916 the PR has been merged (and thus the assignee should ping the
917 maintainers of the affected projects to ask them to merge the
918 overlays).
919
920 #### Joining / leaving maintainer teams ####
921
922 We are always happy to have more people involved in the PR reviewing
923 and merging process, so do not hesitate to propose yourself if you
924 already have experience on a component.
925
926 Maintainers can leave teams at any time (and core members can also
927 join any team where they feel able to help) but you should always
928 announce it to other maintainers when you do join or leave a team.
929
930 ### Core development team ###
931
932 The core developers are the active developers with a lengthy and
933 significant contribution track record. They are the ones with admin
934 powers over the Rocq organization, and the ones who take part in
935 [votes][voting-process]
936 in case of conflicts to take a decision (rare). One of them is
937 designated as a development coordinator, and has to approve the
938 changes in the core team membership (until we get a more formal
939 joining and leaving process).
940
941 The core developers are the members of the **@rocq-prover/core** team ([member
942 list][rocq-core] only visible to the Rocq organization members because
943 of a limitation of GitHub). They are also listed on the
944 [Rocq Team page][rocq-team].
945
946 ## Release management ##
947
948 The Rocq Prover major release cycles generally span about six months, with about
949 4-5 months of development, and 1-2 months of stabilization /
950 release candidates. The release manager (RM) role is a rolling position
951 among core developers. The [release plan][release-plan] is published
952 on the wiki.
953
954 Development of new features, refactorings, deprecations and clean-ups
955 always happens on `master`. Stabilization starts by branching
956 (creating a new `v...` release branch from the current `master`), which
957 marks the beginning of a feature freeze (new features will continue to
958 be merged into `master` but won't make it for the upcoming major
959 release, but only for the next one).
960
961 After branching, most changes are introduced in the release branch by a
962 backporting process. PR authors and assignee can signal a desire to
963 have a PR backported by selecting an appropriate milestone. Most of
964 the time, the choice of milestone is between two options: the next
965 major version that has yet to branch from `master`, or the next
966 version (rc, final, or patch-level release) of the active release
967 branch. In the end, it is the RM who decides whether to follow or not
968 the recommendation of the PR assignee, and who backports PRs to the
969 release branch.
970
971 Very specific changes that are only relevant for the release branch and
972 not for the `master` branch can result in a PR targeting the release
973 branch instead of `master`. In this case, the RM is the only one who
974 can merge the PR, and they may even do so if they are the author of
975 the PR. Examples of such PRs include bug fixes to a feature that has
976 been removed in `master`, and PRs from the RM changing the version
977 number in preparation for the next release.
978
979 Some automation is in place to help the RM in their task: a GitHub
980 project is created at branching time to manage PRs to backport; when a
981 PR is merged in a milestone corresponding to the release branch, our
982 bot will add this PR in a "Request inclusion" column in this project;
983 the RM can browse through the list of PRs waiting to be backported in
984 this column, possibly reject some of them by simply removing the PR
985 from the column (in which case, the bot will update the PR milestone),
986 and proceed to backport others; when a backported PR is pushed to the
987 release branch, the bot moves the PR from the "Request inclusion"
988 column to a "Shipped" column.
989
990 More information about the RM tasks can be found in the [release
991 process checklist][RM-checklist].
992
993 ### Packaging Rocq ###
994
995 The RM role does not include the task of making Rocq available through
996 the various package managers out there: several contributors (most
997 often external to the development team) take care of this, and we
998 thank them for this. If your preferred package manager does not
999 include the Rocq Prover, it is a very worthy contribution to make it available
1000 there. But be careful not to let a package get outdated, as this
1001 could lead some users to install an outdated version of Rocq without
1002 even being aware of it. Beyond packaging the Rocq Prover itself, you might want to
1003 consider packaging the rest of Rocq packages available to users through
1004 the [Rocq Platform][Rocq-Platform]. In this case, it would be helpful if
1005 you try to favor the same versions as in the Rocq Platform.
1006
1007 This [Repology page][repology-coq] lists the versions of the Rocq Prover which are
1008 packaged in many repositories, although it is missing information on
1009 some repositories, like opam.
1010
1011 The Windows and macOS installers are created as part of the preparation
1012 of the Rocq Platform.
1013
1014 ## Additional resources ##
1015
1016 ### Developer documentation ###
1017
1018 #### Where to find the resources ####
1019
1020 - You can find developer resources in the `dev` directory, and more
1021 specifically developer documentation in `dev/doc`. The
1022 [README][dev-README] in the `dev` directory lists what's available.
1023
1024 For example, [`dev/doc/README.md`][dev-doc-README] is a beginner's
1025 guide to hacking Rocq, and documentation on debugging Rocq can be
1026 found in [`dev/doc/debugging.md`][debugging-doc].
1027
1028 - When it makes sense, the documentation is kept even closer to the
1029 sources, in README files in various directories (e.g. the test-suite
1030 [README][test-suite-README] or the refman [README][refman-README]).
1031
1032 - Documentation of the Rocq API is written directly in comments in
1033 `.mli` files. You can browse it on [the Rocq website][api-doc], or
1034 rebuild it locally (`make apidoc`, requires `odoc` and `dune`).
1035
1036 - A plugin tutorial is located in
1037 [`doc/plugin_tutorial`][plugin-tutorial].
1038
1039 - The Rocq [wiki][] contains additional developer resources.
1040
1041 #### Building Rocq ####
1042
1043 The list of dependencies can be found in the first section of the
1044 [`INSTALL.md`](INSTALL.md) file.
1045
1046 The Rocq Prover is built using the `dune` build system. Run `make` to get help on
1047 the various available targets. Additional documentation can be found
1048 in [`dev/doc/build-system.dune.md`][dev-doc-dune], and in [the
1049 official Dune documentation][dune-doc].
1050
1051 #### Continuous integration ####
1052
1053 Continuous integration (CI) testing is key in ensuring that the
1054 `master` branch is kept in a well-functioning state at all times, and
1055 that no accidental compatibility breakages are introduced. Our CI is
1056 quite extensive since it includes testing many external projects, some
1057 of them taking more than an hour to compile. However, you can get
1058 partial results much more quickly (when our CI is not overloaded).
1059 Nowadays, the full CI is not run by default as already explained in
1060 [Understanding automatic feedback](#understanding-automatic-feedback).
1061
1062 The main documentation resources on our CI are:
1063
1064 - the [README for users, i.e. plugin and library authors][CI-README-users];
1065 - the [README for developers, and contributors][CI-README-developers];
1066 - the README of the [user-overlays][] directory.
1067
1068 Preparing an overlay (i.e. a patch to an external project that we test
1069 in our CI, to make it compile with the modified version of Rocq in your
1070 branch) is a step that everyone goes through at some point. All you
1071 need to know to prepare an overlay manually is in the README in the
1072 [user-overlays][] directory. You might want to use some additional
1073 tooling such as the `make ci-*` targets of `Makefile.ci`, the Nix
1074 support for getting the dependencies of the external projects (see the
1075 README in [`dev/ci/nix`][dev-ci-nix], and the (so far undocumented)
1076 [`dev/tools/create_overlays.sh`][dev-tools-create_overlays.sh] script.
1077
1078 More work is to be done on understanding how each developer proceeds
1079 to prepare overlays, and propose a simplified and documented
1080 procedure.
1081
1082 We also have a benchmarking infrastructure, which is documented [on
1083 the wiki][Benchmarking].
1084
1085 ##### Restarting failed jobs #####
1086
1087 When CI has a few failures which look spurious, restarting the
1088 corresponding jobs is a good way to ensure this was indeed the case.
1089 Most failed jobs can be restarted directly from the "Checks" tab on
1090 GitHub. In case you need to restart a job on GitLab CI using the GitLab
1091 interface, then you should sign into GitLab (this can be
1092 done using a GitHub account) and join the
1093 [Coq GitLab organization][GitLab-organization].
1094
1095 #### Code owners, issue and pull request templates ####
1096
1097 These files can be found in the [`.github`](.github) directory. The
1098 templates are particularly useful to remind contributors what
1099 information we need for them, and, in the case of PRs, to update the
1100 documentation, changelog, and test-suite when relevant.
1101
1102 GitHub now supports setting up multiple issue templates, and we could
1103 use this to define distinct requirements for various kind of bugs,
1104 enhancement and feature requests.
1105
1106 #### Style guide ####
1107
1108 There exists an [old style guide][old-style-guide] whose content is
1109 still mostly relevant. Yet to be done: extract the parts that are
1110 most relevant, and put them in this section instead.
1111
1112 We don't use a code formatter at the current time, and we are
1113 reluctant to merge changes to parts of the code that are unchanged
1114 aside from formatting. However, it is still a good idea if you don't
1115 know how to format a block of code to use the formatting that
1116 [ocamlformat][] would give
1117
1118 #### OCaml resources ####
1119
1120 You can find lots of OCaml resources on <http://ocaml.org/>, including
1121 documentation, a Discourse forum, the package archive, etc. You may
1122 also want to refer to the [Dune documentation][dune-doc].
1123
1124 Another resource is <https://ocamlverse.github.io/>, especially its
1125 [community page][ocamlverse-community], which lists the various OCaml
1126 discussion platforms.
1127
1128 #### Git documentation, tips and tricks ####
1129
1130 Lots of resources about git, the version control system, are available
1131 on the web, starting with the [official website][git].
1132
1133 We recommend a setup with two configured remotes, one for the official
1134 Rocq repository, called `upstream`, and one for your fork, called
1135 `origin`. Here is a way to do this for a clean clone:
1136
1137 ``` shell
1138 git clone https://github.com/rocq-prover/rocq -o upstream
1139 cd rocq
1140 git remote add origin [email protected]:$YOURNAME/rocq
1141 # Make sure you click the fork button on GitHub so that this repository exists
1142 cp dev/tools/pre-commit .git/hooks/ # Setup the pre-commit hook
1143 ```
1144
1145 Then, if you want to prepare a fix:
1146
1147 ``` shell
1148 # Make sure we start from an up-to-date master
1149 git checkout master
1150 git pull --ff-only # If this fails, then your master branch is messy
1151 git checkout -b my-topic-branch
1152 # Modify some files
1153 git add .
1154 # Every untracked or modified file will be included in the next commit
1155 # You can also replace the dot with an explicit list of files
1156 git commit -m "My commit summary.
1157
1158 You can add more information on multiple lines,
1159 but you need to skip a line first."
1160 git push -u origin my-topic-branch
1161 # Next time, you push to this branch, you can just do git push
1162 ```
1163
1164 When you push a new branch for the first time, GitHub gives you a link
1165 to open a PR.
1166
1167 If you need to fix the last commit in your branch (typically, if your
1168 branch has a single commit on top of `master`), you can do so with
1169
1170 ```
1171 git add .
1172 git commit --amend --no-edit
1173 ```
1174
1175 If you need to fix another commit in your branch, or if you need to
1176 fix a conflict with `master`, you will need to learn about `git rebase`.
1177 GitHub provides [a short introduction][GitHub-rebase] to `git rebase`.
1178
1179 #### GitHub documentation, tips and tricks ####
1180
1181 GitHub has [extensive documentation][GitHub-doc] about everything you
1182 can do on the platform, and tips about using `git` as well. See in
1183 particular, [how to configure your commit e-mail
1184 address][GitHub-commit-email] and [how to open a PR from a
1185 fork][GitHub-PR-from-fork].
1186
1187 ##### Watching the repository #####
1188
1189 ["Watching" this repository][GitHub-watching] can result in a very
1190 large number of notifications. We recommend you, either, [configure
1191 your mailbox][notification-email] to handle incoming notifications
1192 efficiently, or you read your notifications within a web browser. You
1193 can configure how you receive notifications in [your GitHub
1194 settings][GitHub-notification-settings], you can use the GitHub
1195 interface to mark as read, save for later or mute threads. Nowadays,
1196 you have also the option to watch only part of the activity (only
1197 issues, only PRs, only releases, etc.).
1198
1199 ##### Draft pull requests #####
1200
1201 [Draft PRs][GitHub-draft-PR] are a mechanism proposed by GitHub to
1202 open a pull request before it is ready for review.
1203
1204 Opening a draft PR is a way of announcing a change and seeking early
1205 feedback without formally requesting maintainers' reviews. Indeed,
1206 you should avoid cluttering our maintainers' review request lists
1207 before a change is ready on your side.
1208
1209 When opening a draft PR, make sure to give it a descriptive enough
1210 title so that interested developers still notice it in their
1211 notification feed. You may also advertise it by talking about it in
1212 our [developer chat][Zulip-dev]. If you know which developer would be
1213 able to provide useful feedback to you, you may also ping them.
1214
1215 ###### Turning a PR into draft mode ######
1216
1217 If a PR was opened as ready for review, but it turns out that it still
1218 needs work, it can be transformed into a draft PR.
1219
1220 In this case, previous review requests won't be removed automatically.
1221 Someone with write access to the repository should remove them
1222 manually. Afterwards, upon marking the PR as ready for review,
1223 someone with write access will have to manually add the review
1224 requests that were previously removed.
1225
1226 #### GitLab documentation, tips and tricks ####
1227
1228 We use GitLab mostly for its CI service. The [Coq organization on
1229 GitLab][GitLab-coq] hosts a number of CI/CD-only mirrors. If you are
1230 a regular contributor, you can request access to it from [the
1231 organization page][GitLab-coq], although in most cases, you won't need
1232 this.
1233
1234 GitLab too has [extensive documentation][GitLab-doc], in particular on
1235 configuring CI.
1236
1237 #### Merge script dependencies ####
1238
1239 Nowadays, most assignees should use the `@coqbot: merge now` command
1240 instead of the merge script. However, the merge script is still
1241 available, and is still needed to merge PRs into release branches.
1242
1243 The merge script passes option `-S` to `git merge` to ensure merge
1244 commits are signed. Consequently, it depends on the GnuPG command
1245 utility being installed and a GPG key being available. Here is a
1246 short documentation on how to use GPG, git & GitHub:
1247 https://help.github.com/articles/signing-commits-with-gpg/.
1248
1249 The script depends on a few other utilities. If you are a Nix user,
1250 the simplest way of getting them is to run `nix-shell` first.
1251
1252 **Note for homebrew (MacOS) users:** it has been reported that
1253 installing GnuPG is not out of the box. Installing explicitly
1254 `pinentry-mac` seems important for typing of passphrase to work
1255 correctly (see also this [Stack Overflow Q-and-A][pinentry-mac]).
1256
1257 #### Coqbot ####
1258
1259 Our bot sources can be found at <https://github.com/rocq-prover/bot>. Its
1260 documentation is still a work-in-progress.
1261
1262 ### Online forum and chat to talk to developers ###
1263
1264 We have a [Discourse forum][Discourse] (see in particular the [Rocq
1265 development][Discourse-development-category] category) and a [Zulip
1266 chat][Zulip] (see in particular the [Rocq devs & plugin devs][Zulip-dev]
1267 stream). Feel free to join any of them and ask questions.
1268 People are generally happy to help and very reactive.
1269
1270 Obviously, the issue tracker is also a good place to ask questions,
1271 especially if the development processes are unclear, or the developer
1272 documentation should be improved.
1273
1274 ### Rocq calls ###
1275
1276 We try to gather every week for one hour through video-conference to
1277 discuss current and urgent matters. When longer discussions are
1278 needed, topics are left out for the next working group. See the
1279 [wiki][wiki-calls] for more information about Rocq calls, as well as
1280 notes of past ones.
1281
1282 ### Rocq remote working groups ###
1283
1284 We semi-regularly (up to every month) organize remote working groups,
1285 which can be accessed through video-conference, and are most often
1286 live streamed on [YouTube][]. Summary notes and announcements of the
1287 next working group can be found [on the wiki][wiki-WG]
1288
1289 These working groups are where important decisions are taken, most
1290 often by consensus, but also, if it is needed, by a vote of core
1291 developers.
1292
1293 ### Rocq Users and Developers Workshops ###
1294
1295 We have an annual gathering late Spring in France where most core
1296 developers are present, and whose objective is to help new
1297 contributors get started with the Rocq codebase, provide help to plugin
1298 and library authors, and more generally have fun together.
1299
1300 The list of past (and upcoming, when it's already planned) workshops
1301 can be found [on the wiki][wiki-CUDW].
1302
1303 [add-contributor]: https://github.com/orgs/rocq-prover/teams/contributors/members?add=true
1304 [api-doc]: https://rocq-prover.org/doc/master/api/
1305 [Awesome-Coq]: https://github.com/rocq-community/awesome-coq
1306 [Benchmarking]: https://github.com/rocq-prover/rocq/wiki/Benchmarking
1307 [RFCs]: https://github.com/rocq-prover/rfcs
1308 [CI-README-developers]: dev/ci/README-developers.md
1309 [CI-README-users]: dev/ci/README-users.md
1310 [Code-of-Conduct]: CODE_OF_CONDUCT.md
1311 [CODEOWNERS]: .github/CODEOWNERS
1312 [Codewars]: https://www.codewars.com/?language=coq
1313 [company-coq-issues]: https://github.com/cpitclaudel/company-coq/issues
1314 [coqbot-minimize]: https://github.com/rocq-prover/rocq/wiki/Coqbot-minimize-feature
1315 [Coq-Club]: https://sympa.inria.fr/sympa/arc/coq-club
1316 [rocq-community-maintainer-wanted]: https://github.com/rocq-community/manifesto/issues?q=is%3Aissue+is%3Aopen+label%3Amaintainer-wanted
1317 [rocq-community-manifesto]: https://github.com/rocq-community/manifesto
1318 [rocq-community-wiki]: https://github.com/rocq-community/manifesto/wiki
1319 [rocq-core]: https://github.com/orgs/rocq-prover/teams/core/members
1320 [rocqdoc-documentation]: https://rocq-prover.org/refman/using/tools/coqdoc.html
1321 [Rocq-books]: https://rocq-prover.org/books
1322 [Rocq-issue-tracker]: https://github.com/rocq-prover/rocq/issues
1323 [Rocq-package-index]: https://rocq-prover.org/packages
1324 [Rocq-Platform]: https://github.com/rocq-prover/platform
1325 [rocq-pushers]: https://github.com/orgs/rocq-prover/teams/pushers/teams
1326 [rocq-repository]: https://github.com/rocq-prover/rocq
1327 [rocq-team]: https://rocq-prover.org/rocq-team
1328 [Rocq-website-repository]: https://github.com/rocq-prover/rocq-prover.org
1329 [debugging-doc]: dev/doc/debugging.md
1330 [dev-ci-nix]: dev/ci/nix/README.md
1331 [dev-doc-README]: dev/doc/README.md
1332 [dev-doc-dune]: dev/doc/build-system.dune.md
1333 [dev-README]: dev/README.md
1334 [dev-tools-create_overlays.sh]: dev/tools/create_overlays.sh
1335 [Discourse]: https://discourse.rocq-prover.org/
1336 [Discourse-development-category]: https://discourse.rocq-prover.org/c/rocq-development
1337 [doc_gram]: doc/tools/docgram/README.md
1338 [doc-README]: doc/README.md
1339 [documentation-github-project]: https://github.com/orgs/rocq-prover/projects/6
1340 [dune-doc]: https://dune.readthedocs.io/en/latest/
1341 [FAQ]: https://github.com/rocq-prover/rocq/wiki/The-Rocq-FAQ
1342 [git]: https://git-scm.com/
1343 [git-hook]: dev/tools/pre-commit
1344 [GitHub-co-authored-by]: https://github.blog/2018-01-29-commit-together-with-co-authors/
1345 [GitHub-commit-email]: https://help.github.com/en/articles/setting-your-commit-email-address-in-git
1346 [GitHub-doc]: https://help.github.com/
1347 [GitHub-draft-PR]: https://github.blog/2019-02-14-introducing-draft-pull-requests/
1348 [GitHub-markdown]: https://guides.github.com/features/mastering-markdown/
1349 [GitHub-notification-settings]: https://github.com/settings/notifications
1350 [GitHub-PR-from-fork]: https://help.github.com/en/articles/creating-a-pull-request-from-a-fork
1351 [GitHub-rebase]: https://help.github.com/articles/about-git-rebase/
1352 [GitHub-watching]: https://github.com/rocq-prover/rocq/subscription
1353 [GitHub-wiki-extensions]: https://help.github.com/en/articles/editing-wiki-content
1354 [GitLab-coq]: https://gitlab.com/coq
1355 [GitLab-doc]: https://docs.gitlab.com/
1356 [IRC]: irc://irc.libera.chat:6697/#coq
1357 [GitLab-organization]: https://gitlab.com/coq
1358 [JasonGross-coq-tools]: https://github.com/JasonGross/coq-tools
1359 [kind-documentation]: https://github.com/rocq-prover/rocq/issues?q=is%3Aopen+is%3Aissue+label%3A%22kind%3A+documentation%22
1360 [master-doc]: https://rocq-prover.org/doc/master/refman/
1361 [merge-pr]: dev/tools/merge-pr.sh
1362 [needs-benchmarking]: https://github.com/rocq-prover/rocq/labels/needs%3A%20benchmarking
1363 [needs-changelog]: https://github.com/rocq-prover/rocq/labels/needs%3A%20changelog%20entry
1364 [needs-documentation]: https://github.com/rocq-prover/rocq/labels/needs%3A%20documentation
1365 [needs-fixing]: https://github.com/rocq-prover/rocq/labels/needs%3A%20fixing
1366 [needs-rebase]: https://github.com/rocq-prover/rocq/labels/needs%3A%20rebase
1367 [needs-testing]: https://github.com/rocq-prover/rocq/labels/needs%3A%20testing
1368 [needs-test-suite]: https://github.com/rocq-prover/rocq/labels/needs%3A%20test-suite%20update
1369 [Nix]: https://github.com/rocq-prover/rocq/wiki/Nix
1370 [notification-email]: https://blog.github.com/2017-07-18-managing-large-numbers-of-github-notifications/#prioritize-the-notifications-you-receive
1371 [OCaml-planet]: http://ocaml.org/community/planet/
1372 [ocamlformat]: https://github.com/ocaml-ppx/ocamlformat
1373 [ocamlverse-community]: https://ocamlverse.github.io/content/community.html
1374 [old-style-guide]: dev/doc/style.md
1375 [standard-library]: https://github.com/rocq-prover/stdlib
1376 [other-standard-libraries]: https://github.com/rocq-archive/stdlib2/wiki/Other-%22standard%22-libraries
1377 [pinentry-mac]: https://stackoverflow.com/questions/39494631/gpg-failed-to-sign-the-data-fatal-failed-to-write-commit-object-git-2-10-0
1378 [Platform-docs]: https://github.com/rocq-prover/platform-docs
1379 [plugin-tutorial]: doc/plugin_tutorial
1380 [Proof-Assistants-SE]: https://proofassistants.stackexchange.com/
1381 [ProofGeneral-issues]: https://github.com/ProofGeneral/PG/issues
1382 [Reddit]: https://www.reddit.com/r/Coq/
1383 [refman]: https://rocq-prover.org/refman/
1384 [refman-sources]: doc/sphinx
1385 [refman-README]: doc/sphinx/README.rst
1386 [release-plan]: https://github.com/rocq-prover/rocq/wiki/Release-Plan
1387 [repology-coq]: https://repology.org/project/coq/versions
1388 [Rocq-planet]: https://rocq-prover.org/rocq-planet
1389 [RM-checklist]: dev/doc/release-process.md
1390 [Stack-Exchange]: https://stackexchange.com/filters/299857/questions-tagged-coq-on-stackexchange-sites
1391 [Stack-Exchange-to-Zulip]: https://rocq-prover.zulipchat.com/#narrow/stream/237977-Rocq-users/topic/New.20Stack.20Exchange.20question
1392 [Stack-Overflow]: https://stackoverflow.com/questions/tagged/coq
1393 [stdlib-doc]: https://rocq-prover.org/stdlib/
1394 [test-suite-README]: test-suite/README.md
1395 [tools-website]: https://github.com/rocq-community/awesome-coq?tab=readme-ov-file#tools
1396 [tools-wiki]: https://github.com/rocq-prover/rocq/wiki/Tools
1397 [unreleased-changelog]: https://rocq-prover.org/doc/master/refman/changes.html#unreleased-changes
1398 [user-changelog]: doc/changelog
1399 [user-overlays]: dev/ci/user-overlays
1400 [voting-process]: https://github.com/rocq-prover/rocq/wiki/Core-Team-Voting-Process
1401 [wiki]: https://github.com/rocq-prover/rocq/wiki
1402 [wiki-calls]: https://github.com/rocq-prover/rocq/wiki/Rocq-Calls
1403 [wiki-CUDW]: https://github.com/rocq-prover/rocq/wiki/CoqImplementorsWorkshop
1404 [wiki-WG]: https://github.com/rocq-prover/rocq/wiki/Coq-Working-Groups
1405 [YouTube]: https://www.youtube.com/channel/UCbJo6gYYr0OF18x01M4THdQ
1406 [Zulip]: https://rocq-prover.zulipchat.com
1407 [Zulip-dev]: https://rocq-prover.zulipchat.com/#narrow/stream/237656-Rocq-devs.20.26.20plugin.20devs