|
| 1 | +# Guides and FAQs for first-time contributors |
| 2 | + |
| 3 | +Welcome to the Node.js project! This guide is complementary to the |
| 4 | +[general contribution guidelines](../../CONTRIBUTING.md) |
| 5 | +and the [pull request guidelines](./pull-requests.md), with a focus on |
| 6 | +clarifying the process for first-time contributors. |
| 7 | + |
| 8 | +## Before you start |
| 9 | + |
| 10 | +Read and understand [Code of Conduct](./code-of-conduct.md) before contributing to the project. |
| 11 | + |
| 12 | +## Getting started with issues |
| 13 | + |
| 14 | +If your first contribution is not motivated by an issue you already encounter, but you just want to help, |
| 15 | +you can find issues to work on by browsing the [issue tracker](https://github.com/nodejs/node/issues). |
| 16 | +Filter issues by the `good first issue` label to find issues that are suitable for first-time |
| 17 | +contributors. `help wanted` tracks issues that need volunteers to help but may be more challenging |
| 18 | +due to complexity or requiring special domain expertise. |
| 19 | + |
| 20 | +If your first contribution is motivated by an issue you already encounter, but your proposed change |
| 21 | +is complex, introduces a new feature, breaks backward compatibility, or needs a significant refactor, |
| 22 | +it's best to open an issue to discuss the change before you start working on it. |
| 23 | + |
| 24 | +### Communicating in issues |
| 25 | + |
| 26 | +Node.js is a community project driven by volunteers. It does not have project managers to assign |
| 27 | +issues to people. Contributors usually use comments to communicate progress instead. |
| 28 | + |
| 29 | +Refrain from taking on issues with a comment but not following through. If the issue is |
| 30 | +straightforward, you can start working on it right away. If the task is more complex, |
| 31 | +it is okay to leave updates on the issue when you have significant findings or run into |
| 32 | +blockers before you have a pull request ready to avoid duplicate work by other contributors. |
| 33 | + |
| 34 | +Avoid picking multiple issues at the same time, especially issues of the same type or area. |
| 35 | +It's better to focus on one issue and see it through to completion before picking another one. |
| 36 | + |
| 37 | +During communication, be conscious of the length of your comments. Long comments can be difficult |
| 38 | +to read and may discourage others from engaging in the discussion. Refrain from pasting large |
| 39 | +blocks of code, logs, or text generated by tools. If necessary, use `<details>` tags to fold |
| 40 | +them into a collapsible section to make the discussion more readable. |
| 41 | + |
| 42 | +## What NOT to do for your first contributions |
| 43 | + |
| 44 | +**Refrain from automating your first contributions**. In this project, automation must |
| 45 | +be authorized and tracked explicitly. If you have an idea for automation, please open an |
| 46 | +issue to discuss it with other contributors first. |
| 47 | + |
| 48 | +**Refrain from submitting large pull requests for your first contributions**. Node.js makes |
| 49 | +technical decisions through a |
| 50 | +[consensus-seeking process among its collaborators](./collaborator-guide.md#consensus-seeking), |
| 51 | +with additional community feedback taken into account. Pushing a complex change through |
| 52 | +this process can be difficult even for experienced contributors, and discouraging for |
| 53 | +first-time contributors. It's best to start with smaller, focused pull requests that |
| 54 | +address known issues, allowing you to familiarize yourself with the collaboration |
| 55 | +process first. When you have to submit a large pull request after gaining some experience, |
| 56 | +make sure to follow the [large pull request guidelines](./large-pull-requests.md). |
| 57 | + |
| 58 | +## Going through the pull request review process |
| 59 | + |
| 60 | +When you are ready to submit a pull request, check out the [pull request guidelines](./pull-requests.md) |
| 61 | +for the technical how-tos and explanations about the review process. |
| 62 | + |
| 63 | +First-time contributors should be aware that this project uses |
| 64 | +[Developer Certificate of Origin (DCO)](https://developercertificate.org/) to manage |
| 65 | +the copyright of contributions. Make sure to |
| 66 | +[sign off your commits](./pull-requests.md#step-4-commit) (e.g., using `git commit -s`), |
| 67 | +or they cannot be merged. |
| 68 | + |
| 69 | +### FAQs about pull requests |
| 70 | + |
| 71 | +#### Why is my pull request not getting reviews? |
| 72 | + |
| 73 | +In Node.js, the group of people that can approve pull requests to be merged are |
| 74 | +[the collaborators](../../GOVERNANCE.md#collaborators). While there are many of them, they |
| 75 | +are volunteers with limited bandwidth, and don't always pay attention to new |
| 76 | +pull requests, since the project is big and the volume of notifications can be overwhelming. |
| 77 | + |
| 78 | +When your pull request is not getting attention, you can |
| 79 | + |
| 80 | +1. Try pinging collaborators who have shown interest in the original issues. |
| 81 | +2. Try asking for help in the |
| 82 | + [#node-core channel on the OpenJS Slack](https://openjs-foundation.slack.com/archives/C019Y2T6STH). |
| 83 | + |
| 84 | +**Be patient and respect the time the reviewers put in as volunteers**. People are usually |
| 85 | +happier to help if you are polite and show respect for their voluntary review efforts. |
| 86 | + |
| 87 | +#### There are some review comments on my pull request. How should I update my pull request to address them? |
| 88 | + |
| 89 | +If the review comments are left with GitHub's suggestion feature, you can apply the suggestions |
| 90 | +directly in the GitHub UI and commit the changes to your branch. Otherwise, you can push new commits to |
| 91 | +the pull request branch. See [the pull request guide](./pull-requests.md#step-9-discuss-and-update) for |
| 92 | +the technical how-tos. |
| 93 | + |
| 94 | +After you push new commits, even if the previous commits have been approved, you will still need a |
| 95 | +new approval for the last commits. |
| 96 | + |
| 97 | +Commits in the same pull requests are usually squashed into one commit before landing, unless |
| 98 | +there's a good justification to keep them separate - in that case, coordinate with your reviewers |
| 99 | +about this. The commits that need to be kept separate must each pass all tests on their own and |
| 100 | +follow the [commit message guidelines](./pull-requests.md#commit-message-guidelines). |
| 101 | + |
| 102 | +Commit squashing is usually handled by the automation. Commits that are intended to be squashed don't |
| 103 | +have to follow the commit message guidelines, so you don't have to constantly squash them which would |
| 104 | +require new approvals/CI runs. |
| 105 | + |
| 106 | +You can use |
| 107 | +[`git commit --fixup`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---fixupamendrewordcommit) |
| 108 | +when adding new commits to your pull request to indicate how the squashing should be done |
| 109 | +(the automation uses `git rebase --autosquash` which can pick up hints left by `--fixup` and |
| 110 | +`--squash` flags). |
| 111 | + |
| 112 | +#### I've updated my pull request, but there's no response. What should I do? |
| 113 | + |
| 114 | +When you update your pull request, reviewers may not get notified automatically, depending on how |
| 115 | +they configure their notifications. They can also miss the notification, or just do not have the bandwidth |
| 116 | +to serve as volunteers in the project at the moment. You can try pinging them again to let them know about the |
| 117 | +updates. Be patient and don't overwhelm them with pings. As a reference, the general expected |
| 118 | +cadence for reviewers to respond to pull requests is around |
| 119 | +[48 hours to 7 days](./collaborator-guide.md#code-reviews). |
| 120 | + |
| 121 | +#### There is a merge conflict in my pull request. What should I do? |
| 122 | + |
| 123 | +When the target branch is updated and there is now a merge conflict in the pull request, you will |
| 124 | +need to rebase your pull request branch on top of the latest version of the target branch and |
| 125 | +resolve the conflicts locally, then force-push the updated branch to your fork. |
| 126 | +See [the pull request guide](./pull-requests.md#step-9-discuss-and-update) |
| 127 | +for the technical how-tos. After a rebase, you will need a new approval from the reviewers. |
| 128 | + |
| 129 | +**Do not use the GitHub web UI to resolve merge conflicts**. The merge commit it creates can lead to issues in the CI. |
| 130 | + |
| 131 | +#### What CI checks does my pull request need to pass? |
| 132 | + |
| 133 | +Node.js uses two CI systems: [Jenkins](https://ci.nodejs.org/) and GitHub Actions. Jenkins is the primary |
| 134 | +CI system for testing pull requests, while GitHub Actions is used for quick checks and additional |
| 135 | +verifications. Pull requests that only touch documentation need to pass only the GitHub Actions |
| 136 | +checks. Pull requests that touch more than just documentation will be labeled `needs-ci` and will need |
| 137 | +to run the Jenkins CI before they can be merged. |
| 138 | + |
| 139 | +#### How do I trigger the CI runs? |
| 140 | + |
| 141 | +Because GitHub Actions workflows can access sensitive tokens, for your first pull request in |
| 142 | +the repository, a collaborator needs to explicitly approve the workflow run. Once you |
| 143 | +have one pull request merged, later pull requests will trigger GitHub Actions automatically without |
| 144 | +needing approval. |
| 145 | + |
| 146 | +Due to similar security concerns, Jenkins CI runs can only be triggered by collaborators and |
| 147 | +triagers who have the permission to apply the `request-ci` label. But because the Jenkins CI tests |
| 148 | +a large matrix of platforms and configurations, and the infrastructure resources are limited, |
| 149 | +Jenkins CI runs always have to be triggered by humans and won't run automatically. When your |
| 150 | +pull request is ready for CI, you will need to ask for help from collaborators or triagers to |
| 151 | +trigger the Jenkins CI runs. |
| 152 | + |
| 153 | +It takes time for a volunteer to verify that the pull request does not contain malicious code |
| 154 | +before approving the CI runs. Similar to the review process, be patient and respectful of |
| 155 | +the volunteers' time when you are asking for help to trigger the CI runs, this helps build |
| 156 | +trust to make future contributions smoother. |
| 157 | + |
| 158 | +#### The CI runs showed some failures that seem unrelated to my change. What should I do? |
| 159 | + |
| 160 | +The Node.js CIs are known to be flaky. Consult the daily reports in |
| 161 | +[the reliability repository](https://github.com/nodejs/reliability/issues) to see if the same failures |
| 162 | +are showing up in other pull requests - if they do, it's very likely that they are unrelated to your |
| 163 | +change. In this case, you can ignore those failures and ask for help to trigger the CI runs again - |
| 164 | +often, these failures are intermittent and will disappear in the next run. |
| 165 | + |
| 166 | +Tip: the flakes have been plaguing the project for a long time because there aren't enough volunteers |
| 167 | +to fix them. If you have the time and interest, try volunteering to fix the ones that you are |
| 168 | +confident with! See the |
| 169 | +[reliability repository README](https://github.com/nodejs/reliability#protocols-in-improving-ci-reliability) |
| 170 | +for more details on how to get started. |
| 171 | + |
| 172 | +#### My pull request has enough approvals and passed CI, but it still hasn't been merged. What should I do? |
| 173 | + |
| 174 | +Pull requests need to be merged by collaborators or triagers (normally by applying the `commit-queue` |
| 175 | +label). The [commit queue automation](../../.github/workflows/commit-queue.yml) |
| 176 | +will verify that the pull request meets all the requirements before merging it, but the |
| 177 | +triggering of the commit queue still requires human judgement and depends on volunteers. |
| 178 | +You can ask for help either in the pull request or in the slack channel similar |
| 179 | +to how you ask for help to get reviews and trigger CI runs. |
| 180 | + |
| 181 | +#### There's a comment saying that my pull request is landed, but instead I see my pull request closed, what happened? |
| 182 | + |
| 183 | +In this project, pull requests are typically merged by the |
| 184 | +[commit queue](../../.github/workflows/commit-queue.yml) to amend the commit with |
| 185 | +necessary metadata, not through the GitHub UI. Sometimes the automation or the collaborator |
| 186 | +performing the merge can update the branches in a way that GitHub recognizes it as a merge |
| 187 | +and shows a purple "merged" status, sometimes it's not the case. |
| 188 | +As long as you see a comment saying that your pull request is landed, and the commits do appear |
| 189 | +in the target branch of your pull request, don't worry, it means the change has been effectively |
| 190 | +merged, regardless of what GitHub shows. |
| 191 | + |
| 192 | +#### When will my change be released? |
| 193 | + |
| 194 | +Commits merged into the `main` are released according to the release schedule, |
| 195 | +which are displayed in the [Release Working Group's pinned issues](https://github.com/nodejs/Release/issues). |
| 196 | + |
| 197 | +If the pull request is not labeled `dont-land-*` or `semver-major`, it will be included in the next |
| 198 | +"current" release. If the change is labeled `dont-land-*`, it will be held back from release until |
| 199 | +the label is removed. If the change is labeled `semver-major`, it will only be included in the next |
| 200 | +major release, which may take months, depending on when the pull request is merged. |
| 201 | + |
| 202 | +#### Someone commented in my pull request that the change doesn't land cleanly on a release branch, what should I do? |
| 203 | + |
| 204 | +Commits landed into `main` are backported to the release staging branches using `git cherry-pick` |
| 205 | +before they can be released. This process is typically performed by volunteers from the Release |
| 206 | +Working Group, but it can also be performed by other volunteers. |
| 207 | + |
| 208 | +When the volunteers cherry-pick your commits to the release branches, if there's a git conflict, or |
| 209 | +there's a test failure caused by the change, and the volunteer cannot confidently resolve these |
| 210 | +issues on their own, they will leave this comment in the original pull request to ask for help. |
| 211 | +When you see this comment, try backporting by opening a backport pull request yourself. |
| 212 | +See [the backporting guide](./backporting-to-release-lines.md) for the technical how-tos. |
| 213 | + |
| 214 | +If no one follows through with the backporting, your pull request may not be included in |
| 215 | +any releases until the next major release cut from the `main` branch. |
0 commit comments