1986f9f79SAlex Crichton# Development Process
2986f9f79SAlex Crichton
3986f9f79SAlex CrichtonWe use [issues] for asking questions ([open one here][newissue]!) and tracking
4986f9f79SAlex Crichtonbugs and unimplemented features, and [pull requests] (PRs) for tracking and
5bb2ae7cdSOscar Spencerreviewing code submissions. We triage new issues at each of our bi-weekly
6bb2ae7cdSOscar Spencer[Wasmtime meetings][meetings].
7986f9f79SAlex Crichton
8986f9f79SAlex Crichton### Before submitting a PR
9986f9f79SAlex Crichton
10986f9f79SAlex CrichtonConsider opening an issue to talk about it. PRs without corresponding issues
11986f9f79SAlex Crichtonare appropriate for fairly narrow technical matters, not for fixes to
12986f9f79SAlex Crichtonuser-facing bugs or for feature implementations, especially when those features
1369fecf4eSNick Fitzgeraldmight have multiple implementation strategies that usefully could be
1469fecf4eSNick Fitzgeralddiscussed. Changes that will significantly affect stakeholders should first be
1569fecf4eSNick Fitzgeraldproposed in an [RFC](./contributing-rfc-process.md).
16986f9f79SAlex Crichton
17986f9f79SAlex CrichtonOur issue templates might help you through the process.
18986f9f79SAlex Crichton
19986f9f79SAlex Crichton### When submitting PRs
20986f9f79SAlex Crichton
214d5eaea6SJamey Sharp - Please answer the questions in the pull request template. They are the
224d5eaea6SJamey Sharp   minimum information we need to know in order to understand your changes.
23986f9f79SAlex Crichton
24986f9f79SAlex Crichton - Write clear commit messages that start with a one-line summary of the
25986f9f79SAlex Crichton   change (and if it's difficult to summarize in one line, consider
26986f9f79SAlex Crichton   splitting the change into multiple PRs), optionally followed by
27986f9f79SAlex Crichton   additional context. Good things to mention include which areas of the
28986f9f79SAlex Crichton   code are affected, which features are affected, and anything that
29986f9f79SAlex Crichton   reviewers might want to pay special attention to.
30986f9f79SAlex Crichton
314d5eaea6SJamey Sharp - If there is code which needs explanation, prefer to put the explanation in a
324d5eaea6SJamey Sharp   comment in the code, or in documentation, rather than in the commit message.
334d5eaea6SJamey Sharp   Commit messages should explain why the new version is better than the old.
344d5eaea6SJamey Sharp
354d5eaea6SJamey Sharp - Please include new test cases that cover your changes, if you can. If you're
364d5eaea6SJamey Sharp   not sure how to do that, we'll help you during our review process.
37986f9f79SAlex Crichton
38986f9f79SAlex Crichton - For pull requests that fix existing issues, use [issue keywords]. Note that
39986f9f79SAlex Crichton   not all pull requests need to have accompanying issues.
40986f9f79SAlex Crichton
41986f9f79SAlex Crichton - When updating your pull request, please make sure to re-request review if
42986f9f79SAlex Crichton   the request has been cancelled.
43986f9f79SAlex Crichton
44986f9f79SAlex Crichton### Focused commits or squashing
45986f9f79SAlex Crichton
464d5eaea6SJamey SharpWe are not picky about how your git commits are structured. When we merge your
474d5eaea6SJamey SharpPR, we will squash all of your commits into one, so it's okay if you add fixes
484d5eaea6SJamey Sharpin new commits.
494d5eaea6SJamey Sharp
504d5eaea6SJamey SharpWe appreciate it if you can organize your work into separate commits which each
514d5eaea6SJamey Sharpmake one focused change, because then we can more easily understand your
524d5eaea6SJamey Sharpchanges during review. But we don't require this.
534d5eaea6SJamey Sharp
544d5eaea6SJamey SharpOnce someone has reviewed your PR, it's easier for us if you _don't_ rebase it
554d5eaea6SJamey Sharpwhen making further changes. Instead, at that point we prefer that you make new
564d5eaea6SJamey Sharpcommits on top of the already-reviewed work.
574d5eaea6SJamey Sharp
58e9ecab49SAlex CrichtonThat said rebasing (or merging from `main`) may still be required in situations
59e9ecab49SAlex Crichtonsuch as:
60e9ecab49SAlex Crichton
61e9ecab49SAlex Crichton* Your PR has a merge conflict with the `main` branch.
62e9ecab49SAlex Crichton* CI on your PR is failing for unrelated reasons and a fix was applied to `main`
63e9ecab49SAlex Crichton  which needs to be picked up on your branch.
64e9ecab49SAlex Crichton* Other miscellaneous technical reasons may cause us to ask for a rebase.
65e9ecab49SAlex Crichton
66e9ecab49SAlex CrichtonIf you need help rebasing or merging, please ask!
67986f9f79SAlex Crichton
68986f9f79SAlex Crichton### Review and merge
69986f9f79SAlex Crichton
70986f9f79SAlex CrichtonAnyone may submit a pull request, and anyone may comment on or review others'
71*7dbcf4c1SAlex Crichtonpull requests. However, one approval from a maintainer is required before a PR
72*7dbcf4c1SAlex Crichtoncan be merged. Maintainers must also create PRs and get review from another
73*7dbcf4c1SAlex Crichtonmaintainer for every change, including minor work items such as version bumps,
744d5eaea6SJamey Sharpremoving warnings, etc.
75986f9f79SAlex Crichton
76*7dbcf4c1SAlex CrichtonPR approvals may come with comments about additional minor changes that are
77*7dbcf4c1SAlex Crichtonrequested. Contributors and maintainers alike should address these comments, if
78*7dbcf4c1SAlex Crichtonany, and then the PR is ready for merge. Wasmtime uses a [merge queue] to ensure
79*7dbcf4c1SAlex Crichtonthat all tests pass before pushing to `main`. Note that the [merge queue] will
80*7dbcf4c1SAlex Crichtonrun more tests than is run on PRs by default.
81*7dbcf4c1SAlex Crichton
82*7dbcf4c1SAlex CrichtonContributors should expect Wasmtime maintainers to add the PR to the merge queue
83*7dbcf4c1SAlex Crichtonfor them. If a PR hasn't been added, and it's approved with all comments
84*7dbcf4c1SAlex Crichtonaddressed, feel free to leave a comment to notify maintainers that it's ready.
85*7dbcf4c1SAlex CrichtonMaintainers can add their own PRs to the merge queue. When approving a PR
86*7dbcf4c1SAlex Crichtonmaintainers may also add the PR to the merge queue at that time if there are no
87*7dbcf4c1SAlex Crichtonremaining comments.
88*7dbcf4c1SAlex Crichton
89*7dbcf4c1SAlex CrichtonNote that if CI is failing on a PR then GitHub will automatically block adding a
90*7dbcf4c1SAlex CrichtonPR to the [merge queue]. PR authors will need to resolve PR CI before it can be
91*7dbcf4c1SAlex Crichtonadded to the merge queue. If the merge queue CI fails then the PR will be
92*7dbcf4c1SAlex Crichtonremoved from the merge queue and GitHub will leave a marker on the timeline and
93*7dbcf4c1SAlex Crichtonsend a notification to the PR author. PR authors are expected to review CI logs
94*7dbcf4c1SAlex Crichtonand fix any failures in the PR itself. When ready maintainers can re-add their
95*7dbcf4c1SAlex Crichtonown PR for minor fixes and contributors can leave a comment saying that the PR
96*7dbcf4c1SAlex Crichtonis ready to be re-added to the queue.
97*7dbcf4c1SAlex Crichton
98*7dbcf4c1SAlex CrichtonTo run full CI on the PR before the merge queue, include the string
99*7dbcf4c1SAlex Crichton`prtest:full` in any commit in the PR. That can help debug CI failures without
100*7dbcf4c1SAlex Crichtongoing through the merge queue if necessary.
101*7dbcf4c1SAlex Crichton
102986f9f79SAlex Crichton[issues]: https://guides.github.com/features/issues/
103986f9f79SAlex Crichton[pull requests]: https://help.github.com/articles/about-pull-requests/
104986f9f79SAlex Crichton[issue keywords]: https://help.github.com/articles/closing-issues-using-keywords/
105986f9f79SAlex Crichton[newissue]: https://github.com/bytecodealliance/wasmtime/issues/new
106bb2ae7cdSOscar Spencer[meetings]: https://github.com/bytecodealliance/meetings/tree/main/wasmtime
107*7dbcf4c1SAlex Crichton[merge queue]: https://github.com/bytecodealliance/wasmtime/queue/main
108