Thank you for considering making contributions to the Elys and related repositories!
Contributing to this repo can mean many things, such as participating in discussion or proposing code changes. To ensure a smooth workflow for all contributors, the general procedure for contributing has been established:
- Start by browsing new issues. If you have something in your mind, you can raise an issue ticket on github or initiate chat on Discord.
- Determine whether a GitHub issue or discussion is more appropriate for your needs:
- If want to propose something new that requires specification or an additional design, or you would like to change a process, start with a new discussion. With discussions, we can better handle the design process using discussion threads. A discussion usually leads to one or more issues.
- If the issue you want addressed is a specific proposal or a bug, then open a new issue.
- Review existing issues to find an issue you'd like to help with.
- Participate in thoughtful discussion on that issue.
- If you would like to contribute:
- Ensure that the proposal has been accepted.
- Ensure that nobody else has already begun working on this issue. If they have, make sure to contact them to collaborate.
- If nobody has been assigned for the issue and you would like to work on it, make a comment on the issue to inform the community of your intentions to begin work.
- To submit your work as a contribution to the repository follow standard GitHub best practices. See pull request guideline below.
Note: For very small or blatantly obvious problems such as typos, you are not required to an open issue to submit a PR, but be aware that for more complex problems/features, if a PR is opened before an adequate design discussion has taken place in a GitHub issue, that PR runs a high likelihood of being rejected.
When proposing an architecture decision for Elys network, please start by opening an issue or a discussion with a summary of the proposal. Once the proposal has been discussed and there is rough alignment on a high-level approach to the design, the ADR creation process can begin. We are following this process to ensure all involved parties are in agreement before any party begins coding the proposed implementation.
- The latest state of development is on
main
. main
must never failgo test ./...
.- No
--force
ontomain
(except when reverting a broken commit, which should seldom happen). - Create a branch to start work:
- Fork the repo (core developers must create a branch directly in the Elys repo),
branch from the HEAD of
main
, make some commits, and submit a PR tomain
. - For core developers working within the
elys
repo, follow branch name conventions to ensure a clear ownership of branches:{moniker}/{issue#}-branch-name
. - See Branching Model for more details.
- Fork the repo (core developers must create a branch directly in the Elys repo),
branch from the HEAD of
- Follow the CODING GUIDELINES, which defines criteria for designing and coding a software.
Code is merged into main through pull request procedure.
Tests can be executed by running go test ./...
at the top level of Elys repository.
Before submitting a pull request:
- merge the latest main
git merge origin/main
, - run
go test ./...
to ensure that all checks and tests pass.
Then:
- If you have something to show, start with a
Draft
PR. It's good to have early validation of your work and we highly recommend this practice. A Draft PR also indicates to the community that the work is in progress. Draft PRs also helps the core team provide early feedback and ensure the work is in the right direction. - When the code is complete, change your PR from
Draft
toReady for Review
. - Go through the actions for each checkbox present in the PR template description. The PR actions are automatically provided for each new PR.
PRs must have a category prefix that is based on the type of changes being made (for example, fix
, feat
,
refactor
, docs
, and so on). The type must be included in the PR title as a prefix (for example,
fix: <description>
). This convention ensures that all changes that are committed to the base branch follow the
Conventional Commits specification.
Additionally, each PR should only address a single issue.
Pull requests are merged by one of core developers.
NOTE: when merging, GitHub will squash commits and rebase on top of the main.
There are three PR templates. The default template is for types fix
, feat
, and refactor
. We also have a docs template for documentation changes and an other template for changes that do not affect production code. When previewing a PR before it has been opened, you can change the template by adding one of the following parameters to the url:
template=docs.md
template=other.md
In order to accommodate the review process, the author of the PR must complete the author checklist (from the pull request template) to the best of their abilities before marking the PR as "Ready for Review". If you would like to receive early feedback on the PR, open the PR as a "Draft" and leave a comment in the PR indicating that you would like early feedback and tagging whoever you would like to receive feedback from.
All PRs require at least one review approval before they can be merged. Each PR template has a reviewers checklist that must be completed before the PR can be merged. Each reviewer is responsible for all checked items unless they have indicated otherwise by leaving their handle next to specific items. In addition, use the following review explanations:
LGTM
without an explicit approval means that the changes look good, but you haven't thoroughly reviewed the reviewer checklist items.Approval
means that you have completed some or all of the reviewer checklist items. If you only reviewed selected items, you must add your handle next to the items that you have reviewed. In addition, follow these guidelines:- You must also think through anything which ought to be included but is not
- You must think through whether any added code could be partially combined (DRYed) with existing code
- You must think through any potential security issues or incentive-compatibility flaws introduced by the changes
- Naming must be consistent with conventions and the rest of the codebase
- Code must live in a reasonable location, considering dependency structures (for example, not importing testing modules in production code, or including example code modules in production code).
- If you approve the PR, you are responsible for any issues mentioned here and any issues that should have been addressed after thoroughly reviewing the reviewer checklist items in the pull request template.
- If you sat down with the PR submitter and did a pairing review, add this information in the
Approval
or your PR comments. - If you are only making "surface level" reviews, submit notes as a
comment
review.
If you open a PR on Elys, it is mandatory to update the relevant documentation in /docs
.
- If your changes relate to a module, then be sure to update the module's spec in
x/{moduleName}/README.md
.
User-facing repos should adhere to the trunk based development branching model: https://trunkbaseddevelopment.com. User branches should start with a user name, example: {moniker}/{issue#}-branch-name
.
The Elys repository is a multi Go module repository. It means that we have more than one Go module in a single repository.
Elys utilizes semantic versioning.
Ensure that you base and target your PR on the main
branch.
All feature additions and all bug fixes must be targeted against main
. Exception is for bug fixes which are only related to a released version. In that case, the related bug fix PRs must target against the release branch.
If needed, we backport a commit from main
to a release branch (excluding consensus breaking feature, API breaking and similar).