github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/CONTRIBUTING.md (about)

     1  # How to contribute
     2  
     3  ydb-go-sdk (and YDB also) is an open project, and you can contribute to it in many ways. You can help with ideas, code, or documentation. We appreciate any efforts that help us to make the project better.
     4  
     5  Thank you!
     6  
     7  ## Table of contents
     8    * [Legal Info](#legal-info)
     9    * [Technical Info](#technical-info)
    10      * [Instructions for checks code changes locally](#instructions-for-checks-code-changes-locally)
    11        + [Prerequisites](#prerequisites)
    12        + [Run linter checks](#run-linter-checks)
    13        + [Run tests](#run-tests)
    14          - [Only unit tests](#only-unit-tests)
    15          - [All tests (include integration tests)](#all-tests)
    16  
    17  ## Legal Info
    18  
    19  In order for us (YANDEX LLC) to accept patches and other contributions from you, you will have to adopt our Yandex Contributor License Agreement (the “**CLA**”). The current version of the CLA you may find here:
    20  1) https://yandex.ru/legal/cla/?lang=en (in English) and
    21  2) https://yandex.ru/legal/cla/?lang=ru (in Russian).
    22  
    23  ## Technical Info
    24  
    25  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
    26  2. Fork the repository <https://github.com/ydb-platform/ydb-go-sdk> on GitHub to start making your changes to the **master** branch (or branch off of it).
    27  3. Write a test which shows that the bug was fixed or that the feature works as expected.
    28  4. Send a pull request and bug the maintainer until it gets merged and published.
    29  
    30  ### Instructions for checks code changes locally
    31  
    32  #### Prerequisites
    33  
    34  - Docker. See [official documentations](https://docs.docker.com/engine/install/) for install `docker` to your operating system
    35  - go >= 1.18. See [official instructions](https://go.dev/doc/install) for install `golang` to your operating system
    36  - golangci-lint >= 1.48.0. See [official instructions](https://golangci-lint.run/usage/install/) for install `golangci-lint` to your operating system
    37  
    38  #### Run linter checks
    39  
    40  All commands must be called from project directory.
    41  
    42  ```sh
    43  golangci-lint run ./...
    44  ```
    45  
    46  #### Run tests
    47  
    48  All commands must be called from project directory.
    49  
    50  ##### Only unit tests
    51  
    52  ```sh
    53  go test -race -tags fast ./... 
    54  ```
    55  
    56  ##### All tests
    57  
    58  ```sh
    59  docker run -itd --name ydb -dp 2135:2135 -dp 2136:2136 -dp 8765:8765 -v `pwd`/ydb_certs:/ydb_certs -e YDB_LOCAL_SURVIVE_RESTART=true -e YDB_USE_IN_MEMORY_PDISKS=true -h localhost ydbplatform/local-ydb:latest
    60  export YDB_CONNECTION_STRING="grpcs://localhost:2135/local"
    61  export YDB_SSL_ROOT_CERTIFICATES_FILE="`pwd`/ydb_certs/ca.pem"
    62  export YDB_SESSIONS_SHUTDOWN_URLS="http://localhost:8765/actors/kqp_proxy?force_shutdown=all"
    63  go test -race ./... 
    64  docker stop ydb
    65  ```