How to open a Pull Request (PR)
A pull request (PR) enables you to send changes from your fork on GitHub to star.vote’s main repository. Once you are done making changes to the code, you can follow these guidelines to open a PR.
Your PR should be in English. If you’re interested in helping with translations, message the #_software-dev slack channel
If you haven’t joined the STAR Voting slack yet, you can follow the instructions here to get added
Prepare a good PR title
We recommend using conventional title and messages for commits and pull request. The convention has the following format:
<type>([optional scope(s)]): <description>
For example:
fix(learn): tests for the do...while loop challenge
When opening a Pull Request(PR), you can use the below to determine the type, scope (optional), and description.
Type:
Type | When to select |
---|---|
fix | Changed or updated/improved functionality, tests, etc. |
feat | Only if you are adding new functionality, tests, etc. |
chore | Changes that are not related to code or tests. |
docs | Changes to /docs directory or the contributing guidelines, etc. |
Scope:
You can select a scope from this list of labels.
Description:
Keep it short (less than 30 characters) and simple, you can add more information in the PR description box and comments.
Some examples of good PR titles would be:
fix(a11y): improved search bar contrast
feat: add more tests to HTML and CSS challenges
fix(api,client): prevent CORS errors on form submission
docs(i18n): Chinese translation of local setup
Proposing a Pull Request
-
Once the edits have been committed, you will be prompted to create a pull request on your fork’s GitHub Page.
-
By default, all pull requests should be against the star-server main repo,
main
branch.Make sure that your Base Fork is set to Equal-Vote/star-server when raising a Pull Request.
-
Submit the pull request from your branch to star-server’s
main
branch. -
In the body of your PR include a more detailed summary of the changes you made and why.
-
You will be presented with a pull request template. This is a checklist that you should have followed before opening the pull request.
-
Fill in the details as you see fit. This information will be reviewed and the reviewers will decide whether or not your pull request is accepted.
-
If the PR is meant to address an existing GitHub Issue then, at the end of your PR’s description body, use the keyword Closes with the issue number to automatically close that issue if the PR is accepted and merged.
Example:
Closes #123
will close issue 123
-
-
Indicate if you have tested on a local copy of the site or not.
- This is very important when making changes that are not just edits to text content like documentation or a challenge description. Examples of changes that need local testing include JavaScript, CSS, or HTML which could change the functionality or layout of a page.
Feedback on pull requests
:tada: Congratulations on making a PR and thanks a lot for taking the time to contribute.
Our contributors will now take a look and leave you feedback. Please be patient with the fellow moderators and respect their time. All pull requests are reviewed in due course.
And as always, feel free to ask questions on the #_software-dev slack channel.
Conflicts on a pull request
Conflicts can arise because many contributors work on the repository, and changes can break your PR which is pending a review and merge.
More often than not you may not require a rebase, because we squash all commits, however, if a rebase is requested, here is what you should do.
For usual bug fixes and features
When you are working on regular bugs and features on our development branch main
, you are able to do a simple rebase:
-
Rebase your local copy:
git checkout <pr-branch> git pull --rebase upstream main
-
Resolve any conflicts and add / edit commits
# Either git add . git commit -m "chore: resolve conflicts" # Or git add . git commit --amend --no-edit
-
Push back your changes to the PR
git push --force origin <pr-branch>