github.com/jfrog/jfrog-cli-platform-services@v1.2.0/CONTRIBUTING.md (about)

     1  # Contribution Guide
     2  
     3  Welcome to the contribution guide for our project! We appreciate your interest in contributing to the development of this project. Below, you will find essential information on local development, running tests, and guidelines for submitting pull requests.
     4  
     5  ## Table of Contents
     6  
     7  - [🏠🏗️ Local development](#%EF%B8%8F-local-development)
     8  - [🚦 Running Tests](#-running-tests)
     9  - [📖 Submitting PR Guidelines](#-submitting-pr-guidelines)
    10  
    11  
    12  ## 🏠🏗️ Local Development
    13  
    14  To run a command locally, use the following command template:
    15  
    16  ```sh
    17  go run github.com/jfrog/jfrog-cli-platform-services command [options] [arguments...]
    18  ```
    19  
    20  ---
    21  
    22  This project heavily depends on the following modules:
    23  
    24  - [github.com/jfrog/jfrog-client-go](https://github.com/jfrog/jfrog-client-go)
    25  - [github.com/jfrog/jfrog-cli-core](github.com/jfrog/jfrog-cli-core)
    26  
    27  During local development, if you come across code that needs to be modified in one of the mentioned modules, it is advisable to replace the dependency with a local clone of the module.
    28  
    29  <details>
    30  <summary>Replacing a dependency with a local clone</summary>
    31  
    32  ---
    33  
    34  To include this local dependency, For instance, let's assume you wish to modify files from `jfrog-cli-core`, modify the `go.mod` file as follows:
    35  
    36  ```
    37  replace github.com/jfrog/jfrog-cli-core/v2 => /local/path/in/your/machine/jfrog-cli-core
    38  ```
    39  
    40  Afterward, execute `go mod tidy` to ensure the Go module files are updated. Note that Go will automatically adjust the version in the `go.mod` file.
    41  
    42  ---
    43  
    44  </details>
    45  
    46  
    47  ## 🚦 Running Tests
    48  
    49  To run tests, use the following command:
    50  
    51  ```
    52  ./.github/scripts/gotest.sh ./...
    53  ```
    54  
    55  ## 📖 Submitting PR Guidelines
    56  
    57  Once you have completed your coding changes, it is recommended to push the modifications made to the other modules first. Once these changes are pushed, you can update this project to resolve dependencies from your GitHub fork or branch.
    58  
    59  <details>
    60  
    61  <summary>Resolve dependencies from GitHub fork or branch</summary>
    62  
    63  ---
    64  
    65  To achieve this, modify the `go.mod` file to point the dependency to your repository and branch, as shown in the example below:
    66  
    67  ```
    68  replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 dev
    69  ```
    70  
    71  Finally, execute `go mod tidy` to update the Go module files. Please note that Go will automatically update the version in the `go.mod` file.
    72  
    73  ---
    74  
    75  </details>
    76  
    77  ### Before submitting the pull request, ensure:
    78  
    79  - Your changes are covered by `unit` and `integration` tests. If not, please add new tests.
    80  - The code compiles, by running `go vet ./...`.
    81  - To format the code, by running `go fmt ./...`.
    82  - The documentation covers the changes, if not please add and make changes at [The documentation repository](https://github.com/jfrog/documentation)
    83  
    84  ### When creating the pull request, ensure:
    85  
    86  - The pull request is on the `main` branch.
    87  - The pull request description describes the changes made.