github.com/asynkron/protoactor-go@v0.0.0-20240308120642-ef91a6abee75/CONTRIBUTING.md (about)

     1  # Contributing to Proto.Actor
     2  
     3  In case of questions about the contribution process or for discussion of specific issues please visit
     4  the [Proto.Actor gitter chat](https://gitter.im/asynkron/gam).
     5  
     6  # Navigating around the project & codebase
     7  
     8  ## Branches summary
     9  
    10  Depending on which version (or sometimes module) you want to work on, you should target a specific branch as explained
    11  below:
    12  
    13  * `dev` – active development branch of Proto.Actor beta.
    14  
    15  ## Tags
    16  
    17  Proto.Actor uses tags to categorise issues into groups or mark their phase in development.
    18  
    19  Most notably many tags start with a `t:` prefix (as in `topic:`), which categorises issues in terms of which module they
    20  relate to. Examples are:
    21  
    22  - [t:actor](https://github.com/asynkron/protoactor-go/labels/t%3Aactor)
    23  - [t:remote](https://github.com/asynkron/protoactor-go/labels/t%3Aremote)
    24  - [t:cluster](https://github.com/asynkron/protoactor-go/labels/t%3Acluster)
    25  - [t:router](https://github.com/asynkron/protoactor-go/labels/t%3Arouter)
    26  - [See all labels](https://github.com/asynkron/protoactor-go/labels)
    27  
    28  In general *all issues are open for anyone working on them*, however if you're new to the project and looking for an
    29  issue
    30  that will be accepted and likely is a nice one to get started you should check out the following tags:
    31  
    32  - [community](https://github.com/asynkron/protoactor-go/labels/community) - which identifies issues that the core team
    33    will likely not have time to work on, or the issue is a nice entry level ticket. If you're not sure how to solve a
    34    ticket but would like to work on it feel free to ask in the issue about clarification or tips.
    35  - [nice-to-have (low-priority)](https://github.com/asynkron/protoactor-go/labels/nice-to-have) - are tasks which make
    36    sense, however are not very high priority (in case of other very high priority issues). If you see something
    37    interesting in this list, a contribution would be really wonderful!
    38  
    39  Another group of tickets are those which start from a number. They're used to signal in what phase of development an
    40  issue is:
    41  
    42  - [0 - new](https://github.com/Proto.Actor/Proto.Actor/labels/0%20-%20new) - is assigned when a ticket is unclear on its
    43    purpose or if it is valid or not. Sometimes the additional tag `discuss` is used to mark such tickets, if they propose
    44    large scale changes and need more discussion before moving into triaged (or being closed as invalid).
    45  - [1 - triaged](https://github.com/Proto.Actor/Proto.Actor/labels/1%20-%20triaged) - roughly speaking means "this ticket
    46    makes sense". Triaged tickets are safe to pick up for contributing in terms of likeliness of a patch for it being
    47    accepted. It is not recommended to start working on a ticket that is not triaged.
    48  - [2 - pick next](https://github.com/Proto.Actor/Proto.Actor/labels/2%20-%20pick%20next) - used to mark issues which are
    49    next up in the queue to be worked on. Sometimes it's also used to mark which PRs are expected to be reviewed/merged
    50    for the next release. The tag is non-binding, and mostly used as an organisational helper.
    51  - [3 - in progress](https://github.com/Proto.Actor/Proto.Actor/labels/3%20-%20in%20progress) - means someone is working
    52    on this ticket. If you see a ticket that has the tag, however seems inactive, it could have been an omission with
    53    removing the tag, feel free to ping the ticket then if it's still being worked on.
    54  
    55  The last group of special tags indicate specific states a ticket is in:
    56  
    57  - [bug](https://github.com/asynkron/protoactor-go/labels/bug) - bugs take priority in being fixed above features. The
    58    core team dedicates a number of days to working on bugs each sprint. Bugs which have reproducers are also great for
    59    community contributions as they're well isolated. Sometimes we're not as lucky to have reproducers though, then a
    60    bugfix should also include a test reproducing the original error along with the fix.
    61  
    62  # Proto.Actor contributing guidelines
    63  
    64  These guidelines apply to all Proto.Actor projects, by which we mean both the `asynkron/protoactor-go` repository,
    65  as well as any plugins or additional repositories located under the asynkron/protoactor*.
    66  
    67  These guidelines are meant to be a living document that should be changed and adapted as needed.
    68  We encourage changes that make it easier to achieve our goals in an efficient way.
    69  
    70  ## General workflow
    71  
    72  The steps below describe how to get a patch into a main development branch (e.g. `dev`).
    73  The steps are exactly the same for everyone involved in the project (be it core team, or first time contributor).
    74  
    75  1. Make sure an issue exists in the [issue tracker](https://github.com/asynkron/protoactor-go/issues) for the work you
    76     want to contribute.
    77      - If there is no ticket for it, [create one](https://github.com/asynkron/protoactor-go/issues/new) first.
    78  1. [Fork the project](https://github.com/asynkron/protoactor-go#fork-destination-box) on GitHub. You'll need to create a
    79     feature-branch for your work on your fork, as this way you'll be able to submit a pull request against the mainline
    80     Proto.Actor.
    81  1. Create a branch on your fork and work on the feature. For
    82     example: `git checkout -b wip-custom-serialization-protoactor`
    83      - Please make sure to follow the general quality guidelines (specified below) when developing your patch.
    84      - Please write additional tests covering your feature and adjust existing ones if needed before submitting your pull
    85        request.
    86  1. Once your feature is complete, prepare the commit following
    87     our [Creating Commits And Writing Commit Messages](#creating-commits-and-writing-commit-messages). For example, a
    88     good commit message would be: `Adding compression support for Manifests #22222` (note the reference to the ticket it
    89     aimed to resolve).
    90  1. If it's a new feature, or a change of behaviour, document it on
    91     the [Proto.Actor-docs](https://github.com/asynkron/gam-web/tree/master/src/docs), remember, an undocumented feature
    92     is not a feature.
    93  1. Now it's finally time to [submit the pull request](https://help.github.com/articles/using-pull-requests)!
    94  1. If you have not already done so, you will be asked by our CLA bot
    95     to [sign the Asynkron CLA](https://cla-assistant.io/asynkron/protoactor-go) online. CLA stands for Contributor
    96     License Agreement and is a way of protecting intellectual property disputes from harming the project.
    97  1. Now both committers and interested people will review your code. This process is to ensure the code we merge is of
    98     the best possible quality, and that no silly mistakes slip though. You're expected to follow-up these comments by
    99     adding new commits to the same branch. The commit messages of those commits can be more lose, for
   100     example: `Removed debugging using printline`, as they all will be squashed into one commit before merging into the
   101     main branch.
   102      - The community and team are really nice people, so don't be afraid to ask follow up questions if you didn't
   103        understand some comment, or would like clarification on how to continue with a given feature. We're here to help,
   104        so feel free to ask and discuss any kind of questions you might have during review!
   105  1. After the review you should fix the issues as needed (pushing a new commit for new review etc.), iterating until the
   106     reviewers give their thumbs up–which is signalled usually by a comment saying `LGTM`, which means "Looks Good To Me".
   107      - In general a PR is expected to get 2 LGTMs from the team before it is merged. If the PR is trivial, or under
   108        special circumstances (such as most of the team being on vacation, a PR was very thoroughly reviewed/tested and
   109        surely is correct) one LGTM may be fine as well.
   110  1. Once everything is said and done, your pull request gets merged :tada: Your feature will be available with the next
   111     “earliest” release milestone (i.e. if back-ported so that it will be in release x.y.z, find the relevant milestone
   112     for that release). And of course you will be given credit for the fix in the release stats during the release's
   113     announcement. You've made it!
   114  
   115  The TL;DR; of the above very precise workflow version is:
   116  
   117  1. Fork Proto.Actor
   118  2. Hack and test on your feature (on a branch)
   119  3. Document it
   120  4. Submit a PR
   121  5. Sign the CLA if necessary
   122  6. Keep polishing it until received enough LGTM
   123  7. Profit!
   124  
   125  ## Pull request requirements
   126  
   127  For a pull request to be considered at all it has to meet these requirements:
   128  
   129  1. Regardless if the code introduces new features or fixes bugs or regressions, it must have comprehensive tests.
   130  1. The code must be well documented (see the ‘Documentation’ section below).
   131  1. The commit messages must properly describe the changes, see further below.
   132  1. All Asynkron projects must include Asynkron copyright notices. Each project can choose between one of two approaches:
   133  
   134      1. All source files in the project must have a Asynkron copyright notice in the file header.
   135      1. The Notices file for the project includes the Asynkron copyright notice and no other files contain copyright
   136         notices. See http://www.apache.org/legal/src-headers.html for instructions for managing this approach for
   137         copyrights.
   138  
   139     Proto.Actor uses the first choice, having copyright notices in every file header.
   140  
   141  ### Additional guidelines
   142  
   143  Some additional guidelines regarding source code are:
   144  
   145  - Files should start with a ``Copyright (C) 2017 Asynkron.se <http://www.asynkron.se>`` copyright header.
   146  - Keep the code [DRY](http://programmer.97things.oreilly.com/wiki/index.php/Don%27t_Repeat_Yourself).
   147  - Apply the [Boy Scout Rule](http://programmer.97things.oreilly.com/wiki/index.php/The_Boy_Scout_Rule) whenever you have
   148    the chance to.
   149  - Never delete or change existing copyright notices, just add additional info.
   150  - Do not use ``@author`` tags since it does not
   151    encourage [Collective Code Ownership](http://www.extremeprogramming.org/rules/collective.html).
   152      - Contributors , each project should make sure that the contributors gets the credit they deserve—in a text file or
   153        page on the project website and in the release notes etc.
   154  
   155  If these requirements are not met then the code should **not** be merged into dev or master, or even reviewed -
   156  regardless of how good or important it is. No exceptions.
   157  
   158  Whether or not a pull request (or parts of it) shall be back- or forward-ported will be discussed on the pull request
   159  discussion page, it shall therefore not be part of the commit messages. If desired the intent can be expressed in the
   160  pull request description.
   161  
   162  ## Documentation
   163  
   164  All documentation must abide by the following maxims:
   165  
   166  - Example code should be run as part of an automated test suite.
   167  - Generation should be **completely automated** and available for scripting.
   168  
   169  All documentation must be in markup format.
   170  
   171  ### Go doc
   172  
   173  Proto.Actor generates Go-style API documentation using `go doc`.
   174  
   175  ## External dependencies
   176  
   177  All the external runtime dependencies for the project, including transitive dependencies, must have an open source
   178  license that is equal to, or compatible with, [Apache 2](http://www.apache.org/licenses/LICENSE-2.0).
   179  
   180  This must be ensured by manually verifying the license for all the dependencies for the project:
   181  
   182  1. Whenever a committer to the project changes a version of a dependency in the build file.
   183  2. Whenever a committer to the project adds a new dependency.
   184  3. Whenever a new release is cut (public or private for a customer).
   185  
   186  Which licenses are compatible with Apache 2 are defined
   187  in [this doc](http://www.apache.org/legal/3party.html#category-a), where you can see that the licenses that are listed
   188  under ``Category A`` are automatically compatible with Apache 2, while the ones listed under ``Category B`` need
   189  additional action:
   190  
   191  > Each license in this category requires some degree
   192  > of [reciprocity](http://www.apache.org/legal/3party.html#define-reciprocal); therefore, additional action must be taken
   193  > in order to minimize the chance that a user of an Apache product will create a derivative work of a
   194  > reciprocally-licensed portion of an Apache product without being aware of the applicable requirements.
   195  
   196  Each project must also create and maintain a list of all dependencies and their licenses, including all their transitive
   197  dependencies. This can be done either in the documentation or in the build file next to each dependency.
   198  
   199  ## Creating commits and writing commit messages
   200  
   201  Follow these guidelines when creating public commits and writing commit messages.
   202  
   203  1. If your work spans multiple local commits (for example; if you do safe point commits while working in a feature
   204     branch or work in a branch for a long time doing merges/rebases etc.) then please do not commit it all but rewrite
   205     the history by squashing the commits into a single big commit which you write a good commit message for (like
   206     discussed in the following sections). For more info read this
   207     article: [Git Workflow](http://sandofsky.com/blog/git-workflow.html). Every commit should be able to be used in
   208     isolation, cherry picked etc.
   209  
   210  2. The first line should be a descriptive sentence what the commit is doing, including the ticket number. It should be
   211     possible to fully understand what the commit does—but not necessarily how it does it—by just reading this single
   212     line. We follow the “imperative present tense” style for commit
   213     messages ([more info here](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)).
   214  
   215     It is **not ok** to only list the ticket number, type "minor fix" or similar.
   216     If the commit is a small fix, then you are done. If not, go to 3.
   217  
   218  3. Following the single line description should be a blank line followed by an enumerated list with the details of the
   219     commit.
   220  
   221  4. You can request review by a specific team member for your commit (depending on the degree of automation we reach, the
   222     list may change over time):
   223      * ``Review by @gituser`` - if you want to notify someone on the team. The others can, and are encouraged to
   224        participate.
   225  
   226  Example:
   227  
   228      enable Travis CI #1
   229  
   230      * Details 1
   231      * Details 2
   232      * Details 3
   233  
   234  # Supporting infrastructure
   235  
   236  ## Continuous integration
   237  
   238  Each project should be configured to use a continuous integration (CI) tool (i.e. a build server à la Travis).
   239  
   240  ## Related links
   241  
   242  * [Proto.Actor Contributor License Agreement](https://cla-assistant.io/asynkron/protoactor-go)
   243  * [Proto.Actor Issue Tracker](https://github.com/asynkron/protoactor-go/issues)