Contributing Guidelines for Issues
For any issue, there are fundamentally three ways an individual can contribute:
By opening the issue for discussion: For instance, if you believe that you have uncovered a bug in Bastion or if you have a suggestion, creating a new issue in the respective repository's issue tracker is the way to do it.
By helping to triage the issue: This can be done either by providing supporting details (a test case that demonstrates a bug), or providing suggestions on how to address the issue.
By helping to resolve the issue: Typically this is done either in the form of demonstrating that the reported bug is not a problem after all, or by suggesting how to implement the requested feature or suggestion, or more often, by opening a Pull Request that changes some bit of something in the code in a concrete and reviewable manner.
Because we only limit the issue trackers of all the repositories to bug reports and suggestions, questions or requests for general help regarding Bastion and the project should be directed to the Bastion HQ.
When opening a new issue in any of Bastion's repository, you will be presented with a basic template that should be filled in.
If you believe that you have uncovered a bug/issue or if you have want to request any feature or suggest something in any repository, please fill out this form, following the template to the best of your ability. Some repository might ask you for more details based on the requirements. Do not worry if you cannot answer every detail, just fill in what you can.
The two most important pieces of information we need in order to properly evaluate the report is a description of the behavior you are seeing or want to suggest and, in case of bug reports, a simple test case we can use to recreate the problem on our own. If we cannot recreate the issue, it becomes impossible for us to fix.
In order to rule out the possibility of bugs introduced by userland code, you shouldn't have modified any code of Bastion unless you've been told to do so by a developer of Bastion.
If the bug occurs only when you're using a specific userland/custom module, or when you've modified some part of the code, there is a very good chance that either:
the module has a bug, or
something in the core has changed that broke the module.
See How to create a Minimal, Complete, and Verifiable example.
Once an issue has been opened, it is not uncommon for there to be discussion around it. Some contributors may have differing opinions about the issue, including whether the behavior being seen is a bug or a feature or if the requested feature/suggestion can already be done in some way using existing features or they may see it as unneeded. This discussion is part of the process and should be kept focused, helpful, and professional.
Short, clipped responses — that provide neither additional context nor supporting detail — are not helpful or professional. To many, such responses are simply annoying and unfriendly.
Contributors are encouraged to help one another make forward progress as much as possible, empowering one another to solve/discuss issues collaboratively. If you choose to comment on an issue that you feel either is not a problem that needs to be fixed, or if you encounter information in an issue that you feel is incorrect, or either if you think the requested feature/suggestion can be done using existing features or if you think it is unneeded, explain why you feel that way with additional supporting context, and be willing to be convinced that you may be wrong. By doing so, we can often reach the correct outcome much faster.
In the vast majority of cases, issues/feature requests are resolved/implemented by opening a Pull Request. The process for opening and reviewing a Pull Request is similar to that of opening and triaging issues, but carries with it a necessary review and approval workflow that ensures that the proposed changes meet the minimal quality and functional guidelines of the project.
Contributing Guidelines for Pull Requests
There are two fundamental components of the Pull Request process: one concrete and technical, and one more process oriented. The concrete and technical component involves the specific details of setting up your local environment so that you can make the actual changes. This is where we will start.
To get started, you will need to have git
installed locally. Depending on your operating system and which project you're contributing to, there are also a number of other dependencies required. Those are detailed in their respective repositories.
Once you have git
and are sure you have all of the necessary dependencies, it's time to create a fork.
Fork the project you want to contribute to on GitHub and clone your fork locally and add the remote upstream branch. You can find specific guides in the respective repositories.
Verify the upstream repository that you've specified for your fork is the original repository of Bastion
It is recommended to configure git
so that it knows who you are:
Please make sure this local email is also added to your GitHub email list so that your commits will be properly associated with your account and you will be promoted to Contributor once your first commit is landed.
As a best practice to keep your development environment as organized as possible, create local branches to work within. These should also be created directly off of the master
branch.
Make changes to the code or documentation (including code comments and API documentation) or anything you want to change in the repository you're trying to contribute to, and please be sure to run the test scripts (if any) from time to time to ensure that the changes doesn't break anything and follow the specified code style guide.
It is a recommended best practice to keep your changes as logically grouped as possible within individual commits. There is no limit to the number of commits any single Pull Request may have, and many contributors find it easier to review changes that are split across multiple commits.
It is a best practice to make only one implementation, including any changes that's related to it, per commit. All tests should always pass for each individual commit.
Commit message guidelines
A good commit message should describe what changed and why.
The first line should:
contain a short description of the change (preferably 50 characters or less, and no more than 72 characters)
be entirely in lowercase with the exception of proper nouns, acronyms, and the words that refer to code, like function/variable names
be prefixed with the name of the changed module (if applicable) and start with an imperative verb.
Examples:
commands(play): add spotify playback support
docs: fix typos in getting-started.md
Keep the second line blank.
Wrap all other lines at 72 columns (except for long URLs).
If your patch fixes an open issue, you can add a reference to it at the end of the log. Use the Fixes:
prefix and the full issue URL. For other references use Refs:
.
Examples:
Fixes: https://github.com/TheBastionBot/Bastion/issues/1337
Refs: http://bastion.gitbook.io/install/linux
Refs: https://github.com/iamtraction/tesseract/pulls/13
If your commit introduces a breaking change (semver: major
), it should contain an explanation about the reason of the breaking change, which situation would trigger the breaking change and what is the exact change.
Sample complete commit message:
If you are new to contributing to this project, please try to do your best at conforming to these guidelines, but do not worry if you get something wrong. One of the existing contributors will help get things situated and the contributor landing the Pull Request will ensure that everything follows the project guidelines.
See core-validate-commit - A utility that ensures commits follow the commit formatting guidelines.
As a best practice, once you have committed your changes, it is a good idea to use git rebase
(not git merge
) to synchronize your work with the main repository.
This ensures that your working branch has the latest changes from upstream branch main
.
Once you are sure your commits are ready to go, with passing tests and linting, begin the process of opening a Pull Request by pushing your working branch to your fork on GitHub.
From within GitHub, opening a new Pull Request will present you with a template that should be filled out.
Please try to do your best at filling out the details, but feel free to skip parts if you're not sure what to put.
Once opened, Pull Requests are usually reviewed within a few days.
You will probably get feedback or requests for changes to your Pull Request. This is a big part of the submission process so don't be discouraged! Some contributors may sign off on the Pull Request right away, others may have more detailed comments or feedback. This is a necessary part of the process in order to evaluate whether the changes are correct and necessary.
If you are still working on your Pull Request, please open it as a Draft. It will prevent the Pull Request from being merged, until you're done working with it and marked it as Ready for Review.
To make changes to an existing Pull Request, make the changes to your local branch, add a new commit with those changes, and push those to your fork. GitHub will automatically update the Pull Request.
It is also frequently necessary to synchronize your Pull Request with other changes that have landed in main
by using git rebase
:
Important: The git push --force-with-lease
command is one of the few ways to delete history in git
. Before you use it, make sure you understand the risks. If in doubt, you can always ask for guidance in the Pull Request comments or in the Bastion HQ.
If you happen to make a mistake in any of your commits, do not worry. You can amend the last commit (for example if you want to change the commit log).
There are a number of more advanced mechanisms for managing commits using git rebase
that can be used, but are beyond the scope of this guide.
Feel free to post a comment in the Pull Request to ping reviewers if you are awaiting an answer on something. If you encounter words or acronyms that seem unfamiliar, refer to this glossary.
Approval and Request Changes Workflow
All Pull Requests require "sign off" in order to land. Whenever a contributor reviews a Pull Request they may find specific details that they would like to see changed or fixed. These may be as simple as fixing a typo, or may involve substantive changes to the code you have written. While such requests are intended to be helpful, they may come across as abrupt or unhelpful, especially requests to change things that do not include concrete suggestions on how to change them.
Try not to be discouraged. If you feel that a particular review is unfair, say so, or contact one of the other contributors in the project and seek their input. Often such comments are the result of the reviewer having only taken a short amount of time to review and are not ill-intended. Such issues can often be resolved with a bit of patience. That said, reviewers should be expected to be helpful in their feedback, and feedback that is simply vague, dismissive and unhelpful is likely safe to ignore.
In order to land, a Pull Request needs to be reviewed and approved by at least one Bastion Collaborator and pass all the required status checks. After that, as long as there are no objections from other contributors, the Pull Request can be merged. If you find your Pull Request waiting longer than you expect, see the [notes about the waiting time].
When a collaborator lands your Pull Request, they should and will post a comment to the Pull Request page thanking you for your contribution. If you look at the branch you raised your Pull Request against (probably dev
), you should see your commits in it.
Congratulations and thanks for your contribution!
All contributors who choose to review and provide feedback on Pull Requests have a responsibility to both the project and the individual making the contribution. Reviews and feedback must be helpful, insightful, and geared towards improving the contribution as opposed to simply blocking it. If there are reasons why you feel the PR should not land, explain what those are. Do not expect to be able to block a Pull Request from advancing simply because you say "No" without giving an explanation. Be open to having your mind changed. Be open to working with the contributor to make the Pull Request better.
Reviews that are dismissive or disrespectful of the contributor or any other reviewers are strictly counter to the Code of Conduct.
When reviewing a Pull Request, the primary goals are for the codebase to improve and for the person submitting the request to succeed. Even if a Pull Request does not land, the submitters should come away from the experience feeling like their effort was not wasted or unappreciated. Every Pull Request from a new contributor is an opportunity to grow the community.
Do not overwhelm new contributors.
It is tempting to micro-optimize and make everything about relative performance, perfect grammar, or exact style matches. Do not succumb to that temptation.
Focus first on the most significant aspects of the change:
Does this change make sense for the project?
Does this change make the project better, even if only incrementally?
Are there clear bugs or larger scale issues that need attending to?
Is the commit message readable and correct? If it contains a breaking change is it clear enough?
When changes are necessary, request them, do not demand them, and do not assume that the submitter already knows how to do a task that you think is obvious, it might not be that obvious for him and that's okay; Every one starts at some point, and they will learn with time.
Specific performance optimization techniques, coding styles and conventions change over time. The first impression you give to a new contributor never does.
Nits (requests for small changes that are not essential) are fine, but try to avoid stalling the Pull Request. Most nits can typically be fixed by the Collaborator landing the Pull Request but they can also be an opportunity for the contributor to learn a bit more about the project.
It is always good to clearly indicate nits when you comment: e.g. Nit: change foo() to bar(). But this is not blocking.
If your comments were addressed but were not folded automatically after new commits or if they proved to be mistaken, please, hide them with the appropriate reason to keep the conversation flow concise and relevant.
Be aware that how you communicate requests and reviews in your feedback can have a significant impact on the success of the Pull Request. Yes, we may land a particular change that makes the project better, but the individual might just not want to have anything to do with the project ever again. The goal is not just having good code.
There is a minimum waiting time which we try to respect for important changes, so that people who may have important input are able to respond.
For important changes, Pull Requests must be left open for at least 48 hours during the week, and 72 hours on a weekend. In most cases, when the PR is relatively small and focused on a narrow set of changes, these periods provide more than enough time to adequately review. Sometimes changes take far longer to review, or need more specialized review from subject matter experts. When in doubt, do not rush.
Trivial changes, typically limited to small formatting changes or fixes to documentation, may be landed within the minimum 48 hour window.
If a Pull Request appears to be abandoned or stalled, it is polite to first check with the contributor to see if they intend to continue the work before checking if they would mind if you took it over (especially if it just has nits left). When doing so, it is courteous to give the original contributor credit for the work they started (either by preserving their name and email address in the commit log, or by using an Author:
meta-data tag in the commit.
Any Collaborator (any GitHub user with commit rights in the project's repositories) is authorized to approve any other contributor's work. Collaborators are not permitted to approve their own Pull Requests.
Collaborators indicate that they have reviewed and approve of the changes in a Pull Request either by using GitHub's Approval Workflow, which is preferred, or by leaving an LGTM
("Looks Good To Me") comment.
When explicitly using the "Changes requested" component of the GitHub Approval Workflow, show empathy. That is, do not be rude or abrupt with your feedback and offer concrete suggestions for improvement, if possible. If you're not sure how a particular change can be improved, say so.
Most importantly, after leaving such requests, it is courteous to make yourself available later to check whether your comments have been addressed.
If you see that requested changes have been made, you can clear another collaborator's Changes requested
review.
Change requests that are vague, dismissive, or unconstructive may also be dismissed if requests for greater clarification go unanswered within a reasonable period of time.
If you do not believe that the Pull Request should land at all, use Changes requested
to indicate that you are considering some of your comments to block the PR from landing. When doing so, explain why you believe the Pull Request should not land along with an explanation of what may be an acceptable alternative course, if any.
Contributions to Bastion include code, design, documentation, ideas, bug reports, answering user questions, running the project's infrastructure, and advocating for all types of Bastion users.
Bastion welcomes all contributions from anyone willing to work in good faith with other contributors and the community. No contribution is too small and all contributions are valued.
Issues in Bastion's repositories are the primary means by which bug reports and feature requests/suggestions are made.
Read the details here:
Pull Requests are the way concrete changes are made to the code, documentation, design, dependencies, and tools contained in Bastion's repositories.
Read the details here:
We want to deliver Bastion and all its services in many different languages from different regions. If you want to contribute on translations and bring it to the world, you can start doing that on Crowdin.